/* ==========================================================================
   SEEYOUSOON — Flytt: «Skanna rummet med AI» (round 46), G1's button and its sheet
   Linked in index.html. The markup is G1's template (js/stitch/screens/moving/G1.js), the behaviour moving-scan.js.
   The moving screens' own look: the violet of the cards and chips (the shared .sys-move-* rules in css/stitch/moving/),
   dark by default, light under html[data-theme="light"] / html[data-apple-theme="light"]. Every rule is under
   [data-screen], so it outranks the scoped preflight's button reset. Never ::before/::after on an action (tap-reach).
   ========================================================================== */

/* a part the flow hides stays hidden, whatever display a rule or a utility gives it */
[data-screen] [class*="sys-scan"][hidden],
[data-screen] .sys-scan-foot > [hidden] { display: none !important; }

/* ---- the button at the top of G1 ---- */
[data-screen] .sys-scan-entry { display: flex; flex-direction: column; gap: 8px; }
[data-screen] .sys-scan-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 14px 14px 14px 12px; text-align: left;
  border-radius: 20px; border: 1px solid rgba(167, 139, 250, 0.45); cursor: pointer; color: #f8fafc;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.30) 0%, rgba(99, 102, 241, 0.16) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px -10px rgba(124, 58, 237, 0.55);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
