:root {
  --font-sans: "Styrene A", "Styrene B", "Styrene", "Helvetica Neue", Arial, sans-serif;
  --panel-bg: rgba(10, 10, 10, 0.92);
  --panel-line: rgba(184, 191, 198, 0.28);
  --text: #ffffff;
  --muted: #c1c8cf;
  --accent: #ffcc70;
  --bitcoin-orange: #f7931a;
  --danger-bg: rgba(145, 32, 32, 0.65);
  --danger-line: rgba(255, 168, 168, 0.8);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  background: #1a1b1d;
  position: relative;
}

.ambient-dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle, rgba(178, 184, 190, 0.72) 0 0.9px, transparent 1px),
    radial-gradient(circle, rgba(178, 184, 190, 0.4) 0 0.7px, transparent 0.9px);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px, 16px 16px;
}

.site-chrome {
  width: 100%;
  margin: 0.55rem auto 0;
  padding: 0 2rem 0 1.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.chrome-controls {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.8rem;
  grid-column: 2;
  justify-self: center;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.04);
}

.mode-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 1rem;
  width: auto;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.mode-switch-link.is-active {
  background: rgba(247, 147, 26, 0.16);
  color: var(--text);
}

.site-mark {
  min-width: 430px;
  font-size: 1.96rem;
  letter-spacing: 0.01em;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1;
  justify-self: start;
  align-self: end;
}

.brand-typing::after {
  content: "|";
  margin-left: 0.06em;
  opacity: 0.7;
  animation: blink 1s steps(1, end) infinite;
}

.brand-typing.is-complete::after {
  content: "";
  animation: none;
}

