:root {
  color-scheme: dark;
  --bg: #000000;
  --card: rgba(11, 14, 18, 0.66);
  --card-solid: #0c1014;
  --card-soft: rgba(255, 255, 255, 0.045);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.66);
  --line: rgba(255, 255, 255, 0.14);
  --gold: #d7a84f;
  --green: #8bd8b5;
  --green-soft: rgba(139, 216, 181, 0.12);
  --blue-soft: rgba(255, 255, 255, 0.055);
  --input: rgba(255, 255, 255, 0.07);
  --page-glow: rgba(255, 255, 255, 0.04);
  --page-wash: rgba(58, 70, 90, 0.38);
  --grid-line: rgba(255, 255, 255, 0.045);
  --ambient-a: rgba(58, 72, 96, 0.2);
  --ambient-b: rgba(255, 255, 255, 0.055);
  --ambient-c: rgba(15, 19, 26, 0.55);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 32px 90px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f8f5;
    --card: rgba(255, 255, 255, 0.72);
    --card-solid: #ffffff;
    --card-soft: rgba(255, 255, 255, 0.64);
    --text: #111412;
    --muted: rgba(17, 20, 18, 0.62);
    --line: rgba(17, 20, 18, 0.12);
    --gold: #b98730;
    --green: #176f53;
    --green-soft: rgba(23, 111, 83, 0.1);
    --blue-soft: rgba(17, 20, 18, 0.045);
    --input: rgba(255, 255, 255, 0.84);
    --page-glow: rgba(255, 255, 255, 0.68);
    --page-wash: rgba(132, 154, 128, 0.14);
    --grid-line: rgba(17, 20, 18, 0.035);
    --ambient-a: rgba(139, 216, 181, 0.12);
    --ambient-b: rgba(185, 135, 48, 0.08);
    --ambient-c: rgba(255, 255, 255, 0.48);
    --shadow: 0 22px 70px rgba(10, 13, 11, 0.12);
    --shadow-hover: 0 30px 90px rgba(10, 13, 11, 0.18);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --card: rgba(11, 14, 18, 0.66);
  --card-solid: #0c1014;
  --card-soft: rgba(255, 255, 255, 0.045);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.66);
  --line: rgba(255, 255, 255, 0.14);
  --gold: #d7a84f;
  --green: #8bd8b5;
  --green-soft: rgba(139, 216, 181, 0.12);
  --blue-soft: rgba(255, 255, 255, 0.055);
  --input: rgba(255, 255, 255, 0.07);
  --page-glow: rgba(255, 255, 255, 0.04);
  --page-wash: rgba(58, 70, 90, 0.38);
  --grid-line: rgba(255, 255, 255, 0.045);
  --ambient-a: rgba(58, 72, 96, 0.2);
  --ambient-b: rgba(255, 255, 255, 0.055);
  --ambient-c: rgba(15, 19, 26, 0.55);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 32px 90px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8f5;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --card-soft: rgba(255, 255, 255, 0.64);
  --text: #111412;
  --muted: rgba(17, 20, 18, 0.62);
  --line: rgba(17, 20, 18, 0.12);
  --gold: #b98730;
  --green: #176f53;
  --green-soft: rgba(23, 111, 83, 0.1);
  --blue-soft: rgba(17, 20, 18, 0.045);
  --input: rgba(255, 255, 255, 0.84);
  --page-glow: rgba(255, 255, 255, 0.68);
  --page-wash: rgba(132, 154, 128, 0.14);
  --grid-line: rgba(17, 20, 18, 0.035);
  --ambient-a: rgba(139, 216, 181, 0.12);
  --ambient-b: rgba(185, 135, 48, 0.08);
  --ambient-c: rgba(255, 255, 255, 0.48);
  --shadow: 0 22px 70px rgba(10, 13, 11, 0.12);
  --shadow-hover: 0 30px 90px rgba(10, 13, 11, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--page-glow), transparent 20rem),
    linear-gradient(125deg, var(--page-wash), transparent 42rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  pointer-events: none;
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 75%);
}