[data-screen] .sys-scan-cta:active { transform: scale(0.985); }
[data-screen] .sys-scan-cta:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
[data-screen] .sys-scan-cta-icon {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  color: #ffffff; background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); box-shadow: 0 6px 16px -4px rgba(124, 58, 237, 0.6);
}
[data-screen] .sys-scan-cta-icon .material-symbols-outlined, [data-screen] .sys-scan-cta-icon svg { font-size: 24px; width: 24px; height: 24px; }
[data-screen] .sys-scan-cta-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
[data-screen] .sys-scan-cta-title { font-size: 16px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; color: #ffffff; }
[data-screen] .sys-scan-cta-sub { font-size: 13px; line-height: 1.4; color: #c4b5fd; }
[data-screen] .sys-scan-cta-arrow { flex-shrink: 0; color: #c4b5fd; font-size: 22px; }
[data-screen] .sys-scan-entry-note {
  margin: 0; padding: 8px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 600; line-height: 1.4;
  color: #a7f3d0; background: rgba(16, 185, 129, 0.10); border: 1px solid rgba(16, 185, 129, 0.28);
}

/* ---- the sheet ---- */
[data-screen] .sys-scan-layer { position: fixed; inset: 0; z-index: 58; display: flex; flex-direction: column; justify-content: flex-end; }
[data-screen] .sys-scan-scrim { position: absolute; inset: 0; background: rgba(4, 6, 12, 0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: sys-scan-fade 200ms ease both; }
[data-screen] .sys-scan-sheet {
  position: relative; width: 100%; max-width: var(--app-col, 480px); margin: 0 auto; max-height: min(92dvh, 92vh);
  display: flex; flex-direction: column; color: #e2e8f0;
  background: linear-gradient(180deg, rgba(22, 20, 38, 0.98) 0%, rgba(12, 14, 22, 0.98) 100%);
  border: 1px solid rgba(168, 85, 247, 0.22); border-bottom: 0; border-radius: 28px 28px 0 0;
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.55); animation: sys-scan-rise 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes sys-scan-rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sys-scan-fade { from { opacity: 0; } to { opacity: 1; } }
[data-screen] .sys-scan-head { padding: 10px 18px 6px; flex-shrink: 0; }
[data-screen] .sys-scan-grip { display: block; width: 38px; height: 4px; border-radius: 9999px; margin: 0 auto 10px; background: rgba(148, 163, 184, 0.45); }
[data-screen] .sys-scan-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
[data-screen] .sys-scan-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 800; line-height: 1.25; color: #ffffff; }
[data-screen] .sys-scan-title .material-symbols-outlined, [data-screen] .sys-scan-title svg { color: #a78bfa; font-size: 22px; width: 22px; height: 22px; }
[data-screen] .sys-scan-x {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: #cbd5e1; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.10);
}
[data-screen] .sys-scan-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 18px 14px; }
[data-screen] .sys-scan-step { display: flex; flex-direction: column; gap: 14px; }
[data-screen] .sys-scan-lead { margin: 0; font-size: 14px; line-height: 1.5; color: #cbd5e1; }

[data-screen] .sys-scan-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
[data-screen] .sys-scan-pick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 14px 10px;
  border-radius: 18px; cursor: pointer; font-size: 14.5px; font-weight: 700; color: #f5f3ff;
  background: rgba(124, 58, 237, 0.16); border: 1px dashed rgba(167, 139, 250, 0.55); transition: transform 140ms ease, background 140ms ease;
}
[data-screen] .sys-scan-pick .material-symbols-outlined, [data-screen] .sys-scan-pick svg { font-size: 30px; width: 30px; height: 30px; color: #c4b5fd; }
[data-screen] .sys-scan-pick:active { transform: scale(0.97); }
[data-screen] .sys-scan-pick:disabled { opacity: 0.45; cursor: default; }
[data-screen] .sys-scan-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }

[data-screen] .sys-scan-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
[data-screen] .sys-scan-thumbs:empty { display: none; }
[data-screen] .sys-scan-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); }
[data-screen] .sys-scan-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
[data-screen] .sys-scan-thumb-x {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: #ffffff; background: rgba(8, 10, 18, 0.72); border: 1px solid rgba(255, 255, 255, 0.25);
}
[data-screen] .sys-scan-thumb-x .material-symbols-outlined, [data-screen] .sys-scan-thumb-x svg { font-size: 18px; width: 18px; height: 18px; }
[data-screen] .sys-scan-count { margin: 0; font-size: 13px; line-height: 1.4; color: #94a3b8; }
[data-screen] .sys-scan-privacy, [data-screen] .sys-scan-honest {
  display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 14px; font-size: 12.5px; line-height: 1.45;
  color: #cbd5e1; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(148, 163, 184, 0.16);
}
[data-screen] .sys-scan-privacy .material-symbols-outlined, [data-screen] .sys-scan-privacy svg,
[data-screen] .sys-scan-honest .material-symbols-outlined, [data-screen] .sys-scan-honest svg { flex-shrink: 0; font-size: 16px; width: 16px; height: 16px; color: #34d399; margin-top: 1px; }
[data-screen] .sys-scan-honest .material-symbols-outlined, [data-screen] .sys-scan-honest svg { color: #a78bfa; }

/* the wait, and what went wrong */
[data-screen] .sys-scan-wait { align-items: center; text-align: center; padding: 34px 8px 26px; gap: 8px; }
[data-screen] .sys-scan-spinner {
  width: 54px; height: 54px; border-radius: 9999px; margin-bottom: 8px;
  border: 4px solid rgba(167, 139, 250, 0.22); border-top-color: #a78bfa; animation: sys-scan-spin 900ms linear infinite;
}
@keyframes sys-scan-spin { to { transform: rotate(360deg); } }
[data-screen] .sys-scan-wait-title { margin: 0; font-size: 16px; font-weight: 800; color: #ffffff; }
[data-screen] .sys-scan-wait-sub { margin: 0; font-size: 13.5px; line-height: 1.45; color: #94a3b8; max-width: 300px; }
[data-screen] .sys-scan-err-ic { font-size: 40px; width: 40px; height: 40px; color: #fbbf24; margin-bottom: 4px; }

/* the summary card */
[data-screen] .sys-scan-note { margin: 0; padding: 10px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; color: #ddd6fe; background: rgba(124, 58, 237, 0.12); border: 1px solid rgba(167, 139, 250, 0.28); }
[data-screen] .sys-scan-list { display: flex; flex-direction: column; gap: 8px; }
[data-screen] .sys-scan-list:empty { display: none; }
[data-screen] .sys-scan-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 16px;
  background: rgba(20, 24, 38, 0.78); border: 1px solid rgba(168, 85, 247, 0.16);
}
[data-screen] .sys-scan-row[data-new] { animation: sys-scan-fade 220ms ease both; }
[data-screen] .sys-scan-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
[data-screen] .sys-scan-row-name { font-size: 14.5px; font-weight: 700; line-height: 1.3; color: #f8fafc; overflow-wrap: anywhere; }
[data-screen] .sys-scan-row-sub { font-size: 12px; color: #94a3b8; font-variant-numeric: tabular-nums; }
/* a compact stepper in a row: G1's W15 stepper keeps its 40 px buttons, its 72 px value box is too wide for a list */
:is(#screen-outlet, #overlay-outlet) [data-screen] .sys-scan-row .sys-move-stepper { gap: 4px; padding: 3px; }
:is(#screen-outlet, #overlay-outlet) [data-screen] .sys-scan-row .sys-w15-num { min-width: 34px; height: 36px; padding: 0 2px; }
[data-screen] .sys-scan-row-x {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: #fca5a5; background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.22);
}
[data-screen] .sys-scan-row-x .material-symbols-outlined, [data-screen] .sys-scan-row-x svg { font-size: 18px; width: 18px; height: 18px; }
[data-screen] .sys-scan-add-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: flex-start; min-height: 40px; padding: 8px 14px;
  border-radius: 9999px; cursor: pointer; font-size: 13.5px; font-weight: 700; color: #c4b5fd; background: transparent; border: 1px dashed rgba(167, 139, 250, 0.55);
}
[data-screen] .sys-scan-add-btn .material-symbols-outlined, [data-screen] .sys-scan-add-btn svg { font-size: 18px; width: 18px; height: 18px; }
[data-screen] .sys-scan-add { padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(148, 163, 184, 0.14); }

[data-screen] .sys-scan-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, 0.16); }
[data-screen] .sys-scan-sum-lbl { font-size: 13.5px; font-weight: 600; color: #cbd5e1; }
[data-screen] .sys-scan-sum-val { font-size: 22px; font-weight: 800; color: #ffffff; font-variant-numeric: tabular-nums; }
[data-screen] .sys-scan-sum-sub { margin: -8px 0 0; font-size: 12.5px; color: #94a3b8; }
[data-screen] .sys-scan-suggest { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: rgba(20, 24, 38, 0.78); border: 1px solid rgba(168, 85, 247, 0.16); }
[data-screen] .sys-scan-suggest-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
[data-screen] .sys-scan-badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 9999px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fde68a; background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.34);
}
[data-screen] .sys-scan-vehicle { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border-radius: 14px; padding: 8px 12px; }
[data-screen] .sys-scan-vehicle-name { font-size: 13.5px; font-weight: 700; }
[data-screen] .sys-scan-vehicle-cap { font-size: 11.5px; font-weight: 500; opacity: 0.8; font-variant-numeric: tabular-nums; }
[data-screen] .sys-scan-movers-lbl { font-size: 14px; font-weight: 600; color: #e2e8f0; }
[data-screen] .sys-scan-why { margin: 0; font-size: 12.5px; line-height: 1.45; color: #94a3b8; }

[data-screen] .sys-scan-foot {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(148, 163, 184, 0.14); background: rgba(10, 12, 20, 0.92);
}
[data-screen] .sys-scan-foot > button:disabled { opacity: 0.5; cursor: default; }
[data-screen] .sys-scan-secondary {
  min-height: 46px; width: 100%; border-radius: 9999px; cursor: pointer; font-size: 14.5px; font-weight: 700;
  color: #c4b5fd; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(167, 139, 250, 0.35);
}

/* calm: no rise, no spin (the phone's reduced motion, and the app's own «Lugn» class) */
@media (prefers-reduced-motion: reduce) {
  [data-screen] .sys-scan-sheet, [data-screen] .sys-scan-scrim, [data-screen] .sys-scan-row[data-new] { animation: none; }
  [data-screen] .sys-scan-spinner { animation-duration: 2400ms; }
}
html.a11y-calm [data-screen] .sys-scan-sheet, html.a11y-calm [data-screen] .sys-scan-scrim, html.a11y-calm [data-screen] .sys-scan-row[data-new] { animation: none; }

/* ---- light ---- */
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-cta {
  color: #1e1b4b; background: linear-gradient(135deg, rgba(124, 58, 237, 0.10) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: rgba(124, 58, 237, 0.35); box-shadow: 0 8px 22px -12px rgba(124, 58, 237, 0.45);
}
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-cta-title { color: #1e1b4b; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-cta-sub { color: #4c1d95; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-cta-arrow { color: #6d28d9; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-cta:focus-visible { outline-color: #6d28d9; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-entry-note { color: #047857; background: rgba(16, 185, 129, 0.10); border-color: rgba(5, 150, 105, 0.30); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-scrim { background: rgba(15, 23, 42, 0.38); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-sheet {
  color: #334155; background: #ffffff; border-color: rgba(15, 23, 42, 0.08); box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.18);
}
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-grip { background: rgba(15, 23, 42, 0.18); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] :is(.sys-scan-title, .sys-scan-wait-title, .sys-scan-sum-val, .sys-scan-row-name) { color: #0f172a; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-title :is(.material-symbols-outlined, svg) { color: #6d28d9; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-x { color: #334155; background: #f1f5f9; border-color: rgba(15, 23, 42, 0.10); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] :is(.sys-scan-lead, .sys-scan-sum-lbl, .sys-scan-movers-lbl) { color: #334155; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] :is(.sys-scan-count, .sys-scan-wait-sub, .sys-scan-row-sub, .sys-scan-sum-sub, .sys-scan-why) { color: #475569; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-pick { color: #3b0764; background: rgba(124, 58, 237, 0.06); border-color: rgba(124, 58, 237, 0.40); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-pick :is(.material-symbols-outlined, svg) { color: #6d28d9; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-thumb { background: #f1f5f9; border-color: rgba(15, 23, 42, 0.10); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] :is(.sys-scan-privacy, .sys-scan-honest) { color: #334155; background: #f8fafc; border-color: rgba(15, 23, 42, 0.10); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-privacy :is(.material-symbols-outlined, svg) { color: #059669; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-honest :is(.material-symbols-outlined, svg) { color: #6d28d9; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-spinner { border-color: rgba(124, 58, 237, 0.18); border-top-color: #7c3aed; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-err-ic { color: #b45309; }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-note { color: #4c1d95; background: rgba(124, 58, 237, 0.07); border-color: rgba(124, 58, 237, 0.24); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] :is(.sys-scan-row, .sys-scan-suggest) { background: #f8fafc; border-color: rgba(15, 23, 42, 0.10); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-row-x { color: #b91c1c; background: rgba(239, 68, 68, 0.06); border-color: rgba(220, 38, 38, 0.22); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-add-btn { color: #6d28d9; border-color: rgba(124, 58, 237, 0.45); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-add { background: #f8fafc; border-color: rgba(15, 23, 42, 0.10); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-sum { border-top-color: rgba(15, 23, 42, 0.10); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-badge { color: #92400e; background: rgba(245, 158, 11, 0.12); border-color: rgba(217, 119, 6, 0.34); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-foot { background: rgba(255, 255, 255, 0.96); border-top-color: rgba(15, 23, 42, 0.08); }
:is(html[data-theme="light"], html[data-apple-theme="light"]) [data-screen] .sys-scan-secondary { color: #6d28d9; background: #ffffff; border-color: rgba(124, 58, 237, 0.35); }
