/* Mini HOTAS: setup page and shop. Builds on site.css (tokens, header, footer, buttons). */
:root { --ok: #3fbf7a; --ok-soft: rgba(63, 191, 122, 0.14); }

.app .nav a[aria-current="page"] { color: var(--placard); }
.btn--quiet { background: transparent; color: var(--placard); box-shadow: inset 0 0 0 1px var(--rule-2); }
.btn--quiet:hover { background: rgba(255, 255, 255, 0.06); color: var(--placard); }
.btn--wide { width: 100%; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.75; }

/* ===================== setup ===================== */
.setup { padding: calc(var(--head-h) + clamp(2.5rem, 6vw, 4.5rem)) 0 clamp(4rem, 8vw, 6rem); }
.setup__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.setup h1 { font-size: var(--s3); margin-bottom: 1rem; }
.setup__intro { color: var(--dim); max-width: 34em; margin: 0; }

.step { margin-top: 2.25rem; border-top: 1px solid var(--rule); padding-top: 1.75rem; }
.step h2 { font-size: var(--s2); margin-bottom: 0.75rem; }
.step h2:focus { outline: none; }
.step h3 { font-size: var(--s1); margin-bottom: 0.4rem; }
.step p { color: var(--dim); max-width: 32em; margin: 0 0 0.9rem; }
.step strong { color: var(--placard); }
.step a { color: var(--placard); }
.step__count { color: var(--red-hi); font-size: var(--s-1); margin-bottom: 0.4rem !important; }
.step__meta { color: var(--faint) !important; font-size: var(--s-1); }
.step__status { color: var(--placard) !important; }
.step__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.steps { margin: 0; padding-left: 1.25rem; color: var(--dim); }
.steps li { margin: 0 0 0.6rem; padding-left: 0.25rem; max-width: 32em; }
.steps li::marker { color: var(--placard); font-weight: 700; }

.block { padding: 1.4rem 0 1.5rem; border-top: 1px solid var(--rule); }
.block:first-of-type { border-top: 0; padding-top: 0.5rem; }
.tally { color: var(--placard) !important; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 0.6rem; }
.tally__sep { width: 4px; height: 4px; border-radius: 50%; background: var(--rule-2); }
.allgood { color: var(--ok) !important; font-weight: 700; }

.checks { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 1.4rem 1fr auto; column-gap: 0.85rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.checks li::before {
  content: ""; grid-row: 1 / span 2; width: 1.1rem; height: 1.1rem; margin-top: 0.25rem; border-radius: 50%;
  border: 1.5px solid var(--rule-2); transition: background-color 0.25s, border-color 0.25s;
}
.checks li.is-done::before {
  border-color: var(--ok);
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.6' fill='none' stroke='%230c0e11' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.checks b { color: var(--placard); }
.checks span { grid-column: 2; color: var(--dim); font-size: var(--s-1); line-height: 1.5; }
.checks em { grid-column: 3; grid-row: 1; font-style: normal; color: var(--faint); font-size: var(--s-1); font-variant-numeric: tabular-nums; }
.checks li.is-done span { color: var(--faint); }

/* the live controller: the real top-view render, with the moving parts as separate layers */
.setup__view { position: sticky; top: calc(var(--head-h) + 1.5rem); }
.device { position: relative; aspect-ratio: 1; width: 100%; max-width: 38rem; margin-inline: auto; }
.device__stage { position: absolute; left: 0; top: 0; width: 1200px; height: 1200px; transform-origin: 0 0; transform: scale(var(--s, 0.4)); transition: opacity 0.4s ease; }
.device[data-mode="idle"] .device__stage { opacity: 0.55; }
.layer { position: absolute; left: 0; top: 0; display: block; max-width: none; }
.layer--base { width: 1200px; height: 1200px; }
.sprite { will-change: transform; }
.overlay { width: 1200px; height: 1200px; overflow: visible; }
.key { fill: transparent; stroke: transparent; stroke-width: 6; transition: fill 0.06s linear, stroke 0.3s ease; }
.key.is-ok { stroke: var(--ok); fill: var(--ok-soft); }
.key.is-down { fill: rgba(196, 32, 42, 0.9); stroke: #ff6a70; }
.click { fill: none; stroke: transparent; stroke-width: 7; transition: stroke 0.15s ease; }
.click.is-ok { stroke: var(--ok); }
.click.is-down { stroke: #ff6a70; }
.ring { opacity: 0; transition: opacity 0.3s ease; }
.device[data-mode="cal"] .ring { opacity: 1; }
.sector { fill: rgba(19, 21, 24, 0.34); transition: fill 0.2s ease; }
.device[data-mode="cal"] .key.is-ok, .device[data-mode="cal"] .click.is-ok { stroke: transparent; fill: transparent; }
.sector.is-on { fill: var(--ok); }
.device__label { text-align: center; color: var(--faint); font-size: var(--s-1); margin: 0.75rem 0 0; }

.readout { display: grid; gap: 0.7rem; max-width: 38rem; margin: 2rem auto 0; }
.axis { display: grid; grid-template-columns: minmax(9rem, 11rem) 1fr 3.25rem; align-items: center; gap: 1rem; font-size: var(--s-1); color: var(--dim); }
.axis__name { display: flex; align-items: center; gap: 0.5rem; }
.axis__name::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--rule-2); flex: none; transition: background-color 0.25s; }
.axis.is-ok .axis__name::before { background: var(--ok); }
.axis__bar { position: relative; height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.axis__bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--placard); border-radius: 3px; }
.axis__bar--centred::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--faint); }
.axis__val { text-align: right; color: var(--placard); font-variant-numeric: tabular-nums; }