body::after {
  pointer-events: none;
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    linear-gradient(105deg, transparent 18%, var(--ambient-a) 32%, transparent 48%),
    linear-gradient(225deg, transparent 24%, var(--ambient-b) 40%, transparent 58%),
    linear-gradient(20deg, transparent 30%, var(--ambient-c) 52%, transparent 70%);
  filter: blur(28px);
  opacity: 0.62;
  transform: translate3d(0, 0, 0);
}

#vanta-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.16;
  mix-blend-mode: screen;
}

:root[data-theme="light"] #vanta-bg {
  opacity: 0.22;
  mix-blend-mode: multiply;
}

::selection {
  background: rgba(200, 145, 37, 0.26);
}

button,
input,
select {
  font: inherit;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0;
}

.theme-icon-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: grid;
  place-items: center;
  min-height: 40px;
  width: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px);
}

.theme-icon-button span {
  font-size: 1.04rem;
  line-height: 1;
}

.theme-icon-button:hover {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.intro,
.explain-card,
.panel,
.answer,
.saved-panel,
.learn-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  transition:
    transform 240ms ease,
    box-shadow 240ms ease,
    border-color 240ms ease;
}

.intro:hover,
.explain-card:hover,
.panel:hover,
.answer:hover,
.saved-panel:hover,
.learn-panel:hover {
  border-color: rgba(200, 145, 37, 0.26);
  box-shadow: var(--shadow-hover);
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
}

.intro {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 16px;
  min-height: 250px;
  background:
    linear-gradient(135deg, var(--green-soft), transparent 45%),
    var(--card);
  color: var(--text);
  padding: 26px;
}

.intro::before {
  display: none;
}

.intro > * {
  position: relative;
  z-index: 1;
}

.intro-copy {
  display: grid;
  align-content: center;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.58;
}

.intro p {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted);
}

.price-box {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  align-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.06);
  padding: 18px;
  transform-style: preserve-3d;
}

.price-box-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.top-currency {
  display: grid;
  gap: 5px;
  min-width: 112px;
}

.top-currency span {
  font-size: 0.72rem;
  text-align: right;
}

.top-currency select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--input);
  color: var(--text);
  padding: 0 26px 0 10px;
  font-weight: 850;
}

.price-box::after {
  content: "";
  position: absolute;
  inset: auto 18px 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  opacity: 0.42;
}

@media (prefers-color-scheme: dark) {
  .price-box {
    background: linear-gradient(135deg, rgba(74, 51, 15, 0.72), rgba(20, 49, 60, 0.72));
  }
}

:root[data-theme="dark"] .price-box {
  background: linear-gradient(135deg, rgba(74, 51, 15, 0.72), rgba(20, 49, 60, 0.72));
}

:root[data-theme="light"] .price-box {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.07);
}

.price-box span,
.answer span,
.cash-field span,
.manual-price span,
.settings-tools span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.price-box strong {
  color: var(--gold);
  font-size: 1.85rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.price-source-link {
  width: fit-content;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
}

.price-source-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.price-box small {
  min-height: 64px;
  color: var(--muted);
  line-height: 1.35;
}

#silverPriceDisplay {
  min-height: 0;
  color: var(--muted);
  font-weight: 750;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    box-shadow 180ms ease;
}

button:hover {
  background: var(--text);
  color: var(--bg);
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 31, 26, 0.16);
}

button:active {
  transform: translateY(0) scale(0.99);
}

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

.quiet-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.explain-card,
.panel,
.saved-panel,
.learn-panel {
  margin-bottom: 16px;
  padding: 24px;
}

.explain-card p:last-child {
  margin-bottom: 0;
}

.equation {
  position: relative;
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  color: var(--green);
  padding: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.equation::before {
  display: none;
}

.settings-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.mode-toggle {
  width: fit-content;
  display: flex;
  gap: 3px;
  align-items: center;
  margin: -6px 0 14px auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-soft) 72%, transparent);
  padding: 3px;
  opacity: 0.72;
  transition:
    opacity 180ms ease,
    border-color 180ms ease;
}

.mode-toggle:hover,
.mode-toggle:focus-within {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  opacity: 1;
}

