@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0f14;
  --surface: #151b23;
  --surface-2: #1c2430;
  --border: #232b36;
  --text: #f2f5f8;
  --text-muted: #8b97a6;
  --accent: #ffb020;
  --accent-hover: #f59e0b;
  --accent-text: #0b0f14;
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.14);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.16);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

button,
input {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.mono-text,
.mono-input {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---- Update Banner ---- */
.update-banner {
  width: 100%;
  min-height: 48px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 15px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  text-align: center;
  cursor: pointer;
  z-index: 60;
}

/* ---- Top Bar ---- */
.app-header {
  flex: 0 0 auto;
  z-index: 30;
  background: rgba(11, 15, 20, 0.96);
  border-bottom: 1px solid var(--border);
  padding: calc(10px + var(--safe-top)) 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.staff-pill {
  font-size: 15px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.pill-offline {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #fde68a;
}

.pill-pending {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

.pill-sync-btn {
  border: none;
  background: rgba(11, 15, 20, 0.16);
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* ---- Main App Area & Transitions ---- */
.app-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: screenIn 200ms ease-out;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-centered {
  justify-content: center;
  padding: 18px 16px calc(20px + var(--safe-bottom));
}

.screen-with-footer {
  justify-content: space-between;
}

.screen-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.field-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: transform 90ms ease, background-color 150ms ease, opacity 150ms ease;
}

.btn:active:not(:disabled),
.btn-circle:active:not(:disabled),
.shutter-btn:active:not(:disabled),
.platform-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:disabled {
  background: #473311;
  color: #8b7b5b;
  opacity: 1;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: var(--error);
  color: #ffffff;
}

.btn-sm-secondary {
  min-height: 50px;
  font-size: 15px;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.btn-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(21, 27, 35, 0.92);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 90ms ease, background-color 150ms ease, border-color 150ms ease;
}

.btn-circle-muted {
  background: var(--surface);
  border-color: var(--border);
}

.btn-torch.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.bottom-action-bar {
  flex: 0 0 auto;
  padding: 10px 14px calc(14px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(11, 15, 20, 0) 0%, var(--bg) 22%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.alert-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #fde68a;
}

.alert-danger {
  background: var(--error-bg);
  border-color: var(--error);
  color: #fecaca;
}

/* ---- Screen 8: Not Set Up ---- */
.setup-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 24px 18px;
}

.setup-app-icon {
  border-radius: 18px;
  border: 1px solid var(--border);
}

.setup-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.setup-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.setup-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

/* ---- Inputs ---- */
.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.text-input {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
}

.clear-input-btn {
  min-width: 56px;
  min-height: 56px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

/* ---- Screen 2: Full-Screen Scan ---- */
.screen-scan {
  position: relative;
}

.scan-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 360px;
  background: #05070a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.scanner-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #05070a;
}

.scanner-viewport video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

#qr-shaded-region {
  display: none !important;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 96px;
  pointer-events: none;
}

.scan-viewfinder {
  position: relative;
  width: min(88vw, 390px);
  height: 148px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 9999px rgba(11, 15, 20, 0.72);
  transition: box-shadow 160ms ease, background-color 160ms ease;
}

.vf-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 4px solid var(--accent);
  transition: border-color 150ms ease;
}

.vf-tl {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: var(--radius);
}

.vf-tr {
  top: -2px;
  right: -2px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: var(--radius);
}

.vf-bl {
  bottom: -2px;
  left: -2px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: var(--radius);
}

.vf-br {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: var(--radius);
}

.vf-scan-line {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 16px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 10px var(--accent);
  animation: scanLine 2.4s ease-in-out infinite;
}

@keyframes scanLine {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.75;
  }
  50% {
    transform: translateY(114px);
    opacity: 1;
  }
}

.scan-viewfinder.scan-flash {
  background: rgba(34, 197, 94, 0.28);
}

.scan-viewfinder.scan-flash .vf-corner {
  border-color: var(--success);
}

.scan-viewfinder.scan-flash .vf-scan-line {
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
}

.scan-hint {
  position: relative;
  z-index: 2;
  margin: 18px 0 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(21, 27, 35, 0.88);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.scan-hint.scan-hint-alert {
  border-color: var(--accent);
  color: var(--accent);
}

.scanner-status {
  position: relative;
  z-index: 2;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
}

.scan-bottom-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px calc(16px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent 0%, rgba(11, 15, 20, 0.94) 36%);
}

.scan-bottom-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-manual-trigger {
  width: auto;
  flex: 1 1 auto;
  max-width: 220px;
}

/* ---- Manual Entry Bottom Sheet ---- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.65);
}

.manual-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  padding: 16px 16px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sheetUp 200ms ease-out;
}

@keyframes sheetUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.btn-icon-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.hashtag-preview {
  font-size: 15px;
  color: var(--text-muted);
}

.hashtag-preview strong {
  color: var(--accent);
  font-family: var(--font-mono);
}

.raw-scan-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  word-break: break-all;
}

/* ---- Screen 3: Confirm ---- */
.confirm-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.confirm-tracking-block {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.confirm-tracking-value {
  font-family: var(--font-mono);
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  word-break: break-all;
}

.confirm-raw-value {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  word-break: break-all;
}

.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.platform-status {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.platform-btn {
  min-height: 56px;
  padding: 12px 10px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: #ffffff;
  opacity: 0.45;
  transition: transform 90ms ease, opacity 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.platform-btn.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--text);
}

.chip-shopee {
  background: #ee4d2d;
}

.chip-lazada {
  background: #1a3bd8;
}

.chip-tiktok {
  background: #111111;
  border-color: #25f4ee;
  box-shadow: inset 0 0 0 1px #fe2c55;
}

.chip-tiktok.active {
  box-shadow: inset 0 0 0 1px #fe2c55, 0 0 0 2px #25f4ee;
}

.chip-unknown {
  background: #4b5563;
}

/* ---- Screen 4: Capture ---- */
.capture-body {
  gap: 10px;
  padding-top: 10px;
}

.capture-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-back-pill {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.capture-order-pill {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
}

.mode-tab {
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.mode-tab.active {
  background: var(--accent);
  color: var(--accent-text);
}

.capture-camera-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 38dvh;
  border-radius: var(--radius);
  overflow: hidden;
  background: #05070a;
  border: 1px solid var(--border);
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(11, 15, 20, 0.85);
  font-weight: 700;
  font-size: 15px;
}

.rec-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--error);
  margin-right: 6px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--error);
  width: 0%;
  transition: width 250ms linear;
}

/* 5 Photo Slots Row */
.slots-panel {
  width: 100%;
}

.photo-slots-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.photo-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

.photo-slot.retaking {
  border: 2px solid var(--accent);
}

.photo-slot-empty {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 2px dashed var(--border);
  background: rgba(21, 27, 35, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 15px;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.slot-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(11, 15, 20, 0.88);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.capture-bottom-bar {
  gap: 10px;
}

.shutter-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.shutter-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shutter-side-left {
  justify-content: flex-start;
}

.shutter-side-right {
  justify-content: flex-end;
}

.shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--text);
  background: transparent;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 90ms ease, opacity 150ms ease;
}

.shutter-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
}

