/* Web-only rules. Loads after styles.generated.css (which is the mechanical
 * translation of the WXSS) and adds only what a browser needs and WeChat
 * provided for free. No visual changes to the ported layout.
 */

/* WeChat renders the page inside its own chrome; a browser needs the reset. */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overscroll-behavior: none;   /* no rubber-band while the QR is on a lens */
  -webkit-text-size-adjust: 100%;
}

body {
  /* app.wxss sets background/colour/font; only the box needs establishing. */
  min-height: 100dvh;
}

/* Notch / home-indicator clearance — WeChat's navigation bar did this. */
.page {
  padding-top: calc(24 * var(--rpx) + env(safe-area-inset-top));
  padding-bottom: calc(32 * var(--rpx) + env(safe-area-inset-bottom));
}

/* WXML <text> is inline; the generated rules assume flex children behave like
   miniprogram <text>/<view>. Spans carrying flex/layout rules need this. */
.title, .chip-text, .chip-icon, .status-text, .status-sub, .clock-date,
.details-label, .details-arrow, .metric-label, .metric-value, .step-text,
.time-main, .time-ms, .refresh-icon, .dialog-title {
  display: inline-block;
}

.status-sub, .clock-date, .dialog-title { display: block; }

/* Tap affordances that WeChat gave bindtap for free. */
.chip, .refresh-btn, .details-toggle, .dialog-btn {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chip:focus-visible, .refresh-btn:focus-visible,
.details-toggle:focus-visible, .dialog-btn:focus-visible {
  outline: 2px solid #4F8CFF;
  outline-offset: 2px;
}

.refresh-btn.disabled { pointer-events: none; }

/* The canvas is sized in JS (CSS px + DPR backing store); keep it from being
   stretched by the flex parent. */
.qr-canvas { flex: none; }

/* `hidden` must win over the generated `display:flex` rules. */
[hidden] { display: none !important; }

/* Native input reset — WeChat <input> carried no UA styling. */
.dialog-input {
  width: 100%;
  display: block;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.dialog-input:focus { border-color: #4F8CFF; }

/* Wake-lock warning — web-only, no miniprogram counterpart. */
.wake-warning {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: calc(12 * var(--rpx));
  margin-top: calc(20 * var(--rpx));
  padding: calc(14 * var(--rpx)) calc(20 * var(--rpx));
  background-color: #161B26;
  border: calc(1 * var(--rpx)) solid #1F2633;
  border-radius: calc(20 * var(--rpx));
}

.wake-warning-icon { color: #F5A623; font-size: calc(26 * var(--rpx)); }

.wake-warning-text {
  color: #8A93A6;
  font-size: calc(22 * var(--rpx));
  line-height: 1.3;
}

/* Desktop browsers: 100vw/750 makes everything enormous on a wide window.
   Clamp the rpx base and centre, so desktop testing looks like a phone. */
@media (min-width: 620px) {
  :root { --rpx: calc(620px / 750); }
  .page {
    width: 620px;
    margin: 0 auto;
  }
}
