/*!
 * ثروت‌سنج — استایل اصلی
 * طراحی واکنش‌گرا، RTL و بدون وابستگی به CDN
 */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Variable.woff2?v=33') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}


:root {
  --font: 'Vazirmatn', Tahoma, Arial, sans-serif;

  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #f8f5ef;
  --surface-3: #f1ece1;
  --field: #fcfbf8;
  --ink: #111827;
  --ink-2: #344054;
  --muted: #6b7280;
  --line: #e8e2d6;
  --line-strong: #d5ccba;

  --gold: #c4922e;
  --gold-light: #e6b95c;
  --gold-deep: #9c6f16;
  --gold-soft: #f7ecd1;
  --gold-ring: rgba(196, 146, 46, 0.16);

  --emerald: #0f766e;
  --blue: #3b82f6;
  --rose: #d9534f;
  --purple: #7c5cff;
  --positive: #0e7a58;
  --negative: #c2413a;

  --header-bg: rgba(245, 242, 234, 0.84);
  --tooltip-bg: #111827;
  --shadow-lg: 0 24px 55px -32px rgba(17, 24, 39, 0.38);
  --shadow-md: 0 16px 36px -26px rgba(17, 24, 39, 0.38);
  --shadow-sm: 0 8px 24px -20px rgba(17, 24, 39, 0.32);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;

  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #080d14;
  --surface: #101a27;
  --surface-2: #162231;
  --surface-3: #1c2a3a;
  --field: #0c1520;
  --ink: #f2f5f8;
  --ink-2: #cbd5e1;
  --muted: #8da0b5;
  --line: #223042;
  --line-strong: #31445a;

  --gold: #e6b45c;
  --gold-light: #f6d488;
  --gold-deep: #c8912d;
  --gold-soft: rgba(230, 180, 92, 0.12);
  --gold-ring: rgba(230, 180, 92, 0.2);

  --emerald: #3dd6b0;
  --blue: #6ea8fe;
  --rose: #ff8179;
  --purple: #a48cff;
  --positive: #4ade9f;
  --negative: #ff7a72;

  --header-bg: rgba(8, 13, 20, 0.84);
  --tooltip-bg: #1c2a3a;
  --shadow-lg: 0 28px 65px -34px rgba(0, 0, 0, 0.95);
  --shadow-md: 0 18px 40px -28px rgba(0, 0, 0, 0.9);
  --shadow-sm: 0 10px 28px -22px rgba(0, 0, 0, 0.85);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(230, 185, 92, 0.2), transparent 66%),
    radial-gradient(760px 520px at 0% 18%, rgba(15, 118, 110, 0.1), transparent 64%),
    linear-gradient(180deg, transparent 0%, var(--bg) 55%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(to left, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 45% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 45% at 50% 0%, #000 0%, transparent 78%);
}

::selection {
  background: var(--gold);
  color: #161006;
}

img,
svg {
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  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: -100px;
  right: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ============================== Header ============================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 1240px;
  min-height: 76px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #18232c, #090e14);
  border: 1px solid rgba(230, 185, 92, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 18px -12px rgba(0, 0, 0, 0.6);
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-text small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 500;
}

.tool-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  margin-inline-end: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn .icon {
  width: 16px;
  height: 16px;
}

.nav-btn:hover {
  color: var(--ink);
}

.nav-btn.is-active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.icon-btn .icon {
  width: 19px;
  height: 19px;
}

[data-theme='light'] .theme-icon-sun,
[data-theme='dark'] .theme-icon-moon {
  display: none;
}

/* ============================== Layout ============================== */

.shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  vertical-align: -3px;
}

/* ============================== Hero ============================== */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 56px;
  align-items: center;
  padding: 66px 0 58px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 4px rgba(14, 122, 88, 0.12);
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--positive);
  opacity: 0;
  animation: pulse-ring 2.6s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  80%,
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.hero h1 {
  max-width: 720px;
  margin: 20px 0 18px;
  font-size: clamp(2.5rem, 4.8vw, 4.3rem);
  font-weight: 850;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.gold-text {
  background: linear-gradient(100deg, var(--gold-deep) 0%, var(--gold-light) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn-primary {
  border-color: rgba(156, 111, 22, 0.4);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1b1203;
  box-shadow: 0 14px 28px -16px rgba(196, 146, 46, 0.75);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -16px rgba(196, 146, 46, 0.85);
}

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

.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

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

.hero-stat span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 550;
}

.hero-stat strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-stat strong.is-profit {
  color: var(--positive);
}

.hero-stat strong.is-loss {
  color: var(--negative);
}

/* Hero visual */

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.hero-visual::before {
  content: '';
  position: absolute;
  top: 8%;
  right: 4%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 185, 92, 0.36), transparent 68%);
  filter: blur(18px);
  pointer-events: none;
}

