:root {
  --bg: #1f160d;
  --bg2: #151008;
  --card: #2b1f12;
  --ink: #fff9f0;
  --muted: #f2e4c7;
  --gold: #daba52;
  --gold2: #bf952c;
  --radius: 16px;
  --gap: 7px;
  --bar-font: clamp(.98rem, .9rem + .35vw, 1.15rem);
  --bar-pad-y: 14px;
  --bar-pad-x: 18px;
  --bar-gap: 12px;
  --bar-icon: 28px;
  --bar-close: 32px;
  --bar-btn-py: 8px;
  --bar-btn-px: 16px;
  --outline: 0 0 0 2px rgba(212, 175, 55, .35), 0 0 0 4px rgba(212, 175, 55, .2);
  --accent-ink: #2b1f10
}

html[data-theme=navy] {
  --bg: #0c1a2b;
  --bg2: #0a1523;
  --card: #121e32;
  --ink: #eef3fb;
  --muted: #b9c7dc;
  --gold: #E9C46A;
  --gold2: #D4AF37;
  --accent-ink: #0b1220
}

html[data-theme=light] {
  --bg: #f0ede5;
  --bg2: #ebe6dd;
  --card: #ffffff;
  --ink: #0e1420;
  --muted: #5f6773;
  --gold: #D4AF37;
  --gold2: #BB9729;
  --accent-ink: #0e1420
}

html[data-theme=christmas] {
  --bg: #0e1a12;
  --bg2: #0b130d;
  --card: #13211a;
  --ink: #f8fff6;
  --muted: #d8e8d3;
  --gold: #f6d974;
  --gold2: #d43a46;
  --accent-ink: #0e1a12
}

* {
  box-sizing: border-box
}

body,
html {
  max-width: 100%
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 110% -10%, color-mix(in oklab, var(--gold) 22%, transparent), transparent 60%),
    radial-gradient(800px 520px at -10% -10%, color-mix(in oklab, var(--gold2) 20%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg) 0, var(--bg2) 100%);
  font-family: "Noto Naskh Arabic", "Segoe UI", system-ui, -apple-system, Arial;
  min-height: 100vh;
  position: relative
}

html[data-theme=christmas] body {
  --s: 75px;
  --_c: #0000, #fff 1deg 79deg, #0000 81deg;
  --g0: conic-gradient(from 140deg at 50% 87.5%, var(--_c));
  --g1: conic-gradient(from 140deg at 50% 81.25%, var(--_c));
  --g2: conic-gradient(from 140deg at 50% 75%, var(--_c));
  --g3: conic-gradient(at 10% 20%, #0000 75%, #fff 0);
  background:
    var(--g0) 0 calc(var(--s)/ -4),
    var(--g0) var(--s) calc(3 * var(--s)/ 4),
    var(--g1),
    var(--g1) var(--s) var(--s),
    var(--g2) 0 calc(var(--s)/ 4),
    var(--g2) var(--s) calc(5 * var(--s)/ 4),
    var(--g3) calc(var(--s)/ -10) var(--s),
    var(--g3) calc(9 * var(--s)/ 10) calc(2 * var(--s)),
    repeating-conic-gradient(from 45deg, #a31e39 0 25%, #31570e 0 50%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg) 75%, transparent), color-mix(in oklab, var(--bg2) 85%, transparent));
  background-size: calc(2 * var(--s)) calc(2 * var(--s))
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(1200px 720px at 80% 0, rgba(255, 255, 255, .2), transparent 70%);
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity .6s ease, transform .6s ease;
  transform: scale(1.05);
  z-index: -1
}

html[data-mood=up] body::after {
  opacity: .32;
  transform: scale(1);
  background:
    radial-gradient(900px 520px at 90% 0, rgba(51, 214, 159, .28), transparent 70%),
    radial-gradient(600px 420px at 0 100%, rgba(212, 175, 55, .25), transparent 65%)
}

html[data-mood=down] body::after {
  opacity: .28;
  transform: scale(1);
  background:
    radial-gradient(900px 520px at 90% 0, rgba(255, 141, 122, .25), transparent 70%),
    radial-gradient(600px 420px at 0 100%, rgba(186, 83, 62, .25), transparent 65%)
}

html[data-mood=flat] body::after {
  opacity: .18;
  transform: scale(1);
  background:
    radial-gradient(900px 520px at 90% 0, rgba(170, 170, 170, .22), transparent 70%),
    radial-gradient(600px 420px at 0 100%, rgba(110, 110, 110, .2), transparent 65%)
}

.snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity .6s ease, filter .6s ease;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .42))
}

