:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #6f788a;
  --line: #e8ebf1;
  --surface: #fff;
  --background: #f6f7fa;
  --accent: #5568f4;
  --accent-dark: #3f52e6;
  --danger: #d94747;
  --success: #16a46b;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--background); }
button, input { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; }

.topbar {
  height: 64px; display: flex; align-items: center; gap: 11px; padding: 0 max(18px, env(safe-area-inset-left));
  background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.topbar strong, .topbar small { display: block; }
.topbar strong { font-size: 16px; }
.topbar small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-weight: 800; background: linear-gradient(145deg, #7280ff, #4659e8); box-shadow: 0 7px 16px rgba(73,89,228,.22); }

.shell { width: min(100%, 720px); margin: 0 auto; padding: 26px 16px calc(30px + env(safe-area-inset-bottom)); }
.intro { padding: 3px 3px 20px; }
.intro h1, .state-card h1 { margin: 7px 0 7px; font-size: clamp(25px, 7vw, 34px); line-height: 1.2; letter-spacing: -.5px; }
.intro p, .state-card p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.card { background: var(--surface); border: 1px solid rgba(221,225,234,.85); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(30,41,67,.055); }

.picker-card { padding: 9px; }
.picker { min-height: 76px; display: flex; align-items: center; justify-content: center; gap: 13px; border: 1px dashed #c9cfdd; border-radius: 13px; cursor: pointer; background: #fafbff; }
.picker:active { background: #f2f4ff; }
.picker strong, .picker small { display: block; }
.picker strong { font-size: 15px; }
.picker small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.plus { color: var(--accent); font-size: 29px; font-weight: 300; line-height: 1; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 25px 2px 11px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.text-button { border: 0; padding: 7px 3px; color: var(--muted); background: transparent; font-size: 13px; cursor: pointer; }
.thumbnail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.thumb { position: relative; min-width: 0; overflow: hidden; border-radius: 10px; background: #e9ebf0; aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.thumb-name { position: absolute; right: 0; bottom: 0; left: 0; padding: 15px 5px 4px; overflow: hidden; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.58)); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.delete-photo { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(19,24,36,.68); font-size: 14px; cursor: pointer; }
.delete-photo:disabled { opacity: .4; }
.progress-track { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: rgba(255,255,255,.45); }
.progress-bar { width: 0; height: 100%; background: #62efad; transition: width .12s linear; }
.thumb-status { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(14,19,31,.34); font-size: 11px; font-weight: 700; }
.thumb.done .thumb-status { background: rgba(11,117,73,.32); }
.thumb.failed .thumb-status { background: rgba(167,31,31,.45); }

.phone-card { margin-top: 22px; padding: 18px; }
.phone-card label { display: block; font-size: 15px; font-weight: 750; }
.phone-card label span { color: var(--danger); font-size: 12px; }
.phone-card p { margin: 7px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.phone-card input { width: 100%; height: 49px; padding: 0 14px; border: 1px solid #d9deea; border-radius: 12px; outline: none; color: var(--ink); background: #fbfcfe; font-size: 16px; }
.phone-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(85,104,244,.11); }
.phone-card input.invalid { border-color: var(--danger); }
.field-error { min-height: 18px; padding-top: 5px; color: var(--danger); font-size: 11px; }

.button { min-height: 49px; display: inline-flex; align-items: center; justify-content: center; padding: 0 22px; border: 0; border-radius: 13px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { color: #fff; background: var(--accent); box-shadow: 0 8px 20px rgba(85,104,244,.2); }
.button.primary:active { background: var(--accent-dark); }
.button.secondary { color: var(--accent); border: 1px solid #d8dcf9; background: #f5f6ff; }
.button:disabled { color: #9ca3b2; background: #e7e9ee; box-shadow: none; cursor: not-allowed; }
.sticky-action { width: 100%; margin-top: 12px; }
#retryButton, #verifyButton { width: 100%; }
.privacy { margin: 13px 16px 0; color: #9299a8; text-align: center; font-size: 11px; line-height: 1.55; }
.notice { margin-top: 12px; padding: 11px 13px; border-radius: 11px; color: #80620b; background: #fff8da; font-size: 12px; line-height: 1.5; }
.notice.danger { color: #a93535; background: #fff0f0; }

.state-card { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 24px; text-align: center; }
.state-card .button { margin-top: 24px; }
.state-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 22px; font-size: 30px; font-weight: 800; }
.success-icon { color: var(--success); background: #e8faf2; }
.error-icon { color: var(--danger); background: #ffeded; }
.waiting-icon { color: #7f66ca; background: #f1edff; font-size: 24px; }
.keep-link { margin-top: 24px; padding: 10px 14px; border-radius: 10px; color: #5e6780; background: #f4f5f8; font-size: 12px; }
.spinner { width: 30px; height: 30px; border: 3px solid #e1e4ec; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.delivery-heading { margin-top: 0; }
.delivery-heading h2 { margin-top: 5px; font-size: 24px; }
.button.compact { min-height: 42px; padding: 0 16px; font-size: 13px; }
.deliverables-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.deliverable { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.deliverable-preview { position: relative; aspect-ratio: 1; background: #e9ebf0; }
.deliverable-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.deliverable-footer { display: flex; align-items: center; gap: 6px; padding: 9px; }
.deliverable-name { min-width: 0; flex: 1; overflow: hidden; color: #555f73; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.download-one { flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; color: var(--accent); background: #f0f2ff; font-size: 11px; font-weight: 750; text-decoration: none; }
.toast { position: fixed; z-index: 20; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); left: 18px; max-width: 520px; margin: auto; padding: 12px 16px; border-radius: 11px; color: #fff; background: rgba(27,32,46,.93); text-align: center; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }

@media (min-width: 430px) {
  .thumbnail-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .deliverables-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 650px) {
  .shell { padding-top: 42px; }
  .thumbnail-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
  .phone-card { padding: 22px; }
}
@media (max-width: 350px) {
  .thumbnail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shell { padding-right: 12px; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