.mode-button {
  min-height: 28px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.75rem;
  line-height: 1;
}

.mode-button.active {
  border-color: var(--line);
  background: var(--input);
  color: var(--text);
  box-shadow: none;
}

.mode-button:hover {
  transform: none;
  box-shadow: none;
}

body.simple-mode .advanced-only {
  display: none !important;
}

body.advanced-mode .simple-only {
  display: none !important;
}

body.simple-mode .karat-header {
  grid-template-columns: 1fr;
  border-top: 0;
  padding-top: 0;
}

body.simple-mode .karat-formula {
  display: none;
}

.settings-tools label,
.cash-field,
.silver-field,
.manual-price,
.profile-tools label {
  display: grid;
  gap: 8px;
}

.cash-field {
  margin-bottom: 22px;
}

.field-heading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.help-toggle {
  padding: 0;
  min-height: 24px;
  width: 24px;
  cursor: pointer;
  background: transparent;
}

.help-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.field-help {
  padding: 14px;
  border-inline-start: 3px solid var(--green);
  background: var(--card-soft);
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.field-help[hidden] {
  display: none;
}

.field-help p {
  margin: 0 0 8px;
}

.field-help p:not(:first-child) {
  margin-top: 12px;
}

.field-help a {
  color: var(--green);
}

.cash-field small,
.other-assets-field small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.help-link {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.help-link:hover {
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-1px);
}

.cash-field input,
.cash-field select,
.silver-field input,
.asset-grid input,
.liability-grid input,
.manual-price input,
.profile-tools input,
.profile-tools select,
.karat-row input,
.settings-tools input,
.settings-tools select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 20px,
    calc(100% - 12px) 20px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.cash-field input:focus,
.cash-field select:focus,
.silver-field input:focus,
.asset-grid input:focus,
.liability-grid input:focus,
.manual-price input:focus,
.profile-tools input:focus,
.profile-tools select:focus,
.karat-row input:focus,
.settings-tools input:focus,
.settings-tools select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 115, 86, 0.12);
  transform: translateY(-1px);
}

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

.asset-grid label {
  display: grid;
  gap: 8px;
}

.asset-grid span,
.liability-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.liability-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  padding: 14px;
}

.liability-section h2 {
  margin-bottom: 6px;
}

.liability-section p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.liability-grid {
  display: grid;
  gap: 10px;
}

.liability-grid label {
  display: grid;
  gap: 8px;
}

.silver-section {
  margin-bottom: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.silver-header {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 18px;
  align-items: end;
  margin-bottom: 12px;
}

.silver-header p {
  margin-bottom: 0;
}

.silver-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(150px, 0.8fr));
  gap: 10px;
  align-items: stretch;
}

.silver-field span,
.silver-stat span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.silver-stat {
  display: grid;
  gap: 8px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  padding: 10px 12px;
}

.silver-stat strong {
  color: var(--green);
  font-size: 1rem;
  line-height: 1.2;
}

.silver-formula {
  grid-column: 1 / -1;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.karat-header {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 18px;
  align-items: end;
  margin-bottom: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.karat-header p {
  margin-bottom: 0;
}

.manual-note {
  margin: -4px 0 14px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--text);
  padding: 12px;
  font-size: 0.92rem;
  font-weight: 750;
}

.profile-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.9fr) repeat(4, auto);
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  padding: 12px;
}

.profile-tools span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.hidden-file-input {
  display: none;
}

.karat-table {
  display: grid;
  gap: 8px;
}