@media (max-width: 60rem) {
  .setup__grid { grid-template-columns: 1fr; }
  .setup__view { position: static; }
  .axis { grid-template-columns: 8.5rem 1fr 3rem; }
}

/* ===================== shop ===================== */
.shop { padding: calc(var(--head-h) + clamp(2.5rem, 6vw, 4.5rem)) 0 clamp(4rem, 8vw, 6rem); }
.shop__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.shop__media { position: relative; border-radius: 4px; overflow: hidden; background: var(--night-2); }
.shop__media img { display: block; width: 100%; height: auto; }
.shop__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: 0.75rem; }
.shop__thumbs button { padding: 0; border: 0; background: var(--night-2); border-radius: 3px; overflow: hidden; cursor: pointer; opacity: 0.6; transition: opacity 0.2s; box-shadow: inset 0 0 0 1px var(--rule); }
.shop__thumbs button[aria-pressed="true"], .shop__thumbs button:hover { opacity: 1; }
.shop__thumbs img { display: block; width: 100%; height: auto; }
.buy h1 { font-size: var(--s3); margin-bottom: 0.5rem; }
.buy__sub { color: var(--dim); margin: 0 0 1.5rem; max-width: 30em; }
.buy__price { font-size: var(--s2); font-weight: 700; margin: 0 0 1.5rem; font-variant-numeric: tabular-nums; }
.buy__list { list-style: none; padding: 0; margin: 0 0 2rem; border-top: 1px solid var(--rule); }
.buy__list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); font-size: var(--s-1); color: var(--dim); }
.buy__list li span:last-child { color: var(--placard); text-align: right; }
.buy__closed { border-left: 2px solid var(--red); padding: 0.2rem 0 0.2rem 1.1rem; margin-bottom: 1.75rem; }
.buy__closed h2 { font-size: var(--s1); margin-bottom: 0.35rem; }
.buy__closed p { color: var(--dim); margin: 0; }
.qty { display: inline-flex; align-items: center; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--rule-2); }
.qty button { width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--placard); font: inherit; font-size: 1.2rem; cursor: pointer; }
.qty button:disabled { color: var(--faint); cursor: default; }
.qty output { min-width: 2rem; text-align: center; font-variant-numeric: tabular-nums; }
.buy__row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.buy__row .btn { flex: 1 1 12rem; }
.buy__fine { color: var(--faint); font-size: var(--s-1); line-height: 1.5; margin: 1rem 0 0; }
.buy__fine a { color: var(--dim); }