html[data-theme=christmas] .snow-canvas.is-active {
  opacity: .95;
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, .55))
}

@media (prefers-reduced-motion:reduce) {
  .snow-canvas {
    display: none
  }
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--card) 92%, var(--bg));
  border-bottom: 1px solid color-mix(in oklab, var(--gold) 18%, transparent);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
  height: 60px;
  transition: box-shadow .3s ease
}

header.compact {
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12)
}

header .bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%
}

.header-row {
  width: 100%
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(15, 23, 42, .12)
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .2px;
  white-space: nowrap
}

.mini-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--gold) 18%, transparent)
}

.mini-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: .2s ease
}

.mini-nav a.current {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  box-shadow: 0 6px 14px color-mix(in oklab, var(--gold) 25%, transparent)
}

.mini-nav a:focus {
  outline: 0;
  box-shadow: var(--outline)
}

.hdr-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(.78rem, 1.8vw, .95rem);
  line-height: 1.6
}

.hdr-utilities {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto
}

.hdr-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0
}

.icon-menu {
  position: relative
}

.icon-toggle {
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  background: var(--card);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s ease;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
  color: var(--ink)
}

.icon-toggle .icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: color .2s ease
}

.icon-toggle .icon-language,
.icon-toggle .icon-theme {
  -webkit-mask-image: url("../language.svg");
  mask-image: url("../language.svg")
}

.icon-toggle .icon-theme {
  -webkit-mask-image: url("../theme.svg");
  mask-image: url("../theme.svg")
}

.icon-toggle:focus-visible {
  outline: 0;
  box-shadow: var(--outline)
}

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

.info-toggle {
  font-weight: 700;
  font-size: 14px
}

.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--gold) 18%, transparent);
  color: var(--ink)
}

.info-panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 0
}

.info-panel__inner {
  
  border: 1px solid color-mix(in oklab, var(--gold) 16%, transparent);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08)
}

[hidden].info-panel {
  display: none
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 160px;
  background: color-mix(in oklab, var(--card) 96%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
  z-index: 20;
  display: grid;
  gap: 4px
}

.menu-panel button {
  border: 0;
  background: 0 0;
  color: var(--ink);
  text-align: start;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.menu-panel button .check {
  opacity: 0;
  transition: .2s ease
}

.menu-panel button.active {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink)
}

.menu-panel button.active .check {
  opacity: 1
}

.menu-panel button:focus-visible {
  outline: 0;
  box-shadow: var(--outline)
}

[hidden].menu-panel {
  display: none
}

.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
}

.scraper-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
}

@media(max-width:900px) {
  .brand-title {
    font-size: 13px
  }

  .mini-nav {
    gap: 6px;
    padding: 4px
  }

  .mini-nav a {
    padding: 5px 12px;
    font-size: 11px
  }
}

@media(max-width:720px) {
  .brand-title {
    display: none
  }

  .mini-nav {
    margin-inline: 0;
    flex: 1 1 auto
  }
}

@media(max-width:540px) {
  header {
    height: auto
  }

  header .bar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 12px
  }

  .mini-nav {
    order: 3;
    width: 100%;
    justify-content: center
  }

  .hdr-utilities {
    order: 2
  }

  .header-brand {
    order: 1
  }

  .info-panel {
    padding-top: 8px
  }

  .seo-table td,
  .seo-table th {
    padding: 8px 6px;
    font-size: 12px
  }
}

main {
  max-width: 980px;
  margin: 20px auto;
  padding: 0 16px 40px
}

.grid {
  display: grid;
  gap: var(--gap)
}

@media(min-width:900px) {
  .grid-2 {
    grid-template-columns: 1.2fr .8fr
  }
}

.card {
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 96%, transparent) 0, var(--card) 100%);
  border: 1px solid color-mix(in oklab, var(--gold) 25%, transparent);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .25)
}

h2 {
  margin: 0 0 6px;
  font-size: 17px
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 6px
}