.wealth-card {
  position: relative;
  width: 100%;
  max-width: 392px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(230, 185, 92, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(230, 185, 92, 0.16), transparent 55%),
    linear-gradient(155deg, #13251f 0%, #0a111a 62%, #080d14 100%);
  color: #f7f3e9;
  box-shadow:
    0 40px 80px -40px rgba(8, 13, 20, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: rotate(-1.2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wealth-card:hover {
  transform: rotate(0deg) translateY(-3px);
}

.wealth-card::after {
  content: '';
  position: absolute;
  top: -74px;
  left: -54px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 34px solid rgba(230, 185, 92, 0.08);
  pointer-events: none;
}

.wc-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(247, 243, 233, 0.68);
  font-size: 0.74rem;
  font-weight: 600;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(74, 222, 159, 0.24);
  border-radius: 999px;
  background: rgba(74, 222, 159, 0.09);
  color: #6be3b1;
  font-size: 0.64rem;
  font-weight: 700;
}

.live-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6be3b1;
}

.wc-value {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.wc-label {
  display: block;
  color: rgba(247, 243, 233, 0.62);
  font-size: 0.76rem;
}

.wc-amount {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wc-chart {
  position: relative;
  z-index: 1;
  margin: 18px -4px 8px;
  height: 108px;
  direction: ltr;
}

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

.wc-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.alloc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(247, 243, 233, 0.82);
  font-size: 0.66rem;
  font-weight: 600;
}

.alloc-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

/* ============================== Views ============================== */

.tool-view {
  display: none;
  scroll-margin-top: 100px;
}

.tool-view.is-active {
  display: block;
  animation: view-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 20px;
}

.view-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.view-head h2 {
  margin: 0 0 5px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.view-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.segmented {
  display: inline-flex;
  flex: none;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.seg-btn {
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.workspace {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* ============================== Cards ============================== */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.input-card {
  padding: 22px;
}

@media (min-width: 1051px) {
  .input-card {
    position: sticky;
    top: 96px;
  }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card-head h3 {
  margin: 0 0 3px;
  font-size: 1rem;
  font-weight: 750;
}

.card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.7;
}

.text-btn {
  flex: none;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  border-bottom: 1px dashed var(--line-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.mode-panel.hidden,
.hidden {
  display: none !important;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 0.79rem;
  font-weight: 650;
  line-height: 1.6;
}

.field label small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 500;
}

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

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

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  direction: ltr;
  unicode-bidi: embed;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-shell:hover {
  border-color: var(--line-strong);
}

.input-shell:focus-within {
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--gold-ring);
}

.input-shell input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
  direction: ltr;
  unicode-bidi: plaintext;
}

.input-shell input::placeholder {
  color: var(--muted);
  opacity: 0.65;
  font-weight: 500;
}

.input-shell .unit {
  flex: none;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.input-shell.is-invalid {
  border-color: var(--negative);
  box-shadow: 0 0 0 4px rgba(194, 65, 58, 0.1);
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.7;
}

.range-box {
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
}

.range-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-line input[type='range'] {
  flex: 1;
  min-width: 0;
  height: 5px;
  accent-color: var(--gold);
  cursor: pointer;
}

.range-value {
  min-width: 58px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
}

.hint-box {
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.85;
}

.hint-box strong {
  color: var(--ink-2);
  font-weight: 650;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.calc-btn {
  width: 100%;
  min-height: 49px;
  border: 1px solid rgba(156, 111, 22, 0.4);
  border-radius: 13px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1b1203;
  font-size: 0.88rem;
  font-weight: 750;
  box-shadow: 0 12px 24px -16px rgba(196, 146, 46, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -16px rgba(196, 146, 46, 0.9);
}

.calc-btn:active {
  transform: translateY(0);
}

.calc-btn.purple {
  border-color: rgba(124, 92, 255, 0.4);
  background: linear-gradient(135deg, #a48cff, #7c5cff);
  color: #ffffff;
  box-shadow: 0 12px 24px -16px rgba(124, 92, 255, 0.7);
}

/* ============================== Results ============================== */

.results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.result-hero {
  position: relative;
  overflow: hidden;
  padding: 25px 26px;
  border-color: rgba(196, 146, 46, 0.22);
  background:
    radial-gradient(110% 130% at 100% 0%, rgba(230, 185, 92, 0.17), transparent 52%),
    linear-gradient(135deg, rgba(247, 236, 209, 0.38), transparent 62%),
    var(--surface);
}

[data-theme='dark'] .result-hero {
  background:
    radial-gradient(110% 130% at 100% 0%, rgba(230, 180, 92, 0.14), transparent 52%),
    linear-gradient(135deg, rgba(230, 180, 92, 0.05), transparent 62%),
    var(--surface);
}

.result-hero::after {
  content: '';
  position: absolute;
  top: -90px;
  left: -60px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 38px solid var(--gold-ring);
  pointer-events: none;
}

.result-hero.purple-accent {
  border-color: rgba(124, 92, 255, 0.24);
  background:
    radial-gradient(110% 130% at 100% 0%, rgba(124, 92, 255, 0.14), transparent 52%),
    linear-gradient(135deg, rgba(124, 92, 255, 0.04), transparent 62%),
    var(--surface);
}

.result-hero.purple-accent::after {
  border-color: rgba(124, 92, 255, 0.1);
}

.result-hero.is-updated {
  animation: result-pop 0.45s ease;
}

@keyframes result-pop {
  0% {
    box-shadow: 0 0 0 0 var(--gold-ring);
  }
  45% {
    box-shadow: 0 0 0 8px var(--gold-ring);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.result-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.result-number {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}

.result-number strong {
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.result-number small {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge .icon {
  width: 13px;
  height: 13px;
}

.badge.positive {
  border-color: rgba(14, 122, 88, 0.16);
  background: rgba(14, 122, 88, 0.09);
  color: var(--positive);
}

.badge.negative {
  border-color: rgba(194, 65, 58, 0.16);
  background: rgba(194, 65, 58, 0.09);
  color: var(--negative);
}

.badge.neutral {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.badge.gold {
  border-color: rgba(196, 146, 46, 0.2);
  background: var(--gold-soft);
  color: var(--gold);
}

.badge.purple {
  border-color: rgba(124, 92, 255, 0.2);
  background: rgba(124, 92, 255, 0.1);
  color: var(--purple);
}

.result-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}

.metric {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.metric-label {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(245px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.chart-card {
  min-width: 0;
  padding: 18px 18px 14px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.chart-head h3 {
  margin: 0 0 2px;
  font-size: 0.92rem;
  font-weight: 750;
}

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

.chart-pill {
  flex: none;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

.chart {
  min-width: 0;
  margin-top: 4px;
}

.chart-canvas {
  position: relative;
  direction: ltr;
  touch-action: pan-y;
}

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

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart-grid-v {
  stroke-dasharray: 2 7;
  opacity: 0.7;
}

.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

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

.chart-reference {
  stroke: var(--negative);
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
  opacity: 0.75;
}

.chart-reference-h {
  stroke: var(--emerald);
  opacity: 0.55;
}

.chart-reference-label {
  fill: var(--negative);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 650;
}

.chart-marker {
  fill: var(--surface);
  stroke: var(--gold);
  stroke-width: 2.5;
}

.chart-crosshair {
  stroke: var(--ink-2);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.35;
}

.chart-hover-dot {
  stroke: var(--surface);
  stroke-width: 2;
  fill: var(--gold);
}

.chart-hit-area {
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 132px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: var(--tooltip-bg);
  color: #ffffff;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.7);
  font-size: 0.67rem;
  line-height: 1.6;
  pointer-events: none;
  transform: translate(-50%, -112%);
  direction: rtl;
}

[data-theme='dark'] .chart-tooltip {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chart-tooltip-title {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.62rem;
  font-weight: 600;
}

[data-theme='dark'] .chart-tooltip-title {
  color: var(--muted);
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.chart-tooltip-row i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

.chart-tooltip-row b {
  margin-inline-start: auto;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.69rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.side-card {
  padding: 18px;
}

.side-card h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 750;
}

.side-card .side-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.7;
}

.target-list {
  display: flex;
  flex-direction: column;
}

.target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.target-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.target-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 550;
}

.target-tag {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
}

.target-tag.be {
  background: rgba(194, 65, 58, 0.1);
  color: var(--negative);
}

.target-tag.p1 {
  background: rgba(15, 118, 110, 0.08);
  color: var(--emerald);
}

.target-tag.p3 {
  background: rgba(15, 118, 110, 0.12);
  color: var(--emerald);
}

.target-tag.p5 {
  background: rgba(15, 118, 110, 0.17);
  color: var(--emerald);
}

.target-tag.p10 {
  background: rgba(196, 146, 46, 0.14);
  color: var(--gold);
}

.target-price {
  flex: none;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.target-row.is-key .target-price {
  color: var(--gold);
}

/* Details */

.details-card {
  overflow: hidden;
  padding: 0;
}

.details-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

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

.summary-side {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.25s ease, color 0.2s ease;
}

.details-card[open] .summary-icon {
  transform: rotate(45deg);
  color: var(--gold);
}

.details-body {
  padding: 2px 20px 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  color: var(--ink-2);
  font-size: 0.78rem;
}

.detail-row > span:first-child {
  color: var(--muted);
}

.detail-row > span:last-child {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.detail-row.total {
  margin-top: 5px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 750;
}

.detail-row.total > span:first-child {
  color: var(--ink);
  font-weight: 750;
}

.detail-row .positive {
  color: var(--positive);
}

.detail-row .negative {
  color: var(--negative);
}

/* Progress + breakdown */

.progress-block {
  margin-top: 18px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.69rem;
}

.progress-meta b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-fill.emerald {
  background: linear-gradient(90deg, var(--emerald), #3dd6b0);
}

.stack-bar {
  display: flex;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.stack-bar span {
  display: block;
  height: 100%;
  transition: width 0.5s ease;
}

.stack-bar span:first-child {
  border-start-start-radius: 999px;
  border-end-start-radius: 999px;
}

.stack-bar span:last-child {
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
}

.breakdown {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 16px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
}

.breakdown-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
}

.breakdown-name i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.breakdown-value {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.breakdown-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
}

.goal-ring-wrap {
  display: grid;
  place-items: center;
  padding: 8px 0 18px;
}

.goal-ring {
  --p: 0;
  display: grid;
  place-items: center;
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-2) 0);
  box-shadow: inset 0 0 0 1px var(--line);
}

.goal-ring-inner {
  display: grid;
  place-items: center;
  width: 73%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.goal-ring-inner strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.goal-ring-inner span {
  color: var(--muted);
  font-size: 0.65rem;
}

.goal-ring-inner small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.data-table th {
  padding: 8px 7px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.data-table td {
  padding: 8px 7px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  color: var(--muted);
}

.data-table td:last-child {
  color: var(--ink);
  font-weight: 650;
}

/* Donut */

.donut-wrap {
  display: grid;
  place-items: center;
  padding: 8px 0 14px;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 196px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--surface-2) 0 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut::before {
  content: '';
  position: absolute;
  inset: 23px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.donut-center span {
  color: var(--muted);
  font-size: 0.62rem;
}

.allocation-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 10px;
}

.alloc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}

.alloc-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 0.74rem;
}

.alloc-name i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.alloc-value {
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.alloc-track {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.alloc-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
}

/* ============================== About / FAQ ============================== */

.about-section {
  margin-top: 64px;
}

.section-heading {
  max-width: 660px;
  margin: 0 auto 28px;
  text-align: center;
}

.section-heading .view-kicker {
  margin-bottom: 6px;
}

.section-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.9;
}

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

.feature-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border: 1px solid rgba(196, 146, 46, 0.18);
  border-radius: 13px;
  background: var(--gold-soft);
  color: var(--gold);
}

.feature-icon .icon {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 0.94rem;
  font-weight: 750;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.9;
}

.faq {
  display: grid;
  gap: 9px;
  max-width: 840px;
  margin: 28px auto 0;
}

.faq-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: var(--ink);
  font-size: 0.81rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

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

.faq-item summary::after {
  content: '+';
  flex: none;
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0;
  padding: 0 18px 15px;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.95;
}

/* ============================== Footer ============================== */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px 34px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
}

.footer-brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

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

.footer-note {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.9;
}

.footer-meta {
  flex: none;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: left;
}

.footer-meta a {
  color: var(--gold);
  text-decoration: none;
}

.footer-meta a:hover {
  text-decoration: underline;
}

/* ============================== Responsive ============================== */

@media (max-width: 1120px) {
  .hero {
    gap: 34px;
  }

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

  .result-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(230px, 1fr);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 46px 0 40px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero-visual {
    order: 2;
    justify-content: flex-start;
    padding-inline-start: 8px;
  }

  .wealth-card {
    max-width: 460px;
    transform: none;
  }

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

  .input-card {
    position: static;
    min-width: 0;
  }

  .result-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr);
  }

  .view-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
    min-height: 0;
    padding: 10px 20px 11px;
  }

  .brand {
    margin-inline-end: auto;
  }

  .tool-nav {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .tool-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex: none;
  }

  .hero {
    padding-top: 38px;
  }
}

@media (max-width: 760px) {
  .shell {
    padding-inline: 16px;
  }

  .header-inner {
    padding-inline: 16px;
  }

  .hero {
    gap: 28px;
    padding-bottom: 32px;
  }

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

  .hero-lead {
    font-size: 0.92rem;
  }

  .hero-stats {
    gap: 12px;
  }

  .hero-stat strong {
    font-size: 0.92rem;
  }

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

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

  .view-head {
    margin-top: 3px;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .seg-btn {
    flex: 1;
    padding-inline: 10px;
  }

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

  .footer-inner {
    flex-direction: column;
    gap: 14px;
    padding-inline: 16px;
  }

  .footer-meta {
    text-align: right;
  }

  .chart-head {
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .brand-text small {
    display: none;
  }

  .tool-nav {
    overflow-x: visible;
    gap: 4px;
  }

  .nav-btn {
    flex: 1 1 0;
    justify-content: center;
    gap: 0;
    min-width: 0;
    padding-inline: 6px;
    font-size: 0.76rem;
  }

  .nav-btn .icon {
    display: none;
  }

  .brand-text strong {
    font-size: 0.98rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 8px;
  }

  .hero-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
  }

  .hero-stat:last-child {
    border-bottom: 0;
  }

  .hero-stat span {
    margin: 0;
  }

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

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

  .field-grid .field {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .input-card {
    padding: 18px;
  }

  .result-hero {
    padding: 20px;
  }

  .result-number strong {
    font-size: 1.85rem;
  }

  .result-metrics {
    gap: 7px;
    margin-top: 18px;
  }

  .metric {
    padding: 10px;
  }

  .metric-value {
    font-size: 0.82rem;
  }

  .chart-card {
    padding: 15px 12px 12px;
  }

  .chart-empty {
    min-height: 180px;
  }

  .details-card summary {
    padding: 14px 16px;
  }

  .details-body {
    padding-inline: 16px;
  }

  .side-card {
    padding: 16px;
  }

  .footer-inner {
    padding-bottom: 24px;
  }
}

@media (max-width: 380px) {
  .tool-nav {
    gap: 2px;
  }

  .data-table {
    font-size: 0.7rem;
  }

  .data-table th,
  .data-table td {
    padding-inline: 4px;
  }

  .nav-btn {
    padding-inline: 2px;
    font-size: 0.69rem;
  }

  .nav-btn .icon {
    display: none;
  }

  .brand-text strong {
    font-size: 0.9rem;
  }

  .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  body::after,
  .site-header,
  .hero-visual,
  .hero-actions,
  .tool-nav,
  .about-section,
  .site-footer,
  .calc-btn,
  .text-btn,
  .segmented {
    display: none !important;
  }

  .shell {
    max-width: 100%;
    padding: 0;
  }

  .hero {
    display: block;
    padding: 0 0 18px;
  }

  .hero h1 {
    font-size: 24pt;
  }

  .tool-view {
    display: none !important;
  }

  .tool-view.is-active {
    display: block !important;
  }

  .workspace {
    display: block;
  }

  .input-card {
    margin-bottom: 12px;
  }

  .card,
  .result-hero {
    box-shadow: none;
    break-inside: avoid;
  }

  .result-grid {
    display: block;
  }

  .chart-card,
  .side-card {
    margin-bottom: 12px;
  }
}