.page-title {
  width: min(1120px, 94vw);
  margin: 1rem auto 0.6rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: clamp(2.15rem, 6.3vw, 4.85rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
  min-height: 1.15em;
  text-wrap: balance;
  position: relative;
  z-index: 2;
}

.typing-title::after {
  content: "|";
  margin-left: 0.06em;
  color: var(--muted);
  opacity: 0.85;
  animation: blink 1s steps(1, end) infinite;
}

.calculator-typing-title::after {
  content: "|";
  margin-left: 0.06em;
  color: #ff9b76;
  opacity: 0.9;
  animation: blink 1s steps(1, end) infinite;
  text-shadow: 0 0 2px rgba(255, 101, 57, 0.65), 0 0 8px rgba(255, 101, 57, 0.18);
}

.bitcoin-word {
  color: var(--bitcoin-orange);
}

.page-subtitle {
  width: min(760px, 90vw);
  margin: 0 auto 1.85rem;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  position: relative;
  z-index: 2;
}

.site-disclaimer {
  max-width: 880px;
  margin: 1.1rem auto 2rem;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 600;
  position: relative;
  z-index: 2;
}

.site-disclaimer-modern {
  color: rgba(193, 200, 207, 0.82);
}

.site-disclaimer-vintage {
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 0 rgba(43, 25, 10, 0.3);
}

.market-ticker {
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.market-ticker-modern {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: calc(0.35rem + 13px);
  margin-bottom: 0.55rem;
}

.market-ticker-track {
  display: flex;
  width: max-content;
  align-items: center;
  animation: marketTicker 34s linear infinite;
}

.market-ticker-group {
  display: inline-flex;
  gap: 0.65rem;
  padding: 0 0.6rem;
  flex-shrink: 0;
}

.market-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.7rem;
  border-radius: 10px;
  background: rgba(18, 21, 25, 0.82);
  border: 1px solid rgba(184, 191, 198, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.market-ticker-item-positive {
  border-color: rgba(61, 212, 122, 0.28);
}

.market-ticker-item-negative {
  border-color: rgba(255, 109, 109, 0.28);
}

.market-ticker-item-positive .market-ticker-delta {
  color: #3dd47a;
}

.market-ticker-item-negative .market-ticker-delta {
  color: #ff6d6d;
}

.market-ticker-item-positive .market-ticker-value {
  color: #d9ffe8;
}

.market-ticker-item-negative .market-ticker-value {
  color: #ffe2e2;
}

.market-ticker-label {
  color: #9ea6ae;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-ticker-value {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.market-ticker-delta {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.result-title {
  width: min(980px, 92vw);
  margin-bottom: 1.4rem;
  font-size: clamp(2.15rem, 6.3vw, 4.85rem);
}

.modern-calendar-banner {
  width: min(1100px, 95vw);
  margin: 0 auto 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.modern-calendar-icon {
  width: 106px;
  border: 1px solid rgba(184, 191, 198, 0.22);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 18, 22, 0.98), rgba(8, 10, 13, 0.98));
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.modern-calendar-top {
  height: 16px;
  background: linear-gradient(180deg, var(--bitcoin-orange), #d97f10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.modern-calendar-top span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(14, 15, 18, 0.88);
  transform: translateY(3px);
}

.modern-calendar-month,
.modern-calendar-day,
.modern-calendar-year,
.modern-calendar-label,
.modern-calendar-date {
  margin: 0;
}

.modern-calendar-month {
  padding-top: 0.55rem;
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.modern-calendar-day {
  text-align: center;
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}

.modern-calendar-year {
  padding: 0.3rem 0 0.75rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.modern-calendar-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.modern-calendar-label {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.modern-calendar-date {
  font-size: 1.16rem;
  color: var(--text);
  font-weight: 600;
}

.supply-panel {
  width: min(1120px, 94vw);
  margin: 0 auto 1.55rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid rgba(106, 200, 255, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.92), rgba(3, 4, 7, 0.98));
}

.supply-copy {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.supply-label,
.supply-total,
.supply-date {
  margin: 0;
}

.supply-label,
.supply-date {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.supply-total {
  font-size: 1.2rem;
  font-weight: 600;
}

.supply-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.supply-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.supply-row strong {
  font-weight: 600;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot.circulating {
  background: rgba(106, 200, 255, 0.9);
  box-shadow: 0 0 14px rgba(106, 200, 255, 0.35);
}

.dot.remaining {
  background: rgba(247, 147, 26, 0.95);
  box-shadow: 0 0 14px rgba(247, 147, 26, 0.35);
}

.supply-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 0.34rem;
}

.supply-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.supply-cell.mined {
  background: linear-gradient(180deg, rgba(106, 200, 255, 0.95), rgba(66, 144, 214, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.supply-cell.remaining {
  background: linear-gradient(180deg, rgba(247, 147, 26, 0.95), rgba(201, 107, 1, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.app-shell {
  width: min(960px, 92vw);
  margin: 0 auto 2.4rem;
  padding: 1.25rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 2;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
}

label {
  font-size: 1.02rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 500;
}

.field-label-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  align-self: start;
  gap: 0.34rem;
}

.field-label-group label {
  margin: 0;
}

.field-label-note {
  margin: 0;
  max-width: 24rem;
  color: rgba(193, 200, 207, 0.78);
  font-size: 0.82rem;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

input,
select,
button {
  width: 100%;
  border: 1px solid var(--panel-line);
  background: rgba(8, 14, 22, 0.8);
  color: var(--text);
  border-radius: 6px;
  padding: 0.82rem 0.9rem;
  font: inherit;
  font-size: 1.18rem;
}

.currency-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--panel-line);
  background: rgba(8, 14, 22, 0.8);
  border-radius: 6px;
  overflow: hidden;
}

.currency-prefix {
  padding: 0.82rem 0 0.82rem 0.9rem;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1;
}

.currency-input input {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-left: 0.38rem;
}

.method-box {
  border: 1px solid var(--panel-line);
  background: rgba(8, 14, 22, 0.56);
  border-radius: 8px;
  padding: 0.52rem;
}

.method-grid {
  display: grid;
  gap: 0.45rem;
}

.method-card {
  display: grid;
  grid-template-columns: auto minmax(0, auto) auto auto;
  align-items: center;
  justify-content: start;
  column-gap: 0.48rem;
  row-gap: 0.35rem;
  min-height: 42px;
  padding: 0.48rem 0.6rem;
  border: 1px solid rgba(184, 191, 198, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.method-card-custom {
  grid-template-columns: auto minmax(0, auto) auto auto auto;
}

.method-radio {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--bitcoin-orange);
  flex-shrink: 0;
}

.method-text {
  font-size: 1.06rem;
  line-height: 1.2;
}

.line-chart {
  width: 24px;
  height: 16px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
}

.line-segment {
  width: 100%;
  border-top: 2px solid #7d848c;
  transform-origin: left center;
}

.line-chart.flat .line-segment {
  border-color: #8b9096;
  transform: translateY(-5px) rotate(0deg);
}

.line-chart.mild .line-segment {
  border-color: #67cf88;
  transform: translateY(-3px) rotate(-14deg);
}

.line-chart.medium .line-segment {
  border-color: #57c976;
  transform: translateY(-1px) rotate(-24deg);
}

.line-chart.steep .line-segment {
  border-color: #43c364;
  transform: translateY(2px) rotate(-34deg);
}

.line-chart.custom .line-segment {
  border-color: #67cf88;
  transform: translateY(-4px) rotate(-18deg);
}

.line-chart.custom[data-growth="flat"] .line-segment {
  border-color: #8b9096;
  transform: translateY(-5px) rotate(0deg);
}

.line-chart.custom[data-growth="mild"] .line-segment {
  transform: translateY(-3px) rotate(-14deg);
}

.line-chart.custom[data-growth="medium"] .line-segment {
  transform: translateY(-1px) rotate(-24deg);
}

.line-chart.custom[data-growth="steep"] .line-segment {
  transform: translateY(2px) rotate(-34deg);
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(184, 191, 198, 0.24);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tooltip-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px);
  width: min(280px, 72vw);
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.96);
  border: 1px solid rgba(184, 191, 198, 0.22);
  color: #f5f7fa;
  font-size: 0.8rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 4;
}

.tooltip:hover .tooltip-bubble,
.tooltip:focus .tooltip-bubble,
.tooltip:focus-within .tooltip-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.custom-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.24rem 0.38rem;
  border: 1px solid rgba(184, 191, 198, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  margin-left: auto;
}

.custom-inline input {
  width: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}

.custom-inline input:focus {
  outline: none;
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid rgba(255, 206, 114, 0.7);
  outline-offset: 1px;
}

button[type="submit"] {
  grid-column: 1 / -1;
  margin-top: 0.3rem;
  background: linear-gradient(180deg, var(--bitcoin-orange), #d97f10);
  color: #172027;
  border-color: rgba(247, 147, 26, 0.95);
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid rgba(247, 147, 26, 0.95);
  border-radius: 6px;
  padding: 0.82rem 0.9rem;
  background: linear-gradient(180deg, var(--bitcoin-orange), #d97f10);
  color: #172027;
  font-size: 1.14rem;
  font-weight: 700;
  text-decoration: none;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.3rem;
}

.button-link-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--panel-line);
}

.share-button-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  margin-right: 0.45rem;
  flex-shrink: 0;
}

.share-button-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert {
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  border-radius: 6px;
}

.result-grid {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.stat-card {
  margin: 0;
  padding: 0.7rem;
  border: 1px solid var(--panel-line);
  border-radius: 6px;
  background: rgba(7, 12, 20, 0.68);
}

.k {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-sans);
}

.v {
  margin: 0.35rem 0 0;
  font-size: 1.14rem;
  word-break: break-word;
}

@keyframes blink {
  0%,
  45% {
    opacity: 0.9;
  }
  46%,
  100% {
    opacity: 0;
  }
}

@keyframes marketTicker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes vintageTicker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-33.333%);
  }
}

@media (max-width: 760px) {
  .site-chrome {
    margin-top: 0.45rem;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .chrome-controls {
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: center;
    grid-column: auto;
  }

  .mode-switch-link {
    padding: 0.38rem 0.68rem;
    font-size: 0.82rem;
  }

  .site-mark {
    min-width: 0;
    justify-self: center;
    text-align: center;
  }

  .market-ticker-modern {
    margin-top: 0.2rem;
    margin-bottom: 0.8rem;
  }

  .market-ticker-group {
    gap: 0.65rem;
    padding: 0 0.5rem;
  }

  .market-ticker-item {
    padding: 0.3rem 0.55rem;
  }

  .market-ticker-label {
    font-size: 0.66rem;
  }

  .market-ticker-value {
    font-size: 0.76rem;
  }

  .page-title {
    width: min(92vw, 680px);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 10vw, 3.6rem);
  }

  .page-subtitle {
    width: min(92vw, 640px);
    margin-bottom: 1.4rem;
    font-size: 0.96rem;
  }

  .site-disclaimer {
    max-width: min(92vw, 680px);
    margin-bottom: 1.5rem;
    font-size: 0.84rem;
  }

  .app-shell {
    margin: 0 auto 1.4rem;
    padding: 0.95rem;
  }

.modern-calendar-banner {
    width: min(92vw, 680px);
    margin-bottom: 1rem;
    flex-direction: column;
    text-align: center;
  }

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

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

  .method-card-custom .custom-inline {
    grid-column: 2 / -1;
    margin-left: 0;
    justify-self: start;
  }

  .supply-panel {
    width: min(92vw, 680px);
    padding: 0.9rem;
  }

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

body[data-mode="modern"] .mode-panel-vintage,
body[data-mode="vintage"] .mode-panel-modern {
  display: none;
}

body:not([data-mode]) .mode-panel-vintage {
  display: none;
}

body[data-mode="vintage"] {
  background:
    linear-gradient(180deg, rgba(71, 45, 24, 0.08), rgba(39, 25, 15, 0.16)),
    url("/static/old_desk.png") center top / cover no-repeat fixed;
}

body[data-mode="vintage"] .ambient-dots {
  display: none;
}

body[data-mode="vintage"] .site-chrome {
  width: 100%;
  margin-top: 0.7rem;
  padding-left: 1.35rem;
  padding-right: 2rem;
}

body[data-mode="vintage"] .site-mark {
  color: rgba(38, 21, 10, 0.85);
}

body[data-mode="vintage"] .brand-typing::after {
  color: rgba(38, 21, 10, 0.85);
}

body[data-mode="vintage"] .mode-switch {
  background: rgba(252, 244, 224, 0.46);
  border-color: rgba(120, 91, 52, 0.24);
}

body[data-mode="vintage"] .mode-switch-link {
  color: rgba(56, 34, 18, 0.78);
}

body[data-mode="vintage"] .mode-switch-link.is-active {
  background: rgba(45, 48, 55, 0.92);
  color: rgba(255, 239, 205, 0.95);
}

.mode-panel-vintage {
  position: relative;
  z-index: 2;
}

.vintage-page {
  width: min(1280px, 96vw);
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.desk-note {
  position: fixed;
  right: 4.5vw;
  bottom: 10vh;
  transform: rotate(-12deg);
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(1rem, 1.8vw, 1.6rem);
  color: rgba(81, 45, 19, 0.28);
  text-shadow: 1px 1px 0 rgba(235, 197, 141, 0.08), -1px -1px 0 rgba(49, 25, 11, 0.16);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.calculator-shell {
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 1.15rem 1rem 1.1rem;
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(116, 84, 39, 0.28);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 246, 220, 0.16) 0 2px, transparent 2.5px),
    radial-gradient(circle at 78% 24%, rgba(110, 78, 41, 0.08) 0 1.5px, transparent 2px),
    radial-gradient(circle at 34% 72%, rgba(255, 248, 226, 0.08) 0 1.5px, transparent 2px),
    linear-gradient(180deg, #ead7af, #dabc87 54%, #c49b62);
  background-size: 120px 120px, 90px 90px, 140px 140px, auto;
  box-shadow:
    0 30px 70px rgba(42, 21, 9, 0.42),
    0 10px 0 rgba(92, 65, 30, 0.42),
    0 18px 28px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -5px 0 rgba(102, 75, 36, 0.24);
}

.calculator-shell-result {
  width: min(1080px, 95vw);
  padding-bottom: 0.95rem;
}

.calculator-shell::before {
  content: "";
  position: absolute;
  inset: 10px 12px 14px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 247, 225, 0.16), transparent 20%),
    linear-gradient(90deg, rgba(121, 87, 45, 0.18), transparent 10%, transparent 90%, rgba(74, 46, 19, 0.16)),
    repeating-linear-gradient(135deg, rgba(255, 249, 235, 0.025) 0 2px, rgba(0, 0, 0, 0.018) 2px 4px);
  pointer-events: none;
}

.calculator-shell::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -24px;
  height: 34px;
  border-radius: 0 0 28px 28px;
  background:
    linear-gradient(180deg, rgba(120, 87, 44, 0.56), rgba(61, 35, 17, 0.3) 52%, rgba(0, 0, 0, 0)),
    linear-gradient(90deg, rgba(69, 46, 20, 0.18), transparent 10%, transparent 90%, rgba(69, 46, 20, 0.18));
  transform: perspective(1200px) rotateX(62deg);
  transform-origin: top center;
  z-index: -1;
}

.calculator-vents,
.calculator-ticker-screen,
.calculator-title-screen,
.calculator-date-screen,
.calculator-switch-row,
.calculator-form,
.calculator-stats,
.calculator-actions {
  position: relative;
  z-index: 1;
}

.calculator-vents {
  margin-bottom: 0.7rem;
}

.calculator-vent {
  height: 14px;
  margin-bottom: 0.36rem;
  border-radius: 999px;
  background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(105, 74, 35, 0.92) 2px 4px, transparent 4px 6px);
}

.calculator-vent-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.calculator-badge {
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
  background: linear-gradient(180deg, #1f2126, #0a0c0f);
  color: rgba(247, 232, 200, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.calculator-ticker-screen,
.calculator-title-screen,
.calculator-date-screen {
  overflow: hidden;
  position: relative;
  border-radius: 14px;
  border: 12px solid #2d3037;
  background: linear-gradient(180deg, rgba(33, 12, 9, 0.98), rgba(14, 7, 7, 0.99));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    inset 0 3px 6px rgba(255,255,255,0.03),
    inset 0 -10px 18px rgba(0,0,0,0.24),
    0 5px 0 rgba(26, 27, 31, 0.72),
    0 14px 28px rgba(0,0,0,0.22);
}

.calculator-ticker-screen::before,
.calculator-title-screen::before,
.calculator-date-screen::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 8%, transparent 92%, rgba(255, 255, 255, 0.04));
  pointer-events: none;
}

.calculator-ticker-screen::after,
.calculator-title-screen::after,
.calculator-date-screen::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -10px;
  height: 12px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, rgba(16, 16, 18, 0.56), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.calculator-ticker-screen {
  transform: perspective(1400px) rotateX(-10deg);
  transform-origin: center bottom;
  margin-bottom: 0.5rem;
}

.calculator-ticker-track {
  display: flex;
  width: max-content;
  min-width: 300%;
  align-items: center;
  padding: 0.45rem 0;
  will-change: transform;
  animation: vintageTicker 22s linear infinite;
}

.calculator-ticker-group {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 0.85rem;
  flex: 0 0 33.333%;
  min-width: 33.333%;
}

.calculator-ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  white-space: nowrap;
  min-width: max-content;
  color: #ff6539;
  text-shadow: 0 0 2px rgba(255, 101, 57, 0.65), 0 0 8px rgba(255, 101, 57, 0.18);
  text-transform: uppercase;
}

.calculator-ticker-item-positive .calculator-ticker-delta {
  color: #84ff84;
}

.calculator-ticker-item-negative .calculator-ticker-delta {
  color: #ff8f8f;
}

.calculator-ticker-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.calculator-ticker-value {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.calculator-ticker-delta {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.calculator-title-screen {
  transform: perspective(1400px) rotateX(-8deg);
  transform-origin: center bottom;
  padding: 0.72rem 0.9rem 0.7rem;
  margin-bottom: 0.8rem;
  min-height: 78px;
}

.calculator-title-screen-result {
  padding-bottom: 0.72rem;
}

.calculator-title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.04;
  color: #ff6539;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 2px rgba(255, 101, 57, 0.65), 0 0 10px rgba(255, 101, 57, 0.18);
}

.calculator-title-screen.is-whitepaper-mode {
  padding: 0.55rem 0.7rem 0.6rem;
}

.calculator-title-screen.is-whitepaper-mode .calculator-title {
  display: none;
}

.calculator-whitepaper-display {
  display: none;
  margin: 0;
  height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", "Roboto Mono", "Menlo", monospace;
  font-size: 0.58rem;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: #ff8f66;
  text-shadow: 0 0 2px rgba(255, 101, 57, 0.55), 0 0 6px rgba(255, 101, 57, 0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 143, 102, 0.45) rgba(0, 0, 0, 0.18);
}

.calculator-title-screen.is-whitepaper-mode .calculator-whitepaper-display {
  display: block;
}

.calculator-whitepaper-display::-webkit-scrollbar {
  width: 8px;
}

.calculator-whitepaper-display::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.18);
}

.calculator-whitepaper-display::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 143, 102, 0.42);
}

.calculator-title-result {
  white-space: normal;
  font-size: clamp(1rem, 1.65vw, 1.3rem);
  line-height: 1.08;
}

.calculator-bitcoin-word {
  color: #ffd7c8;
  text-shadow: 0 0 2px rgba(255, 215, 200, 0.8), 0 0 8px rgba(255, 101, 57, 0.18);
}

.calculator-switch-row {
  display: grid;
  grid-template-columns: 44px 1fr 60px;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.calculator-switch,
.calculator-slider,
.calculator-mini-key {
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(180deg, #3a3a3e, #161618);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 3px 5px rgba(0,0,0,0.2);
}

.calculator-slider,
.calculator-mini-key {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(247, 239, 221, 0.88);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
}

.calculator-slider {
  border: 0;
  cursor: pointer;
}

.calculator-whitepaper-trigger {
  padding: 0 0.7rem;
  text-transform: uppercase;
}

.calculator-whitepaper-trigger[aria-pressed="true"] {
  color: #fff0e5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px rgba(255, 143, 102, 0.25), 0 3px 5px rgba(0,0,0,0.2);
}

.calculator-switch {
  position: relative;
}

.calculator-switch::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 8px;
  width: 14px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, #161616, #333);
}

.calculator-error {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(130, 31, 17, 0.18);
  color: #5c180f;
  border: 1px solid rgba(131, 48, 34, 0.18);
}

.calculator-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem 0.56rem;
  position: relative;
  padding: 0.48rem 0.38rem 0.42rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(57, 53, 49, 0.72), rgba(35, 31, 28, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(14, 12, 10, 0.34),
    0 8px 14px rgba(58, 33, 13, 0.12);
}

.calculator-label-key,
.calculator-field-key,
.calculator-method-card,
.calculator-submit-key,
.calculator-stat-card,
.calculator-action-key {
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 6px 0 rgba(73, 50, 24, 0.32), 0 12px 18px rgba(0,0,0,0.14);
}

.calculator-label-key {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.44rem 0.66rem;
  background: linear-gradient(180deg, #8f2a36, #68141c);
  color: rgba(255, 245, 225, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.96rem;
}

.calculator-label-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  align-self: stretch;
  gap: 0.22rem;
}

.calculator-label-note {
  margin: 0;
  color: rgba(255, 244, 225, 0.86);
  font-size: 0.72rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
}

.calculator-field-key,
.calculator-method-box {
  min-height: 44px;
  border: 1px solid rgba(46, 39, 31, 0.5);
  background: linear-gradient(180deg, #3e3a37, #23201e);
  color: #fff7eb;
}

.calculator-currency-input {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgba(46, 39, 31, 0.5);
  border-radius: 12px;
  background: linear-gradient(180deg, #3e3a37, #23201e);
  color: #fff7eb;
  overflow: hidden;
}

.calculator-currency-prefix {
  padding: 0.56rem 0 0.56rem 0.74rem;
  color: rgba(255, 247, 235, 0.82);
  font-size: 1.02rem;
  line-height: 1;
}

.calculator-currency-input .calculator-field-key {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding-left: 0.3rem;
}

.calculator-field-key {
  width: 100%;
  padding: 0.56rem 0.74rem;
  font: inherit;
  font-size: 1.02rem;
  border-radius: 12px;
}

.calculator-method-box {
  padding: 0.42rem;
  border-radius: 12px;
}

.calculator-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.calculator-method-card {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 36px;
  padding: 0.28rem 0.44rem;
  border: 1px solid rgba(96, 76, 48, 0.18);
  background: linear-gradient(180deg, #d6bb8d, #b5915d);
  color: #2b2116;
}

.calculator-method-card-custom {
  grid-column: 1 / -1;
}

.calculator-method-radio {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #ef8f1e;
  flex-shrink: 0;
}

.calculator-method-text {
  font-size: 0.88rem;
  flex: 1;
}

.calculator-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(67, 49, 29, 0.22);
  background: rgba(255, 247, 226, 0.24);
  color: #2b2116;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
}

.calculator-tooltip-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  width: min(320px, 72vw);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(19, 16, 13, 0.96);
  color: #f7e8cb;
  border: 1px solid rgba(124, 97, 58, 0.24);
  font-size: 0.82rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 2;
}

.calculator-tooltip:hover .calculator-tooltip-bubble,
.calculator-tooltip:focus .calculator-tooltip-bubble,
.calculator-tooltip:focus-within .calculator-tooltip-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.calculator-custom-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.08rem 0.12rem 0.08rem 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(67, 49, 29, 0.18);
  background: rgba(255, 244, 217, 0.22);
}

.calculator-custom-inline input {
  width: 68px;
  border: 0;
  background: transparent;
  color: #2b2116;
  font: inherit;
  font-size: 0.76rem;
  padding: 0;
}

.calculator-custom-inline input:focus {
  outline: none;
}

.calculator-submit-key,
.calculator-action-key {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 0.18rem;
  border: 1px solid rgba(171, 67, 26, 0.38);
  background: linear-gradient(180deg, #ff6539, #e24a23);
  color: #fff9f2;
  font: inherit;
  font-size: 1.06rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), 0 7px 0 rgba(131, 44, 18, 0.55), 0 14px 22px rgba(0,0,0,0.16);
}

.calculator-date-screen {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.calculator-result-hero .calculator-title-result {
  margin: 0;
  white-space: normal;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.08;
}

.calculator-calendar-chip {
  border-radius: 3px;
  border: 1px solid rgba(255, 151, 116, 0.22);
  overflow: hidden;
  background: rgba(15, 10, 10, 0.85);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(255, 101, 57, 0.12);
  image-rendering: pixelated;
}

.calculator-calendar-month,
.calculator-calendar-day,
.calculator-calendar-year,
.calculator-date-copy,
.calculator-date-label,
.calculator-full-date,
.calculator-date-supporting {
  color: #ff6539;
  text-shadow: 0 0 2px rgba(255, 101, 57, 0.65), 0 0 8px rgba(255, 101, 57, 0.18);
}

.calculator-calendar-month {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 151, 116, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 101, 57, 0.12), rgba(255, 101, 57, 0.03)),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 101, 57, 0.04) 7px 8px);
}

.calculator-calendar-day {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  line-height: 1;
  letter-spacing: 0.04em;
  font-weight: 700;
  background:
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(255, 101, 57, 0.035) 11px 12px),
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(255, 101, 57, 0.035) 11px 12px);
}

