:root {
  color-scheme: light;
  --paper: #f8f8f3;
  --ink: #182e28;
  --muted: #58695f;
  --line: #d6dcd1;
  --green: #173f34;
  --brass: #deca92;
  --digits: Georgia,'Times New Roman',serif;
  font: 16px/1.5 'Source Sans 3','PingFang SC','Microsoft YaHei',sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

button,a,input {
  outline-offset: 4px;
}

button:focus-visible,a:focus-visible,input:focus-visible {
  outline: 2px solid #9e751c;
}

::selection {
  background: #e1ce94;
  color: #18382d;
}

button {
  transition: background-color .16s,color .16s;
}

button:disabled {
  cursor: wait;
  opacity: .7;
}

svg {
  display: block;
}

h1,h2,p,dl,dd {
  margin: 0;
}

.wrap {
  width: min(1056px,calc(100% - 72px));
  margin-inline: auto;
}

.mast {
  border-bottom: 1px solid var(--line);
}

.mast-inner {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 50px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: .06em;
  text-decoration: none;
}

.mast nav {
  display: flex;
  gap: 25px;
}

.mast nav a,.mast time {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.mast a:hover,footer a:hover {
  color: #866318;
}

.mast time {
  margin-left: auto;
}

.heading,.market-controls,.market-title,.section-head,.limits,.total,footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.heading {
  padding: 38px 0 22px;
}

.heading h1 {
  font-size: clamp(31px,4vw,44px);
  letter-spacing: -.035em;
  line-height: 1.25;
}

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

.refresh,.weights button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 6px;
}

.refresh {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.refresh svg,.section-head svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh:hover,.weights button:hover {
  background: #e9eee4;
}

.refresh:disabled svg {
  animation: rotate 1.3s linear infinite;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

.market-controls {
  margin-bottom: 13px;
  gap: 15px;
}

.switch {
  display: flex;
  background: #e7ebe2;
  padding: 3px;
  border-radius: 7px;
}

.switch button {
  padding: 6px 17px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 14px;
}

.switch button[aria-pressed=true] {
  background: var(--green);
  color: #fff;
}

.status {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.status::before,.range-note i {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #577865;
  margin-right: 7px;
}

.status[data-warning=true]::before {
  background: #ae8026;
}

.ticker {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border-radius: 13px;
  background: var(--green);
  color: #fffdf3;
  min-height: 248px;
  display: flex;
  align-items: center;
}

.quote-body {
  padding: 28px 38px;
  z-index: 1;
}

.market-title {
  gap: 10px;
  justify-content: flex-start;
}

.market-title h2 {
  font-size: 19px;
  font-weight: 550;
}

.market-title span {
  color: #d0dccd;
  border: 1px solid #698478;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  letter-spacing: .06em;
}

.reading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 9px 0 3px;
}

.reading strong {
  font: 500 clamp(53px,7.5vw,84px)/1.15 var(--digits);
  letter-spacing: -.04em;
  font-variant-numeric: lining-nums tabular-nums;
}

.reading>span,.delta,#quote-time {
  color: #cbdacc;
  font-size: 13px;
}

.delta {
  display: flex;
  gap: 9px;
  align-items: center;
}

.delta span:first-child {
  font-weight: 650;
  color: #fff;
}

.delta .up {
  color: #ffb9a4!important;
}

.delta .down {
  color: #a9e1bc!important;
}

#quote-time {
  margin-top: 20px;
  font-size: 12px;
}

.coin {
  position: absolute;
  z-index: 0;
  right: 3%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(190px,28vw,320px);
  color: var(--brass);
  pointer-events: none;
}

.details {
  display: grid;
  grid-template-columns: 1.13fr 1fr;
  gap: 40px;
  margin-top: 30px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 20px;
  letter-spacing: -.02em;
}

.section-head span,.section-head svg {
  color: var(--muted);
  font-size: 12px;
}

.limits {
  margin-top: 20px;
}

.limits>div {
  display: grid;
  gap: 2px;
}

.limits>div:last-child {
  text-align: right;
}

.limits span,.range-note,dt,label,.total>span,.fine,footer {
  font-size: 13px;
  color: var(--muted);
}

.limits strong,dd,#estimate {
  font: 500 28px/1.35 var(--digits);
  font-variant-numeric: lining-nums tabular-nums;
}

