:root {
  --wl-orange: #ff5a00;
  --wl-orange-2: #f59e0b;
  --wl-ink: #081226;
  --wl-muted: #5b677a;
  --wl-line: #d8e1ee;
  --wl-soft: #f6f8fb;
  --wl-card: rgba(255, 255, 255, 0.92);
  --wl-blue: #1768ff;
  --wl-radius: 24px;
  --wl-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--wl-ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 90, 0, 0.18), transparent 34rem),
    radial-gradient(circle at 100% 0%, rgba(23, 104, 255, 0.13), transparent 28rem),
    linear-gradient(135deg, #fffaf3 0%, #eef5ff 100%);
}

body.mobile-locked {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 74px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(216, 225, 238, 0.88);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #ff7a18, #e94900);
  color: #fff;
  font-weight: 950;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 30px rgba(255, 90, 0, 0.24);
}

.mobile-brand strong,
.mobile-brand small {
  display: block;
}

.mobile-brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.mobile-brand small {
  margin-top: 2px;
  color: var(--wl-muted);
  font-size: 0.78rem;
}

.mobile-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-nav a,
.mobile-nav button,
.mobile-chip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--wl-line);
  border-radius: 999px;
  background: #fff;
  color: var(--wl-ink);
  font-weight: 850;
  white-space: nowrap;
}

.mobile-nav button {
  cursor: pointer;
}

.mobile-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 18px 14px calc(104px + env(safe-area-inset-bottom));
}

.mobile-hero,
.mobile-panel,
.mobile-card,
.mobile-auth-card {
  border: 1px solid rgba(200, 213, 230, 0.92);
  border-radius: var(--wl-radius);
  background: var(--wl-card);
  box-shadow: var(--wl-shadow);
}

.mobile-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 20px;
}

.mobile-hero::after {
  content: "";
  position: absolute;
  right: -84px;
  top: -94px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 90, 0, 0.28), rgba(23, 104, 255, 0.08));
}

.mobile-eyebrow,
.eyebrow {
  margin: 0 0 8px;
  color: var(--wl-orange);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-hero h1,
.mobile-panel h1,
.mobile-auth-card h1,
.mobile-auth-card h2 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(1.85rem, 7vw, 3.6rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.mobile-auth-card h2 {
  font-size: clamp(1.55rem, 6vw, 2.5rem);
}

.mobile-hero p,
.mobile-panel p,
.mobile-auth-card p {
  color: var(--wl-muted);
  line-height: 1.55;
}

.mobile-section-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.mobile-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 213, 230, 0.86);
  border-radius: 16px;
  background: #f8fbff;
  font-size: 0.94rem;
}

.mobile-actions,
.mobile-grid,
.mobile-dashboard-grid,
.mobile-form-grid {
  display: grid;
  gap: 12px;
}

.mobile-actions {
  grid-template-columns: 1fr;
  margin-top: 22px;
}

.mobile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fff;
  color: var(--wl-ink);
  font-weight: 950;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.mobile-btn:active {
  transform: translateY(1px) scale(0.99);
}

.mobile-btn.primary {
  background: linear-gradient(135deg, var(--wl-orange), #ff7a18);
  color: #fff;
  box-shadow: 0 18px 36px rgba(255, 90, 0, 0.24);
}

.mobile-btn.blue {
  background: linear-gradient(135deg, var(--wl-blue), #08a4d9);
  color: #fff;
  box-shadow: 0 18px 36px rgba(23, 104, 255, 0.18);
}

.mobile-btn.install {
  border-color: rgba(255, 90, 0, 0.34);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.5), transparent 4rem),
    linear-gradient(135deg, #111827, #26354d);
  color: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.mobile-btn.ghost {
  border-color: var(--wl-line);
}

.mobile-btn.full {
  width: 100%;
  margin-top: 14px;
}

.mobile-grid,
.mobile-dashboard-grid {
  margin-top: 16px;
}

.mobile-tile,
.mobile-project-row {
  display: block;
  padding: 18px;
  border: 1px solid rgba(200, 213, 230, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.08);
}

.mobile-tile strong,
.mobile-project-row strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.mobile-tile span,
.mobile-project-row span {
  display: block;
  color: var(--wl-muted);
  line-height: 1.45;
}

.mobile-install-card {
  display: grid;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 90, 0, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 90, 0, 0.2), transparent 11rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 237, 0.92));
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.1);
}

.mobile-install-card strong,
.mobile-install-card span {
  display: block;
}

.mobile-install-card strong {
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.mobile-install-card span {
  color: var(--wl-muted);
  line-height: 1.45;
}

.is-mobile-app-installed [data-mobile-install] {
  display: none !important;
}

.mobile-panel {
  margin-top: 16px;
  padding: 18px;
}

.mobile-panel.compact {
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.mobile-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--wl-orange);
  font-weight: 950;
  text-transform: uppercase;
}

.mobile-step span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #fff1e7;
}

.mobile-field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.mobile-field span {
  font-weight: 900;
}