.karat-row {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(110px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--input);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.karat-row:hover {
  border-color: rgba(20, 118, 87, 0.32);
  box-shadow: 0 14px 34px rgba(24, 34, 29, 0.08);
  transform: translateY(-2px);
}

.karat-name {
  font-weight: 900;
}

.karat-note,
.karat-value {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.karat-value {
  color: var(--green);
  text-align: right;
}

.karat-formula {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.calc-summary {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.calc-summary h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.calc-summary p {
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.calc-summary table {
  width: 100%;
  border-collapse: collapse;
}

.calc-summary th,
.calc-summary td {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 0.93rem;
}

.calc-summary th {
  color: var(--muted);
  font-weight: 800;
  text-align: left;
}

.calc-summary td {
  color: var(--text);
  font-weight: 850;
  text-align: right;
}

.summary-total th,
.summary-total td,
.summary-result th,
.summary-result td {
  color: var(--green);
}

.source-note {
  margin-top: 16px;
  border-radius: 8px;
  background: var(--card-soft);
  padding: 14px;
}

.source-note strong {
  display: block;
  margin-bottom: 4px;
}

.source-note p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

#priceComparison {
  margin-top: 10px;
  color: var(--text);
  font-weight: 750;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.source-links a {
  color: var(--green);
  font-weight: 850;
}

.source-links a {
  text-transform: lowercase;
  letter-spacing: 0;
}

.source-note code {
  border-radius: 4px;
  background: rgba(127, 139, 131, 0.18);
  padding: 1px 5px;
}

.answer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 20px;
}

.answer div:not(.action-row) {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  border-radius: 8px;
  background: var(--blue-soft);
  padding: 14px;
}

.answer div:not(.action-row)::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  opacity: 0.42;
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 240ms ease;
}

.answer div:not(.action-row):hover::after {
  transform: scaleX(1);
}

.answer strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.answer small {
  color: var(--muted);
  line-height: 1.4;
}

.zakat-result {
  background: var(--green-soft) !important;
}

.zakat-result strong {
  color: var(--green);
  font-size: 2rem;
}

#statusText {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 750;
}

.action-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

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

.saved-header h2 {
  margin-bottom: 0;
}

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

.saved-list p {
  margin-bottom: 0;
}

.saved-record {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  padding: 12px;
}

.saved-record strong {
  display: block;
}

.saved-record small {
  color: var(--muted);
  line-height: 1.4;
}

.saved-record button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.learn-panel p {
  margin-bottom: 14px;
}

.basis-note {
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--text);
  padding: 12px;
  font-weight: 750;
}

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

.learn-link {
  min-height: 126px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--green);
  padding: 14px;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.learn-link.primary {
  grid-column: 1 / -1;
  min-height: 108px;
  background:
    linear-gradient(135deg, var(--green-soft), transparent),
    var(--input);
}

.learn-link span {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.learn-link strong {
  color: var(--text);
  line-height: 1.2;
}

.learn-link small {
  color: var(--muted);
  line-height: 1.45;
}

.learn-link:hover {
  border-color: var(--green);
  box-shadow: 0 10px 22px rgba(20, 118, 87, 0.1);
  transform: translateY(-2px);
}

.motion-pop {
  animation: value-pop 420ms ease both;
}

.motion-flash {
  animation: soft-flash 720ms ease both;
}

@keyframes value-pop {
  0% {
    transform: scale(1);
  }

  38% {
    transform: scale(1.045);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes soft-flash {
  0% {
    box-shadow: inset 0 0 0 999px rgba(200, 145, 37, 0);
  }

  34% {
    box-shadow: inset 0 0 0 999px rgba(200, 145, 37, 0.09);
  }

  100% {
    box-shadow: inset 0 0 0 999px rgba(200, 145, 37, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #vanta-bg {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 780px) {
  .intro,
  .silver-header,
  .silver-grid,
  .karat-header,
  .answer,
  .settings-tools,
  .asset-grid,
  .liability-section,
  .profile-tools,
  .action-row,
  .learn-links {
    grid-template-columns: 1fr;
  }

  .karat-row {
    grid-template-columns: 72px 1fr;
  }

  .karat-row input,
  .karat-value,
  .karat-formula {
    grid-column: span 2;
  }

  .karat-value {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .app {
    width: min(100% - 18px, 980px);
    padding: 9px 0;
  }

  .mode-toggle {
    margin-top: -2px;
  }

  .mode-button {
    padding: 0 8px;
  }

  .intro,
  .explain-card,
  .panel,
  .answer,
  .saved-panel,
  .learn-panel {
    padding: 16px;
  }

  .saved-header,
  .saved-record {
    grid-template-columns: 1fr;
  }
}