input {
  width: 100%;
  background: color-mix(in oklab, var(--bg) 80%, #0000);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--gold) 40%, transparent);
  padding: 12px;
  border-radius: 12px;
  outline: 0;
  caret-color: var(--ink);
  font-size: 16px;
  box-shadow: 0 0 0 transparent;
  transition: all .2s ease
}

input:focus {
  box-shadow: var(--outline);
  border-color: var(--gold)
}

input::placeholder {
  color: color-mix(in oklab, var(--gold) 55%, #fff0);
  font-style: italic
}

input:hover {
  border-color: var(--gold2)
}

select {
  width: 100%;
  background: color-mix(in oklab, var(--bg) 80%, #0000);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--gold) 40%, transparent);
  padding: 12px;
  border-radius: 12px;
  outline: 0;
  font-size: 16px;
  box-shadow: 0 0 0 transparent;
  transition: all .2s ease
}

select:focus {
  box-shadow: var(--outline);
  border-color: var(--gold)
}

select:hover {
  border-color: var(--gold2)
}

.num {
  direction: ltr;
  text-align: left
}

.row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 160px;
  align-items: end
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  box-shadow: 0 10px 22px color-mix(in oklab, var(--gold) 35%, transparent)
}

.btn:focus {
  outline: 0;
  box-shadow: var(--outline)
}

.btn.ghost {
  background: 0 0;
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent)
}

.btn-mini {
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px
}

.btn-mini.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  border: 0
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
  table-layout: fixed
}

.seo-table td,
.seo-table th {
  border: 1px solid color-mix(in oklab, var(--gold) 25%, transparent);
  padding: 10px;
  text-align: start;
  word-break: break-word;
  hyphens: auto
}

.seo-table thead {
  background: color-mix(in oklab, var(--card) 88%, transparent)
}

.seo-table tbody tr:nth-child(2n) {
  background: color-mix(in oklab, var(--card) 92%, transparent)
}

.seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  color: var(--muted);
  font-size: 12px
}

.seo-summary {
  line-height: 1.7;
  color: var(--muted);
  margin: 6px 0 0
}

.seo-summary strong {
  color: var(--ink)
}

.seo-muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px
}

.seo-footer {
  text-align: center;
  padding: 16px 12px
}

.seo-footer h3 {
  margin: 6px 0;
  font-size: 16px;
  color: var(--ink);
  font-weight: 700
}

.per-last-updated {
  white-space: nowrap
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 25%, transparent);
  color: var(--muted);
  font-size: 12px
}

.badge.delta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  text-align: left;
  justify-content: center;
  font-weight: 700;
  min-width: 12ch;
  letter-spacing: .1px;
  position: relative;
  overflow: hidden
}

.badge.delta.positive {
  color: #33d69f;
  border-color: color-mix(in oklab, #33d69f 42%, transparent);
  background: color-mix(in oklab, #33d69f 18%, transparent)
}

.badge.delta.negative {
  color: #ff8d7a;
  border-color: color-mix(in oklab, #ff8d7a 42%, transparent);
  background: color-mix(in oklab, #ff8d7a 18%, transparent)
}

.badge.delta.flat {
  color: var(--muted);
  border-color: color-mix(in oklab, var(--gold) 25%, transparent);
  background: color-mix(in oklab, var(--bg) 86%, transparent)
}

.badge.delta .mood-face {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2));
  transition: transform .4s ease
}

.badge.delta .mood-face.happy {
  animation: moodBounce 3s ease-in-out infinite
}

.badge.delta .mood-face.sad {
  animation: moodSigh 4s ease-in-out infinite
}

.badge.delta .mood-face.calm {
  animation: moodGlow 5s ease-in-out infinite
}

.badge.delta .mood-face.neutral {
  animation: none
}

.badge.delta .mood-copy {
  display: flex;
  align-items: center;
  gap: 4px
}

.badge.delta .mood-arrow {
  font-size: 14px;
  opacity: .85
}

.badge.delta .mood-amount {
  font-variant-numeric: tabular-nums
}

.bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap
}

.per-currency-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative
}

.currency-toggle {
  border: 1px solid color-mix(in oklab, var(--gold) 30%, transparent);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  color: var(--ink);
  border-radius: 10px;
  width: 42px;
  height: 38px;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .16);
  transition: .2s ease;
  line-height: 1
}

.currency-toggle__symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1
}

