/* styles-ad-shell-depth */
@font-face {
  font-family: "Huninn";
  src: url("../send/assets/huninn.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f6f3ee;
  --ink: #1c2430;
  --muted: #5c6b7a;
  --line: #d7dde5;
  --card: #fffdf9;
  --accent: #b71920;
  --accent-soft: #f3e4e5;
  --chassis: #e4e0d8;
  --chassis-deep: #cfc9bd;
  --font: "Noto Sans HK", "PingFang HK", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #efe7dc 0%, transparent 55%),
    linear-gradient(180deg, #f8f4ee 0%, #eef2f6 100%);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 20px 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  margin: 0;
  font-family: Montserrat, "Noto Sans HK", sans-serif;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--accent);
  flex: 0 0 auto;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  letter-spacing: 0.14em;
  font-size: 10px;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.3;
  font-weight: 700;
}

.lede,
.muted,
.footer,
.hero-note,
.stage-label,
.weather-demo-note,
.eta-updated {
  color: var(--muted);
}

.flush {
  margin: 0;
}

.lede {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  max-width: 42ch;
}

.hero-register {
  flex: 0 0 auto;
  margin-left: auto;
}

.hero-sub {
  margin: 0;
  max-width: 48ch;
  font-size: 13px;
  line-height: 1.45;
}

.hero-note {
  margin: 0;
  max-width: 52ch;
  font-size: 13px;
  line-height: 1.5;
}

.gate-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #efd7a5;
  border-radius: 8px;
  background: #fff6e5;
  color: #7a5b20;
  max-width: none;
  width: 100%;
  flex: 1 0 100%;
  line-height: 1.45;
  font-size: 13px;
}

.chassis-tag {
  margin: 8px 4px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.chassis-tag[hidden] {
  display: none !important;
}

.gated-banner {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.gated-banner[hidden] {
  display: none !important;
}

.list-flash {
  animation: list-flash-pulse 1.6s ease-out;
}

@keyframes list-flash-pulse {
  0% {
    outline: 2px solid rgb(183 25 32 / 85%);
    outline-offset: 3px;
  }
  100% {
    outline: 2px solid rgb(183 25 32 / 0%);
    outline-offset: 3px;
  }
}

.button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.secondary {
  background: var(--accent-soft);
  border-color: transparent;
}

.button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 600;
  min-height: 40px;
  padding: 8px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button.quiet:hover {
  color: var(--ink);
}

.button.is-disabled,
.button:disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

.try-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 48px;
  display: grid;
  /* Prefer a wide device column so the 480×320 window stays readable
     after mm-accurate bezel (~66%×56% of chassis). */
  grid-template-columns: minmax(560px, 1.75fr) minmax(280px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.live-panel-soft {
  background: rgb(255 253 249 / 72%);
  border-color: rgb(215 221 229 / 75%);
  box-shadow: none;
}

.live-panel-soft h2 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.live-panel-soft .panel-lead {
  font-size: 12px;
  margin-top: -6px;
}

.device-stage {
  position: sticky;
  top: 12px;
  scroll-margin-top: 16px;
  width: 100%;
}

#route-picker,
#purchase {
  scroll-margin-top: 16px;
}

.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.stage-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.device-chassis {
  /* Fill stage width — mm geometry stays accurate; larger shell ⇒ larger screen. */
  width: 100%;
  max-width: none;
}

.device-chassis.is-gated .screen-slot {
  outline: 2px dashed rgb(240 180 80 / 55%);
  outline-offset: 2px;
}

/*
 * Face mm (正式表 / dimensions.json), SVG origin = outer TL:
 * plastic to face hole L/R 18.33  T/B 18.82
 * plastic to window     L/R 19.53  T/B 20.02
 * plastic to active     L/R 20.03  T/B 20.52  ← screen-slot
 * (模組體左黑邊≈8／右≈3 喺 84×54 玻璃上，窗口只比 active 大 0.5/邊，正面幾乎睇唔到)
 */
.chassis-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 113.5 / 90;
  /* 4 mm corner in outer space — clip so bounding-box corners stay transparent */
  border-radius: calc(100% * 4 / 113.5) / calc(100% * 4 / 90);
  overflow: hidden;
  background: transparent;
  /* Lift + contact: near penumbra, mid soft, far ambient (no glow).
     Rim highlight lives on the SVG stroke — inset shadows would sit under the face. */
  box-shadow:
    0 2px 4px rgb(20 32 51 / 14%),
    0 12px 28px rgb(20 32 51 / 16%),
    0 28px 56px rgb(20 32 51 / 18%),
    0 40px 10px -28px rgb(20 32 51 / 22%);
}

.chassis-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background: transparent;
}