.calculator-calendar-year {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  border-top: 1px solid rgba(255, 151, 116, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 101, 57, 0.06), rgba(255, 101, 57, 0.02)),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 101, 57, 0.04) 7px 8px);
}

.calculator-date-label {
  margin: 0 0 0.28rem;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.9;
}

.calculator-full-date {
  margin: 0 0 0.32rem;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  line-height: 1.1;
}

.calculator-date-supporting {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.calculator-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.6rem;
  margin-bottom: 0.85rem;
}

.calculator-stat-card {
  min-height: 72px;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(46, 39, 31, 0.5);
  background: linear-gradient(180deg, #3e3a37, #23201e);
  color: #fff7eb;
}

.calculator-stat-label {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 231, 194, 0.72);
}

.calculator-stat-value {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.2;
}

.calculator-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.calculator-action-key-secondary {
  background: linear-gradient(180deg, #4e463f, #312b26);
  border-color: rgba(122, 92, 57, 0.46);
  color: #fff4e3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 7px 0 rgba(65, 49, 30, 0.52), 0 14px 22px rgba(0,0,0,0.16);
}

@media (max-width: 760px) {
  body[data-mode="vintage"] .site-chrome {
    width: 98vw;
  }

  .vintage-page {
    width: 98vw;
  }

  .desk-note {
    right: 4vw;
    bottom: 5vh;
    font-size: 0.98rem;
  }

  .calculator-shell {
    width: 96vw;
    padding: 0.9rem 0.75rem 0.8rem;
  }

  .calculator-title {
    font-size: 1rem;
  }

  .calculator-form,
  .calculator-date-screen,
  .calculator-stats,
  .calculator-method-grid {
    grid-template-columns: 1fr;
  }

  .calculator-method-card-custom {
    grid-column: auto;
  }
}