.currency-toggle:focus-visible,
.currency-toggle:hover {
  border-color: var(--gold);
  outline: 0;
  box-shadow: var(--outline)
}

.currency-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 160px;
  background: color-mix(in oklab, var(--card) 96%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
  z-index: 20;
  display: grid;
  gap: 4px
}

.currency-menu button {
  border: 0;
  background: 0 0;
  color: var(--ink);
  text-align: start;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.currency-menu button.active {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink)
}

.currency-menu button.active .check {
  opacity: 1
}

.currency-menu button .check {
  opacity: 0;
  transition: .2s ease
}

[hidden].currency-menu {
  display: none
}

@keyframes moodBounce {
  0%, 100% {
    transform: translateY(0)
  }
  50% {
    transform: translateY(-3px) scale(1.05)
  }
}

@keyframes moodSigh {
  0%, 100% {
    transform: translateY(0)
  }
  50% {
    transform: translateY(3px) scale(.96)
  }
}

@keyframes moodGlow {
  0%, 100% {
    transform: scale(1);
    opacity: 1
  }
  50% {
    transform: scale(1.05);
    opacity: .85
  }
}

.history-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: flex-end
}

.history-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 600px
}

.history-section.collapsed .history-body {
  display: none
}

.history-chart {
  padding: 0;
  border-radius: 16px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  overflow: hidden;
  flex: 1 1 auto;
  height: 500px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  position: relative
}

.history-chart.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 30;
  height: 100vh;
  min-height: 100vh;
  width: 100vw;
  border-radius: 0;
  border: 0;
  background: var(--bg);
  padding: clamp(10px, 2vw, 24px)
}

body.chart-fullscreen-open {
  overflow: hidden
}

.history-chart.fullscreen .tv-chart-wrapper {
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45)
}

.chart-expand-controls {
  position: absolute;
  inset-inline-end: 12px;
  top: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
  pointer-events: none
}

.chart-expand-btn {
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  color: var(--ink);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: .2s ease;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25)
}

.chart-expand-btn:focus {
  outline: 0;
  box-shadow: var(--outline)
}

.chart-expand-btn:hover {
  background: color-mix(in oklab, var(--bg) 50%, transparent)
}

.history-chart.fullscreen .chart-expand-controls {
  inset-inline-end: clamp(16px, 2vw, 32px);
  top: clamp(16px, 2vw, 32px)
}

.history-chart.fullscreen .chart-expand-btn {
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  font-size: 18px
}

.history-chart .tv-chart-wrapper {
  border-radius: inherit;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto
}

.history-chart .tradingview-widget-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto
}

.history-chart .tradingview-widget-container__widget {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0
}

.history-chart .tradingview-widget-container .tradingview-widget,
.history-chart .tradingview-widget-container iframe {
  height: 100% !important
}

#historyChartWidget {
  width: 100%;
  height: 100%;
  min-height: 0
}

.out {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  line-height: 1.6;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  padding: 12px;
  border-radius: 12px
}

.error {
  background: #3a120c;
  border: 1px solid rgba(255, 150, 120, .6);
  color: #ffe1db;
  padding: 10px;
  border-radius: 10px;
  font-size: 12px
}

html[data-theme=light] .error {
  background: #ffe9e6;
  color: #8a1d12;
  border-color: #ffb2a0
}

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

@media(min-width:700px) {
  .totals-grid {
    grid-template-columns: 1fr 1fr
  }
}

.panel {
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  border-radius: 14px;
  padding: 12px
}

.tot {
  margin-top: 10px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 20px;
  text-align: center;
  letter-spacing: .3px
}

.mini {
  font-size: 12px;
  color: var(--muted)
}

.ad-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

.ad-contact__mail {
  font-weight: 600;
  color: var(--ink)
}

.whatsapp-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: #25d366;
  color: #03230d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  transition: transform .2s ease, box-shadow .2s ease
}

.whatsapp-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .4)
}

.whatsapp-button:focus {
  outline: 0;
  box-shadow: var(--outline)
}

.whatsapp-button svg {
  width: 14px;
  height: 14px
}

html[data-theme=light] .whatsapp-button {
  color: #011b08
}

@media(max-width:768px) {
  .history-body {
    min-height: 480px
  }

  .history-chart {
    height: 420px;
    min-height: 420px
  }
}

@media(max-width:480px) {
  .history-body {
    min-height: 360px
  }

  .history-chart {
    height: 320px;
    min-height: 320px
  }
}