.screen-slot {
  position: absolute;
  left: calc(100% * 20.03 / 113.5);
  top: calc(100% * 20.52 / 90);
  width: calc(100% * 73.44 / 113.5);
  height: calc(100% * 48.96 / 90);
  border-radius: 0.6px;
  overflow: hidden;
  background: #000;
  box-shadow:
    inset 0 1px 2px rgb(0 0 0 / 55%),
    inset 0 0 0 0.5px rgb(0 0 0 / 35%);
}

.screen-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 45%, #1a1a1a 100%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.2s linear infinite;
  color: #cfcfcf;
  font-size: 13px;
  font-weight: 600;
}

.screen-skeleton[hidden] {
  display: none !important;
}

@keyframes skeleton-shine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.screen-flash {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgb(183 25 32 / 92%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.screen-flash[hidden] {
  display: none !important;
}

#device-screen,
#dialog-screen,
#mobile-device-screen {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  image-rendering: auto;
  cursor: pointer;
}

.weather-demo-note,
.eta-updated {
  margin: 10px 4px 0;
  font-size: 12px;
  line-height: 1.4;
}

.intent-cta {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, var(--accent-soft) 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.intent-cta p {
  margin: 0;
  font-weight: 700;
}

.card-demo-panel .card-preset-row {
  flex-wrap: wrap;
}

.card-demo-panel .status {
  min-height: 1.2em;
  margin: 0 0 10px;
  font-size: 13px;
}

.quick-results {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.quick-result {
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.quick-result:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.advanced-picker {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.advanced-picker > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.advanced-picker > summary::-webkit-details-marker {
  display: none;
}

.advanced-picker > summary::before {
  content: "▸ ";
  color: var(--muted);
}

.advanced-picker[open] > summary::before {
  content: "▾ ";
}

.advanced-picker[open] > summary {
  margin-bottom: 10px;
}

.picker-status {
  margin-bottom: 8px;
}

.panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.panel-heading h2 {
  margin: 0;
}

.eta-updated {
  margin: 0;
  font-size: 12px;
}

.slot-row.editable {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.slot-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.slot-btn {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 12px;
}

.interest-form {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.interest-form label {
  margin-bottom: 0;
}

.consent-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 500 !important;
}

.consent-row input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
}

#turnstile-slot {
  min-height: 65px;
}

.screen-dialog {
  width: min(96vw, 920px);
  max-width: 96vw;
  max-height: 96dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--card);
}

.faq-panel h2 {
  margin-bottom: 6px;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-item > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary::before {
  content: "▸ ";
  color: var(--muted);
}

.faq-item[open] > summary::before {
  content: "▾ ";
}

.faq-item p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
}

.screen-dialog::backdrop {
  background: rgb(12 18 28 / 55%);
}

.screen-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgb(12 18 28 / 55%);
  box-sizing: border-box;
}

.card-crop-overlay[hidden] {
  display: none !important;
}

.card-crop-panel {
  width: min(96vw, 560px);
  max-width: 96vw;
  max-height: 96dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--card);
  box-shadow: 0 12px 40px rgb(12 18 28 / 28%);
}

.card-crop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.card-crop-hint {
  margin: 0 0 10px;
  font-size: 13px;
}

.card-crop-frame {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 12px;
  aspect-ratio: 480 / 320;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111;
  touch-action: none;
}

.card-crop-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.card-crop-frame canvas:active {
  cursor: grabbing;
}

.card-crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-crop-actions .button {
  flex: 1 1 auto;
  min-width: 72px;
}

.card-crop-actions .button.primary {
  flex: 1 1 100%;
}

.card-demo-real-note {
  margin-top: -4px;
}

.card-demo-real-note a,
.card-decorate-send-note a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card-decorate-stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.card-decorate-stickers .card-decorate-sticker {
  min-width: 48px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.card-decorate-stickers .card-decorate-sticker img {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto;
}

.card-decorate-stickers .card-decorate-sticker:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.card-decorate-message {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.card-decorate-message input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
}

.card-decorate-send-note {
  margin-bottom: 10px;
}

.controls {
  display: grid;
  gap: 14px;
}

.controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel,
.controls > label,
.controls-row > label {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.controls > label,
.controls-row > label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.soft-panel {
  padding: 12px 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.panel-lead {
  margin: -4px 0 12px;
  font-size: 13px;
  font-weight: 400;
}

.panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

select,
input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warning-panel > summary,
.appearance-panel > summary,
.card-demo-panel > summary,
.warning-more > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.warning-panel > summary::-webkit-details-marker,
.appearance-panel > summary::-webkit-details-marker,
.card-demo-panel > summary::-webkit-details-marker,
.warning-more > summary::-webkit-details-marker {
  display: none;
}

.warning-panel > summary,
.appearance-panel > summary,
.card-demo-panel > summary {
  font-size: 1rem;
}

.warning-panel > summary::before,
.appearance-panel > summary::before,
.card-demo-panel > summary::before,
.warning-more > summary::before {
  content: "▸ ";
  color: var(--muted);
}

.warning-panel[open] > summary::before,
.appearance-panel[open] > summary::before,
.card-demo-panel[open] > summary::before,
.warning-more[open] > summary::before {
  content: "▾ ";
}

.warning-panel > .muted,
.appearance-panel > .muted,
.card-demo-panel > .muted,
.card-demo-panel > .status,
.card-demo-panel > .row-actions,
.warning-presets,
.warning-more,
.warning-panel > .button,
.appearance-panel > label,
.appearance-panel > .controls-row {
  margin-top: 10px;
}

.appearance-panel label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.footer-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.footer-note a {
  color: inherit;
}

.warning-presets {
  margin-bottom: 0;
}

.warning-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin: 10px 0;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.warning-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 36px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.warning-check input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.warning-swatch {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  image-rendering: pixelated;
  background: #eef2f6;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%);
}

.status {
  min-height: 1.4em;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.route-slots,
.live-eta-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.slot-row,
.live-route {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.live-route h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.live-route p {
  margin: 0;
}

.live-etas {
  margin-top: 6px !important;
  font-weight: 700;
  color: var(--accent);
}

.purchase-panel-cta {
  margin: 4px 0 14px;
  width: 100%;
}

.bullets {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
  line-height: 1.55;
}

.bullets a {
  color: var(--accent);
  text-decoration: underline;
}

.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 40px;
  font-size: 12px;
}

.privacy-shell {
  display: block;
  max-width: 720px;
}

.privacy-back {
  margin-top: 12px;
}

.mobile-sticky-preview {
  display: none;
}

@media (max-width: 960px) {
  .try-shell {
    grid-template-columns: 1fr;
  }

  .device-stage {
    position: static;
  }

  .hero {
    align-items: flex-start;
  }

  .hero-register {
    margin-left: 0;
  }

  .hero h1 {
    max-width: none;
  }

  .controls-row {
    grid-template-columns: 1fr;
  }

  .warning-checks {
    grid-template-columns: 1fr;
  }

  .mobile-sticky-preview {
    display: none;
    position: fixed;
    top: 8px;
    right: 10px;
    z-index: 40;
    width: 158px;
    padding: 6px 6px 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgb(255 253 249 / 94%);
    box-shadow: 0 10px 28px rgb(20 32 51 / 22%);
    backdrop-filter: blur(8px);
  }

  .mobile-sticky-preview.is-visible {
    display: block;
  }

  .mobile-sticky-preview[hidden] {
    display: none !important;
  }

  .mobile-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
  }

  .mobile-sticky-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
  }

  .mobile-sticky-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 4px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .mobile-sticky-chassis {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-radius: 10px;
  }

  .mobile-sticky-chassis:focus-visible {
    outline: 2px solid rgb(183 25 32 / 85%);
    outline-offset: 2px;
  }

  .mobile-sticky-shell {
    box-shadow:
      0 1px 2px rgb(20 32 51 / 12%),
      0 6px 14px rgb(20 32 51 / 16%),
      0 14px 28px rgb(20 32 51 / 14%);
    pointer-events: none;
  }
}

.card-demo-panel .card-upload-row {
  margin-top: 10px;
}

.card-demo-panel .card-upload-row .button {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .screen-skeleton {
    animation: none;
  }

  .list-flash {
    animation: none;
    outline: 2px solid rgb(183 25 32 / 85%);
    outline-offset: 3px;
  }

  .mobile-sticky-preview {
    transition: none;
  }
}