.mobile-field input,
.mobile-field select,
.mobile-field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #c8d5e6;
  border-radius: 16px;
  background: #fff;
  color: var(--wl-ink);
  outline: none;
}

.mobile-field textarea {
  min-height: 108px;
  resize: vertical;
}

.mobile-field input:focus,
.mobile-field select:focus,
.mobile-field textarea:focus {
  border-color: var(--wl-orange);
  box-shadow: 0 0 0 4px rgba(255, 90, 0, 0.12);
}

.mobile-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.mobile-radio-card {
  position: relative;
  display: grid;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--wl-line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
}

.mobile-radio-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.mobile-radio-card strong {
  display: block;
  margin-bottom: 4px;
}

.mobile-radio-card small {
  color: var(--wl-muted);
}

.mobile-radio-card:has(input:checked) {
  border-color: var(--wl-orange);
  background: #fff4ea;
  box-shadow: inset 0 0 0 1px rgba(255, 90, 0, 0.22);
}

.mobile-layout-controls {
  display: grid;
  gap: 12px;
}

.mobile-layout-card {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(200, 213, 230, 0.92);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 90, 0, 0.08), transparent 7rem),
    #fff;
}

.mobile-layout-card legend {
  padding: 0 8px;
  color: var(--wl-ink);
  font-weight: 950;
}

.mobile-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-layout-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mobile-layout-grid span {
  color: var(--wl-muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.mobile-layout-grid input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c8d5e6;
  border-radius: 14px;
  background: #fff;
  color: var(--wl-ink);
  font-weight: 850;
}

.mobile-maker-layout {
  display: grid;
  gap: 16px;
}

.mobile-preview-shell {
  position: sticky;
  top: 88px;
}

.mobile-preview-card {
  padding: 16px;
  border: 1px solid var(--wl-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 58px rgba(15, 23, 42, 0.1);
}

.mobile-preview-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 18px;
  background: #f4f7fb;
  color: var(--wl-muted);
  font-weight: 800;
}

.mobile-preview-meta strong {
  color: #dd4b00;
  font-size: 1.05rem;
}

.mobile-preview-frame {
  display: grid;
  min-height: 245px;
  place-items: center;
  padding: 28px;
  border: 1px dashed #c8d5e6;
  border-radius: 20px;
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 90, 0, 0.08), transparent 10rem),
    linear-gradient(180deg, #ffffff, #edf2f7);
  overflow: hidden;
}

.mobile-preview-frame .home-template-preview {
  width: min(100%, 360px);
  max-height: 220px;
}

.mobile-3d-hero {
  background:
    radial-gradient(circle at 74% 0%, rgba(255, 90, 0, 0.24), transparent 13rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
}

.mobile-3d-stage {
  position: relative;
  display: grid;
  gap: 16px;
  place-items: center;
  width: 100%;
  min-height: 330px;
  padding: 18px;
  border: 1px dashed #c8d5e6;
  border-radius: 22px;
  background:
    linear-gradient(140deg, rgba(15, 23, 42, 0.06), transparent 42%),
    radial-gradient(circle at 78% 22%, rgba(255, 90, 0, 0.16), transparent 10rem),
    #f8fbff;
  perspective: 920px;
  overflow: hidden;
}

.mobile-3d-canvas {
  display: block;
  width: min(100%, 440px);
  aspect-ratio: 1.4 / 1;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.94), transparent 9rem),
    linear-gradient(145deg, #f8fbff, #dfe7f0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 24px 46px rgba(15, 23, 42, 0.16);
  touch-action: none;
}

.mobile-3d-stage.has-3d-canvas .mobile-3d-dom-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.mobile-3d-orbit-help {
  max-width: 420px;
  margin: -4px 0 0;
  color: var(--wl-muted);
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
}