/* basket: a panel that slides in from the right */
.cart-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 6px; background: none; color: var(--placard); cursor: pointer; }
.cart-btn:hover { background: rgba(255, 255, 255, 0.06); }
.cart-btn[hidden], [hidden] { display: none !important; }
.cart-btn svg { width: 22px; height: 22px; }
.cart-btn b { position: absolute; top: 0.2rem; right: 0.15rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem; border-radius: 0.6rem; background: var(--red); color: #fff; font-size: 0.7rem; line-height: 1.05rem; text-align: center; }
.cart-btn b:empty { display: none; }
.basket { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.basket.is-open { visibility: visible; }
.basket__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.25s ease; }
.basket.is-open .basket__scrim { opacity: 1; }
.basket__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(28rem, 100%); display: flex; flex-direction: column;
  background: var(--night-2); border-left: 1px solid var(--rule); transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.basket.is-open .basket__panel { transform: none; }
.basket__head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--rule); }
.basket__head h2 { font-size: var(--s1); }
.basket__close { width: 2.4rem; height: 2.4rem; border: 0; border-radius: 6px; background: none; color: var(--placard); font-size: 1.4rem; cursor: pointer; }
.basket__close:hover { background: rgba(255, 255, 255, 0.06); }
.basket__body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.basket__empty { color: var(--dim); }
.line { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1rem; align-items: center; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.line img { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 3px; background: var(--night); }
.line h3 { font-size: var(--s0); margin-bottom: 0.4rem; }
.line__price { font-variant-numeric: tabular-nums; }
.line__remove { border: 0; background: none; color: var(--faint); font: inherit; font-size: var(--s-1); text-decoration: underline; cursor: pointer; padding: 0; margin-left: 0.75rem; }
.dest { margin: 1.5rem 0 0; }
.dest label { display: block; font-size: var(--s-1); color: var(--dim); margin-bottom: 0.45rem; }
.dest select {
  width: 100%; font: inherit; color: var(--placard); background: var(--night); border: 1px solid var(--rule-2); border-radius: 6px;
  padding: 0.8rem 2.5rem 0.8rem 0.9rem; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a2a6ad' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 1rem;
}
.dest select:focus { outline: none; border-color: var(--placard); }
.sums { margin: 1.5rem 0 0; padding: 0; list-style: none; }
.sums li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; color: var(--dim); font-size: var(--s-1); font-variant-numeric: tabular-nums; }
.sums li span:last-child { color: var(--placard); }
.sums li.total { margin-top: 0.5rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); font-size: var(--s0); color: var(--placard); font-weight: 700; }
.basket__foot { padding: 1.25rem 1.5rem 1.5rem; border-top: 1px solid var(--rule); }
.basket__note { color: var(--faint); font-size: 0.8rem; line-height: 1.5; margin: 0.9rem 0 0; }
.basket__note a { color: var(--dim); }
.basket__error { color: #ff8c8c; font-size: var(--s-1); margin: 0 0 0.9rem; }
.basket__error:empty { display: none; }

.thanks { padding: calc(var(--head-h) + 6rem) 0 8rem; }
.thanks h1 { font-size: var(--s3); margin-bottom: 1rem; }
.thanks p { color: var(--dim); max-width: 34em; }

@media (max-width: 60rem) {
  .shop__grid { grid-template-columns: 1fr; }
  .cart-btn { margin-left: auto; }      /* the menu is hidden here, so push the basket to the right */
}

/* legal pages */
.form-copy { border-left: 2px solid var(--rule-2); padding: 0.25rem 0 0.25rem 1.1rem; margin-top: 1rem; }
.form-copy p { color: var(--placard); }
