* { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg: #000;
  --panel: #0b0d0c;
  --panel-2: #111413;
  --line: #1e2421;
  --text: #f2f5f3;
  --muted: #8b9690;
  --green: #00c805;
  --green-2: #5ff56a;
  --red: #ff5000;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.glow { position: fixed; z-index: 0; pointer-events: none; width: 560px; height: 560px; top: -200px; left: 50%; transform: translateX(-50%); border-radius: 50%; background: #00c80533; filter: blur(110px); }

.app {
  position: relative; z-index: 1;
  min-height: 100vh; max-width: 1040px; margin: 0 auto; padding: 24px 16px;
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 16px; align-items: center;
}

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }

form { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
input, select {
  width: 100%; height: 46px; padding: 0 14px; background: #000; color: var(--text);
  border: 1px solid #252d29; border-radius: 12px; font: 500 16px Inter, system-ui, sans-serif;
}
select {
  appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat;
}
input:focus, select:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px #00c80533; }
.field { display: flex; align-items: center; background: #000; border: 1px solid #252d29; border-radius: 12px; }
.field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #00c80533; }
.field i { font-style: normal; color: var(--muted); padding: 0 0 0 14px; font-weight: 500; }
.field i:last-child { padding: 0 14px 0 0; }
.field input { border: 0; background: transparent; padding-left: 8px; }
.field input:focus { box-shadow: none; }
.error { margin: 0; min-height: 18px; color: var(--red); font-size: 13px; }

.big { display: block; font-size: clamp(40px, 7vw, 60px); line-height: 1.05; letter-spacing: -.045em; font-weight: 800; }

.chart { position: relative; width: 100%; height: 280px; margin: 18px 0; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: #1a201d; stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px Inter, sans-serif; }
.chart .line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px #00c80599); }
.chart .wave { fill: none; stroke: var(--green); stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 0 5px #00c80588); }
.chart .proj { fill: none; stroke: #d8e2dc; stroke-width: 1.8; stroke-dasharray: 1 5; stroke-linecap: round; }
.bt { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.bt b { color: var(--green-2); }
.key { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.key li { display: flex; align-items: center; gap: 7px; }
.key i { display: block; width: 18px; height: 0; border-top: 2px solid; }
.k-wave { border-color: var(--green) !important; }
.k-proj { border-color: #d8e2dc !important; border-top-style: dotted !important; }
.k-inv { border-color: #4a5750 !important; border-top-style: dashed !important; }
.tip .dn { color: var(--red); }
.tip .upc { color: var(--green); }
.chart .invested { fill: none; stroke: #4a5750; stroke-width: 1.6; stroke-dasharray: 4 5; }
.chart .cursor { stroke: #3a463f; stroke-width: 1; }
.chart .dot { fill: var(--green); stroke: #000; stroke-width: 3; }
.tip { position: absolute; top: 0; left: 0; transform: translate(-50%, 0); pointer-events: none; padding: 8px 12px; border-radius: 10px; background: #000d; border: 1px solid #263029; font-size: 12px; line-height: 1.45; white-space: nowrap; display: none; }
.tip b { display: block; color: var(--green); font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: #000; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tile span { display: block; color: var(--muted); font-size: 12px; }
.tile b { font-size: 18px; letter-spacing: -.02em; }
.tile b.up { color: var(--green); }

/* inflation switch */
.infl { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 14px 20px; flex-wrap: wrap; }
.infl-label { font-weight: 700; font-size: 15px; }
.infl-info { color: var(--muted); font-size: 13px; }
.switch { position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: 0; border-radius: 99px; background: #1b221f; cursor: pointer; transition: background .2s; box-shadow: inset 0 0 0 1px #2c3530; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #8b9690; transition: transform .2s, background .2s; }
.switch[aria-checked="true"] { background: var(--green); box-shadow: 0 0 18px #00c80566; }
.switch[aria-checked="true"] .knob { transform: translateX(22px); background: #00150a; }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.bignote { display: block; color: var(--green-2); font-size: 12px; font-weight: 600; margin-bottom: 2px; }

/* ticker lookup */
.app { align-items: start; }
.ticker { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(240px, 1.1fr) 2fr; gap: 18px 28px; align-items: start; }
.tk-search { position: relative; }
.tk-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #0b0d0c; border: 1px solid #263029; border-radius: 14px; box-shadow: 0 20px 50px #000c; max-height: 320px; overflow-y: auto; }
.tk-list li { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.tk-list li:hover, .tk-list li[aria-selected="true"] { background: #14201a; }
.tk-list b { color: var(--green-2); }
.tk-list span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-list em { font-style: normal; color: var(--muted); font-size: 12px; }

/* Fixed right column + tabular digits: the slider track keeps the same width while numbers change. */
.tk-info { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 14px 24px; align-items: center; grid-column: 2; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; transition: opacity .2s; }
.tk-info.idle { opacity: .35; }
.tk-id { min-height: 92px; }
.off { visibility: hidden; }
.bignote { min-height: 18px; }
.bt { min-height: 21px; }
.key { min-height: 18px; }
.tk-id strong { display: block; font-size: 20px; letter-spacing: -.02em; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 2px 10px; border-radius: 99px; border: 1px solid #263029; color: var(--muted); font-size: 12px; font-weight: 600; }
.chip-green { color: #00150a; background: var(--green); border-color: var(--green); }
.tk-ret { text-align: right; }
.tk-ret b { display: block; font-size: 36px; line-height: 1.1; letter-spacing: -.04em; color: var(--green); }
.tk-ret b.neg { color: var(--red); }
.tk-ret span { color: var(--muted); font-size: 12px; }
.tk-slider { grid-column: 1; }
.tk-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; }
.muted { color: var(--muted); font-weight: 500; }
.tk-total { text-align: right; color: var(--muted); font-size: 12px; }
.tk-total b { display: block; color: var(--text); font-size: 18px; }
.tk-status { grid-column: 1; margin: 0; min-height: 18px; color: var(--muted); font-size: 12px; }
.tk-status.bad { color: var(--red); }

input[type="range"] { -webkit-appearance: none; appearance: none; height: 28px; padding: 0; margin: 4px 0; background: transparent; border: 0; border-radius: 0; cursor: pointer; }
input[type="range"]:focus { box-shadow: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: #1b221f; }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: #1b221f; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--green); border: 4px solid #000; box-shadow: 0 0 0 1px var(--green), 0 0 14px #00c80599; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--green); border: 4px solid #000; box-shadow: 0 0 0 1px var(--green), 0 0 14px #00c80599; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #00c80577; }

@media (max-width: 800px) {
  .ticker { grid-template-columns: 1fr; }
  .tk-info { grid-column: 1; grid-row: auto; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; min-height: 0; align-items: start; }
}
@media (max-width: 480px) {
  .two { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .chart { height: 220px; }
}