.mobile-3d-buildplate {
  position: relative;
  display: grid;
  width: min(100%, 360px);
  min-height: 212px;
  padding: 22px;
  place-items: center;
  border: 1px solid rgba(71, 85, 105, 0.24);
  border-radius: 26px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(135deg, #111827, #293548);
  background-size: 28px 28px, 28px 28px, auto;
  box-shadow: 0 32px 70px rgba(15, 23, 42, 0.22);
  transform: rotateX(58deg) rotateZ(-13deg);
  transform-style: preserve-3d;
}

.mobile-3d-label {
  position: relative;
  width: min(86%, 290px);
  aspect-ratio: var(--mobile-3d-ratio, 2) / 1;
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--mobile-3d-accent, #ff5a00) 74%, #111827);
  border-radius: 14px;
  background: var(--mobile-3d-bg, #0b1f44);
  color: var(--mobile-3d-fg, #fff);
  box-shadow:
    0 10px 0 color-mix(in srgb, var(--mobile-3d-bg, #0b1f44) 78%, #000),
    0 24px 34px rgba(0, 0, 0, 0.26);
  transform: translateZ(32px);
  overflow: hidden;
}

.mobile-3d-element {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  line-height: 1;
  overflow-wrap: anywhere;
}

.mobile-3d-preview-shape {
  z-index: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.mobile-3d-preview-text {
  font-size: clamp(6px, calc(var(--mobile-3d-font, 4) * 2.4px), 28px);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

.mobile-3d-preview-scan {
  justify-content: center;
  align-items: center;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
}

.mobile-3d-preview-scan img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mobile-3d-slots {
  display: grid;
  grid-template-columns: repeat(var(--slot-cols, 3), 1fr);
  gap: 5px;
  width: min(78%, 260px);
  transform: translateZ(12px);
}

.mobile-3d-slots span {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.mobile-3d-slots span.is-filled {
  background: linear-gradient(135deg, var(--mobile-3d-accent, #ff5a00), #ffd08a);
  box-shadow: 0 5px 12px rgba(255, 90, 0, 0.24);
}

.mobile-3d-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  color: var(--wl-muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.mobile-3d-mini-meta span {
  padding: 8px 10px;
  border: 1px solid #d8e1ee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.mobile-color-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mobile-color-row input[type="color"] {
  min-height: 54px;
  padding: 4px;
}

.home-template-preview {
  position: relative;
  display: block;
  container-type: size;
  aspect-ratio: var(--sample-ratio, 2) / 1;
  overflow: hidden;
  border: 1px solid rgba(8, 18, 38, 0.28);
  border-radius: 8px;
  background: var(--sample-bg, #0b1f44);
  color: var(--sample-fg, #ffffff);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.22);
}

.home-template-element {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.home-template-text {
  min-width: 0;
  min-height: 0;
  padding: 0 1px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
  font-size: calc((var(--font-mm, 6) / var(--sample-height-mm, 40)) * 100cqh);
  line-height: var(--line-height-num, 1);
  letter-spacing: calc((var(--track-mm, 0) / var(--sample-height-mm, 40)) * 100cqh);
}

.home-template-text-inner {
  display: block;
  width: 100%;
}

.home-template-shape {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.home-template-code,
.home-template-qr {
  align-items: center;
  justify-content: center;
}

.home-template-code img,
.home-template-image img,
.home-template-preview > img {
  display: block;
  object-fit: contain;
}

.home-template-qr img {
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 88%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: #fff;
}

.home-template-barcode img {
  width: auto;
  height: auto;
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
  padding: 2px 3px;
  border-radius: 4px;
  background: #fff;
}

.home-template-fallback-head {
  display: block;
  padding: 12px 14px;
  background: var(--sample-accent, #f06423);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.home-template-preview > strong {
  display: block;
  padding: 16px 14px 4px;
  color: var(--sample-fg, #fff);
  font-size: 1.8rem;
  line-height: 1;
}

.home-template-preview > small {
  display: block;
  padding: 0 14px 12px;
  color: color-mix(in srgb, var(--sample-fg, #fff) 72%, transparent);
  font-weight: 750;
}

.home-template-preview > img {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 44%;
  height: 25%;
}

.mobile-summary-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.mobile-summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f8fb;
}

.mobile-summary-list dt,
.mobile-summary-list dd {
  margin: 0;
}

.mobile-summary-list dt {
  color: var(--wl-muted);
}

.mobile-summary-list dd {
  text-align: right;
  font-weight: 950;
}

.mobile-alert {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.mobile-alert.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.mobile-sticky-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  gap: 10px;
  padding: 12px max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  border-top: 1px solid rgba(216, 225, 238, 0.92);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.mobile-auth-wrap {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 78px);
  place-items: center;
  padding: 18px 14px calc(52px + env(safe-area-inset-bottom));
}

.mobile-auth-card {
  width: min(100%, 480px);
  padding: 22px;
}

.mobile-bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.mobile-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 30px 14px calc(120px + env(safe-area-inset-bottom));
  color: var(--wl-muted);
  font-weight: 800;
}

.mobile-footer a {
  padding: 8px 10px;
}

@media (min-width: 720px) {
  .mobile-shell {
    padding-inline: 22px;
  }

  .mobile-actions,
  .mobile-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-maker-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
    align-items: start;
  }

  .mobile-install-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 980px) {
  .mobile-actions,
  .mobile-dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-sticky-actions {
    left: 50%;
    width: min(720px, calc(100% - 40px));
    margin: 0 auto;
    transform: translateX(-50%);
    border: 1px solid rgba(216, 225, 238, 0.92);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
  }
}

@media (max-width: 430px) {
  .mobile-topbar {
    min-height: 66px;
  }

  .mobile-brand small {
    display: none;
  }

  .mobile-brand strong {
    font-size: 0.93rem;
  }

  .mobile-nav a,
  .mobile-nav button {
    min-height: 38px;
    max-width: 92px;
    padding-inline: 9px;
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
  }

  .mobile-panel {
    padding: 15px;
  }

  .mobile-preview-frame {
    min-height: 220px;
    padding: 20px;
  }
}