.photo-count-pill {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
}

.video-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-preview-card {
  padding: 12px;
}

.video-preview-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-preview-box video {
  width: 100%;
  max-height: 220px;
  border-radius: 12px;
  background: #05070a;
}

/* ---- Screen 5: Sending ---- */
.sending-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 32px 20px;
}

.sending-pulse-icon {
  font-size: 44px;
  line-height: 1;
}

.sending-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
}

.sending-sub {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
}

.sending-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.sending-progress-bar {
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: indeterminateSlide 1.2s ease-in-out infinite;
}

@keyframes indeterminateSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(260%);
  }
}

/* ---- Screen 6 & 7: Result ---- */
.result-body {
  justify-content: center;
}

.result-card {
  text-align: center;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.result-card.success {
  background: var(--success-bg);
  border-color: var(--success);
}

.result-card.error {
  background: var(--error-bg);
  border-color: var(--error);
}

.result-card.queued {
  background: var(--warning-bg);
  border-color: var(--warning);
}

.result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  line-height: 1;
}

.checkmark-circle {
  stroke: var(--success);
  stroke-width: 3;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: strokeDraw 400ms ease-out forwards;
}

.checkmark-path {
  stroke: var(--success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeDraw 300ms 180ms ease-out forwards;
}

@keyframes strokeDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.result-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.result-tracking {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.result-platform-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.result-detail {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.result-auto-note {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

/* ---- Small Phone Tweaks (360x640) ---- */
@media (max-height: 680px) {
  .scan-viewfinder {
    height: 124px;
  }
  @keyframes scanLine {
    0%, 100% {
      transform: translateY(0);
      opacity: 0.75;
    }
    50% {
      transform: translateY(90px);
      opacity: 1;
    }
  }
  .camera-stage {
    max-height: 31dvh;
  }
  .shutter-btn {
    width: 64px;
    height: 64px;
  }
  .btn {
    min-height: 56px;
  }
}

@media (max-width: 380px) {
  .btn-back-pill {
    padding: 6px 10px;
  }
  .capture-order-pill {
    font-size: 15px;
    padding: 6px 10px;
    letter-spacing: 0;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