.mood-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 10, 5, .72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 20
}

.mood-modal.open {
  opacity: 1;
  pointer-events: auto
}

.mood-modal__card {
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 92%, transparent) 0, var(--card) 100%);
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 360px;
  text-align: center;
  position: relative;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .4)
}

.mood-modal__face {
  font-size: 52px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .35));
  transition: transform .4s ease
}

.mood-modal__face.up {
  animation: moodBounce 3s ease-in-out infinite
}

.mood-modal__face.down {
  animation: moodSigh 4s ease-in-out infinite
}

.mood-modal__title {
  margin: 0 0 8px;
  font-size: 20px
}

.mood-modal__text {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6
}

.mood-modal__close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer
}

.mood-modal__close:focus {
  outline: 0;
  box-shadow: var(--outline)
}

.mood-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px
}

@media(min-width:480px) {
  .mood-modal__actions {
    flex-direction: row;
    justify-content: center
  }
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  direction: ltr
}

.switch input {
  display: none
}

.slider {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--gold) 25%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  transition: .25s
}

.slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  transition: .25s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35)
}

.switch input:checked+.slider {
  background: color-mix(in oklab, var(--gold2) 70%, #0000)
}

.switch input:checked+.slider::after {
  transform: translate(20px, -50%)
}

.switch .txt {
  font-size: 12px;
  color: var(--muted);
  text-align: left
}

html[dir=rtl] .switch .txt {
  direction: rtl;
  text-align: right
}

.prices {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  align-items: center;
  white-space: normal;
  font-family: inherit
}

.prices>div {
  padding: 4px 0;
  border-bottom: 1px dashed color-mix(in oklab, var(--gold) 18%, transparent)
}

.prices>div:nth-last-child(-n+2) {
  border-bottom: none
}

.prices .label {
  color: var(--muted);
  font-size: 14px
}

.prices .value {
  font-weight: 700;
  direction: ltr;
  text-align: left
}

.coin-img {
  display: block;
  width: 500px;
  max-width: 100%;
  height: auto;
  margin: 6px auto;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--gold) 25%, transparent);
  background: #0b0b0b;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  object-fit: contain
}

html[data-theme=light] .coin-img {
  background: #f1f1f1;
  border-color: #e0e0e0
}

.ad-card figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center
}

.ad-card video {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35)
}

#coin {
  white-space: normal;
  line-height: 1.25;
  padding: 6px 8px
}

#coin .prices {
  gap: 2px 10px
}

#coin .prices>div {
  padding: 0
}

#coin .mini {
  margin-top: 2px;
  line-height: 1.2
}

.card h2 {
  margin-bottom: 6px
}

#perg {
  margin-block: 6px;
  padding: 6px 10px;
  line-height: 1.25;
  white-space: normal
}

#perg .prices {
  gap: 2px 12px
}

#perg .prices>div {
  padding: 2px 0
}

#perg .label {
  font-size: 13px
}

.card h2+#perg {
  margin-top: 6px
}

.card,
.out,
.panel,
.prices,
.totals-grid {
  min-width: 0
}

.prices .value {
  min-width: 0;
  overflow-wrap: anywhere
}

#formulaBox {
  white-space: pre;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  -webkit-overflow-scrolling: touch
}

footer {
  padding-bottom: calc(18px + env(safe-area-inset-bottom))
}

body.no-scroll {
  height: 100vh;
  overflow: hidden
}

body.has-topbar {
  padding-top: 68px
}

#cfgPanel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none
}

#cfgPanel.open {
  display: block
}

#cfgPanel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55)
}

#cfgPanel .cfg-sheet {
  position: relative;
  margin: 6vh auto 0;
  width: min(860px, 94vw);
  max-height: 86vh;
  overflow: auto;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5)
}

#cfgPanel .cfg-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-right: 46px
}

#cfgPanel .cfg-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease
}

#cfgPanel .cfg-close:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  border-color: transparent
}

#cfgPanel .cfg-close:focus {
  outline: 0;
  box-shadow: var(--outline)
}

.settings-grid {
  display: grid;
  gap: 12px
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.settings-row.settings-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between
}

.settings-row.settings-toggle .switch {
  margin-inline-start: auto
}

.settings-row.settings-toggle .mini {
  display: block;
  margin-top: 4px;
  max-width: 260px
}