.scale {
  position: relative;
  margin: 15px 3px 6px;
  height: 14px;
  border-top: 3px solid #ab955e;
  background: repeating-linear-gradient(90deg,#c4c8b9 0 1px,transparent 1px 5%) top left/100% 6px no-repeat;
}

.scale i {
  position: absolute;
  top: -8px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: #193e34;
  border: 2px solid var(--paper);
}

.range-note {
  font-size: 12px;
}

.range-note i {
  width: 6px;
  height: 6px;
  border-radius: 0;
  transform: rotate(45deg);
  background: #193e34;
}

dl {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  display: flex;
  gap: 22%;
}

dd {
  font-size: 22px;
  margin-top: 2px;
}

#calculator {
  border-left: 1px solid var(--line);
  padding-left: 40px;
}

.weight-field {
  display: flex;
  align-items: center;
  margin: 5px 0 8px;
  border: 1px solid #aab6a8;
  border-radius: 6px;
  background: #fffefa;
  overflow: hidden;
}

.weight-field:focus-within {
  outline: 2px solid #8c743d;
  outline-offset: 1px;
}

.weight-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  padding: 8px 12px;
  font-size: 17px;
}

.weight-field span {
  padding-right: 12px;
  font-size: 13px;
  color: var(--muted);
}

.weights {
  display: flex;
  gap: 6px;
}

.weights button {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 29px;
}

.weights button[aria-pressed=true] {
  background: #e1e9dc;
  border-color: #acbda7;
}

.total {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 10px;
  gap: 12px;
}

#estimate {
  font-size: 29px;
  overflow-wrap: anywhere;
  text-align: right;
}

.fine {
  font-size: 12px;
  margin-top: 5px;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding: 17px 0 24px;
  font-size: 12px;
  gap: 10px;
}

footer a {
  text-underline-offset: 3px;
}

@media(max-width:740px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .mast-inner {
    height: 60px;
    gap: 20px;
  }
  .mast nav {
    gap: 15px;
  }
  .coin {
    right: -2%;
    width: 220px;
  }
  .details {
    gap: 22px;
  }
  #calculator {
    padding-left: 22px;
  }
  .quote-body {
    padding: 24px;
  }
  .heading {
    padding-top: 28px;
  }
  .limits strong {
    font-size: 24px;
  }
}

@media(max-width:600px) {
  .mast nav {
    display: none;
  }
  .mast time {
    font-size: 12px;
  }
  .heading {
    padding-bottom: 18px;
  }
  .sub {
    font-size: 12px;
  }
  .refresh {
    padding: 8px 10px;
  }
  .status {
    font-size: 11px;
  }
  .market-controls {
    gap: 8px;
  }
  .switch button {
    padding: 6px 12px;
  }
  .ticker {
    min-height: 216px;
  }
  .coin {
    right: -90px;
    width: 200px;
    opacity: .16;
    z-index: -1;
  }
  .quote-body {
    padding: 22px 19px;
  }
  .reading {
    gap: 9px;
  }
  .reading strong {
    font-size: clamp(44px, 14vw, 56px);
  }
  .reading>span {
    font-size: 12px;
  }
  .market-title h2 {
    font-size: 16px;
  }
  .details {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
  }
  #calculator {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 21px 0 0;
  }
  footer {
    flex-wrap: wrap;
  }
  .section-head {
    margin-bottom: 12px;
  }
  .section-head h2 {
    font-size: 19px;
  }
}

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