.settings-row.alert-presets {
  gap: 12px
}

.alert-presets .preset-group {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.alert-presets .preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px
}

@media(min-width:600px) {
  .settings-row.alert-presets {
    flex-direction: row;
    align-items: flex-start
  }

  .alert-presets .preset-group {
    flex: 1
  }
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 120%);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .35);
  transition: transform .35s ease, opacity .35s ease;
  opacity: 0;
  z-index: 2000;
  max-width: min(92vw, 420px);
  text-align: center;
  font-size: 13px
}

#toast.show {
  transform: translate(-50%, 0);
  opacity: 1
}

#a2hsBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transform: translateY(-110%);
  transition: transform .45s ease;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  color: var(--ink);
  border-bottom: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  font-size: var(--bar-font)
}

#a2hsBanner.show {
  transform: translateY(0)
}

#a2hsBanner .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--bar-pad-y) var(--bar-pad-x);
  display: flex;
  align-items: center;
  gap: var(--bar-gap)
}

#a2hsBanner img.icon {
  width: var(--bar-icon);
  height: var(--bar-icon);
  border-radius: 6px;
  flex: 0 0 var(--bar-icon)
}

#a2hsBanner .txt {
  flex: 1;
  line-height: 1.35
}

#a2hsBanner .cta {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: var(--bar-btn-py) var(--bar-btn-px);
  font-weight: 800;
  cursor: pointer;
  font-size: 1em
}

#a2hsBanner .close {
  background: 0 0;
  color: var(--ink);
  border: 0;
  width: var(--bar-close);
  height: var(--bar-close);
  font-size: calc(var(--bar-close) * .56);
  line-height: var(--bar-close);
  cursor: pointer;
  flex: 0 0 var(--bar-close)
}

@media (max-width:380px) {
  :root {
    --bar-font: clamp(1rem, .95rem + .6vw, 1.2rem);
    --bar-pad-y: 16px
  }
}

#a2hsModal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 12px
}

#a2hsModal.open {
  display: flex
}

#a2hsModal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6)
}

#a2hsModal .sheet {
  position: relative;
  width: min(680px, 92vw);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--gold) 28%, transparent);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .65)
}

#a2hsModal .sheet h3 {
  margin: 0 0 8px
}

#a2hsModal .sheet img.main {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--gold) 22%, transparent);
  background: #0b0b0b
}

#a2hsModal .steps {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7
}

#a2hsModal .steps .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0
}

#a2hsModal .steps img.icon {
  width: 22px;
  height: 22px
}

#a2hsModal .x {
  position: absolute;
  top: 8px;
  left: 10px;
  background: 0 0;
  border: 0;
  color: var(--ink);
  font-size: 20px;
  cursor: pointer
}

#last {
  font-variant-numeric: tabular-nums;
  min-width: 18ch;
  text-align: start
}

.prices .label,
.prices .value {
  line-height: 1.6
}

.prices .value {
  min-height: 1.6em;
  display: inline-block
}

.tot {
  min-height: 2.2em
}

#live-prices {
  max-width: 1100px;
  margin: 0 auto 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .08)
}

.live-prices__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px
}

.live-prices__eyebrow {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 4px
}

.live-prices__title {
  margin: 0 0 6px;
  font-size: clamp(20px, 3vw, 26px)
}

.live-prices__meta {
  margin: 0;
  color: var(--muted)
}

.live-prices__cta {
  text-align: end;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end
}

.live-prices__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px
}

.live-prices__tile {
  background: color-mix(in oklab, var(--bg2) 90%, transparent);
  border: 1px solid color-mix(in oklab, var(--gold) 24%, transparent);
  border-radius: 10px;
  padding: 12px
}

.live-prices__label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px
}

.live-prices__value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums
}

.live-prices__rate {
  margin: 0;
  color: var(--muted);
  font-size: 14px
}

.live-prices__hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px
}

.live-prices__api-link {
  margin: 4px 0 0;
  font-size: 13px
}

.live-prices__api-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none
}

.live-prices__api-link a:hover {
  text-decoration: underline
}

@media (max-width:640px) {
  .live-prices__head {
    flex-direction: column;
    align-items: flex-start
  }

  .live-prices__cta {
    align-items: flex-start;
    text-align: start
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
    animation: none !important
  }
}
