:root {
  --navy: #1a4f95;
  --navy-dark: #001b3e;
  --page: #f2f7ff;
  --card: #ffffff;
  --ink: #2d3133;
  --muted: #74787a;
  --line: #dee3eb;
  --soft-blue: #d6e3ff;
  --danger: #c63737;
  --danger-soft: #fff5f5;
  --success: #2d944b;
  color: var(--ink);
  background: #e7ebf0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  line-height: 1.5;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
.hidden, .step-screen:not(.active) { display: none !important; }
.material-symbols-rounded { font-size: 21px; line-height: 1; }

.app-shell {
  position: relative;
  width: 100%;
  max-width: 390px;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--page);
  box-shadow: 0 0 34px rgba(16, 35, 63, .13);
}

.loading-screen { display: grid; min-height: 100svh; place-content: center; justify-items: center; color: var(--muted); font-size: 14px; }
.loading-spinner { width: 28px; height: 28px; border: 3px solid #dce5ee; border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.step-screen { min-height: 100svh; background: var(--page); }
.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 52px;
  padding: max(4px, env(safe-area-inset-top)) 10px 4px;
  border-bottom: 1px solid rgba(225, 230, 236, .72);
  background: rgba(242, 247, 255, .96);
  text-align: center;
  backdrop-filter: blur(12px);
}
.topbar strong { font-family: "Plus Jakarta Sans", "Noto Sans SC", sans-serif; font-size: 14px; font-weight: 800; }
.topbar-spacer { width: 44px; }
.topbar-leading { display: grid; width: 44px; height: 44px; color: var(--navy); font-size: 21px; place-items: center; }
.icon-button { display: grid; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--navy); place-items: center; }
.icon-button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(53, 121, 185, .28); outline-offset: 2px; }
.count-text { color: #283649; font-size: 12px; font-weight: 600; white-space: nowrap; }

.screen-content { padding: 18px 16px calc(104px + env(safe-area-inset-bottom)); }
h1 { margin: 12px 0 10px; color: var(--navy-dark); font-family: "Plus Jakarta Sans", "Noto Sans SC", sans-serif; font-size: 25px; font-weight: 800; line-height: 1.25; letter-spacing: -.5px; }
h2 { margin: 0; font-size: 18px; }
p { margin: 0; }
.lead { color: #3e4959; font-size: 13px; line-height: 1.65; }
.card { border: 1px solid #e8ebef; border-radius: 10px; background: var(--card); box-shadow: 0 2px 8px rgba(25, 56, 87, .045); }

.notice-content { padding-top: 16px; }
.notice-mark-row { display: flex; align-items: center; gap: 10px; }
.notice-mark-row > span { height: 1px; flex: 1; background: var(--line); }
.notice-mark { display: grid; width: 40px; height: 40px; border-radius: 9px; background: var(--navy); color: #fff; place-items: center; }
.notice-mark .material-symbols-rounded { font-size: 24px; }
.notice-card { padding: 16px; }
.notice-card > p:first-child { color: #303b49; font-size: 14px; line-height: 1.7; white-space: pre-line; }
.alert-line { display: flex; align-items: center; gap: 6px; margin-top: 13px; color: var(--danger); font-size: 12px; }
.alert-line .material-symbols-rounded { font-size: 17px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 0 10px; }
.section-heading span { color: #7c8693; font-size: 11px; }
.range-list { display: grid; gap: 10px; }
.range-card { overflow: hidden; padding: 10px; }
.range-card img { display: block; width: 100%; height: 190px; border-radius: 7px; background: #eef1f3; object-fit: contain; }
.range-card > div { padding: 11px 3px 4px; }
.range-card b { color: var(--navy-dark); font-size: 14px; }
.range-card p { margin-top: 6px; color: #455265; font-size: 11px; }
.process-title { margin: 25px 0 10px; }
.process-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.process-list li { display: flex; gap: 12px; align-items: flex-start; padding: 13px; border-radius: 10px; background: #fff; }
.process-list li > span { display: grid; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--soft-blue); color: var(--navy); font-size: 12px; font-weight: 800; place-items: center; }
.process-list b { font-size: 14px; }
.process-list p { margin-top: 3px; color: var(--muted); font-size: 12px; }

.info-banner { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; padding: 12px; border: 1px solid #dbe8f6; border-radius: 9px; background: #eaf2fa; color: #2d567a; font-size: 12px; }
.info-banner .material-symbols-rounded { flex: 0 0 auto; margin-top: 1px; font-size: 17px; }
.product { margin-bottom: 12px; padding: 14px; border: 1px solid #e4e8ed; border-radius: 10px; background: #fff; }
.product.invalid-product { border-color: var(--danger); background: #fffefe; }
.product-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.product-head b { font-size: 14px; }
.status-chip { padding: 3px 8px; border-radius: 999px; background: #edf2f7; color: #617083; font-size: 10px; font-weight: 700; }
.status-chip.verified { background: #e7f0fb; color: var(--navy); }
.status-chip.invalid { background: #fde9e9; color: var(--danger); }
.remove-product { padding: 4px 6px; border: 0; background: transparent; color: #7a8490; font-size: 12px; }
.product-body { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; }
.product-photo { position: relative; display: grid; width: 92px; height: 92px; overflow: hidden; border: 1px dashed #b9c3ce; border-radius: 8px; background: #f7f8f9; color: var(--navy); place-items: center; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-photo input, .upload-tile input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.product-photo .material-symbols-rounded { font-size: 30px; }
.product-fields label { display: block; color: #3a4552; font-size: 11px; }
.product-fields input { margin-top: 5px; }
.status-message { min-height: 18px; margin-top: 10px; font-size: 11px; font-weight: 600; }
.status-message.verified { color: var(--success); }
.status-message.invalid { color: var(--danger); }
.status-message.pending { color: var(--muted); }
.validate-button { width: 100%; min-height: 36px; margin-top: 8px; border: 1px solid var(--navy); border-radius: 7px; background: #fff; color: var(--navy); font-size: 12px; font-weight: 700; }
.add-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; gap: 5px; border: 1px dashed #b8c3cf; border-radius: 9px; background: transparent; color: var(--navy); font-weight: 700; }
.bottom-hint { margin-top: 10px; color: #7f8791; text-align: center; font-size: 10px; }

.upload-section { margin-top: 14px; padding: 13px; }
.upload-heading b { font-size: 14px; }
.upload-heading p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.required-mark, .optional-mark { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 999px; font-size: 9px; vertical-align: 2px; }
.required-mark { background: #fde9e9; color: var(--danger); }
.optional-mark { background: #edf1f5; color: #657383; }
.upload-tile { position: relative; display: flex; min-height: 122px; margin-top: 12px; border: 1px dashed #b7c2ce; border-radius: 8px; background: #fbfcfd; color: var(--navy); align-items: center; flex-direction: column; justify-content: center; }
.upload-tile .material-symbols-rounded { margin-bottom: 7px; font-size: 31px; }
.upload-tile b { font-size: 13px; }
.upload-tile small { margin-top: 5px; color: #7a8592; font-size: 10px; }
.upload-tile.compact { min-height: 82px; }
.upload-list { display: grid; gap: 7px; margin-top: 9px; }
.upload-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px; border-radius: 7px; background: #f2f5f8; font-size: 11px; }
.upload-preview { display: grid; width: 40px; height: 40px; overflow: hidden; border-radius: 5px; background: #e3e8ed; place-items: center; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remove-upload { padding: 7px; border: 0; background: transparent; color: var(--danger); font-size: 11px; }
.privacy-card { margin-top: 18px; padding: 19px; text-align: center; }
.privacy-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 9px; border-radius: 50%; background: #e6efff; color: var(--navy); place-items: center; }
.privacy-card h2 { font-size: 14px; }
.privacy-card p { margin-top: 5px; color: #536071; font-size: 10px; line-height: 1.6; }
.consent { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 22px; color: #596576; font-size: 11px; }
.consent input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }

.form-content { padding-top: 14px; }
.product-total { padding: 16px; border-radius: 10px; background: var(--navy); color: #fff; }
.product-total small { display: block; opacity: .82; font-size: 11px; }
.product-total strong { display: block; margin-top: 2px; font-size: 14px; }
.product-total strong span { margin-right: 2px; font-size: 28px; }
.product-total p { margin-top: 9px; font-size: 10px; opacity: .85; }
.product-total p span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #fff; }
.form-section-title { display: flex; align-items: center; gap: 6px; margin: 16px 2px 8px; font-size: 14px; }
.form-section-title .material-symbols-rounded { color: var(--navy); font-size: 17px; }
.form-card { padding: 13px; }
.form-card label { display: block; margin-bottom: 12px; color: #354252; font-size: 11px; }
.form-card label:last-child { margin-bottom: 0; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.wide { grid-column: 1 / -1; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; border: 1px solid transparent; border-radius: 7px; outline: 0; background: #f1f3f6; font-size: 14px; }
input, select { min-height: 43px; padding: 0 11px; }
textarea { min-height: 70px; padding: 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #7da8d0; background: #fff; }
.field-hint { margin: -6px 0 0; color: #7a8490; font-size: 9px; }
.amount-entry { padding: 14px; }
.amount-entry > div:first-child { display: flex; align-items: center; justify-content: space-between; color: #354252; font-size: 11px; }
.amount-entry > div:first-child span { padding: 3px 7px; border-radius: 4px; background: #eef1f4; font-size: 9px; }
.currency-input { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--navy); }
.currency-input b { color: var(--navy); font-size: 20px; }
.currency-input input { min-height: 52px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--navy); font-size: 24px; font-weight: 700; }
.amount-entry > p { margin-top: 8px; color: #7b8592; font-size: 9px; }

.confirm-content h1 { margin-top: 2px; }
.summary-card { margin-top: 14px; padding: 14px; }
.summary-card.accent { border-left: 3px solid var(--navy); }
.summary-title { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; color: var(--navy); font-size: 13px; }
.summary-title .material-symbols-rounded { font-size: 18px; }
.summary-products { display: flex; gap: 7px; flex-wrap: wrap; }
.summary-product { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px; border-radius: 7px; background: #f7f8fa; }
.summary-product img, .summary-product-placeholder { display: grid; width: 45px; height: 45px; border-radius: 5px; background: #e4e9ee; object-fit: cover; place-items: center; }
.summary-product b { display: block; font-size: 11px; }
.summary-product span { display: block; margin-top: 3px; color: #617083; font-size: 9px; }
.summary-evidence { display: flex; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf0f3; }
.summary-evidence img, .evidence-placeholder { display: grid; width: 62px; height: 46px; border-radius: 5px; background: #e8edf2; object-fit: cover; place-items: center; }
.summary-rows { display: grid; gap: 8px; font-size: 11px; }
.summary-row { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.summary-row span { color: #657181; }
.summary-row b { font-weight: 500; text-align: right; word-break: break-all; }
.summary-amount { color: var(--navy); font-size: 19px !important; font-weight: 800 !important; }
.info-banner.neutral { margin-top: 14px; border-color: #e4e9ef; background: #eef2f6; color: #5b6877; font-size: 10px; }

.success-content { text-align: center; }
.success-icon { display: grid; width: 72px; height: 72px; margin: 30px auto 15px; border: 12px solid #eaf6ec; border-radius: 50%; background: var(--success); color: #fff; place-items: center; }
.success-icon .material-symbols-rounded { font-size: 30px; font-weight: 700; }
.success-content > p { color: #485668; font-size: 12px; }
.success-summary { margin-top: 22px; padding: 15px; text-align: left; }
.success-summary > div:not(.status-panel) { display: flex; align-items: center; justify-content: space-between; min-height: 35px; font-size: 11px; }
.success-summary > div > span { color: #6d7886; }
.success-summary strong { color: var(--navy); font-size: 12px; }
.status-panel { display: flex; gap: 8px; margin-top: 7px; padding: 10px; border-left: 3px solid var(--navy); border-radius: 5px; background: #eaf1f8; color: #506073; font-size: 10px; }
.status-panel .material-symbols-rounded { color: var(--navy); font-size: 17px; }
.success-content > h2 { margin: 26px 0 8px; text-align: left; font-size: 12px; }
.link-row { display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; width: 100%; min-height: 55px; padding: 0 8px; border: 0; border-bottom: 1px solid #e4e8ed; background: transparent; text-align: left; }
.link-row > .material-symbols-rounded:first-child { display: grid; width: 28px; height: 28px; border-radius: 50%; background: #e9eef4; color: #647386; font-size: 16px; place-items: center; }
.link-row b { font-size: 12px; }

.lookup-content { padding-top: 38px; text-align: center; }
.lookup-mark { display: grid; width: 62px; height: 62px; margin: 0 auto 13px; border-radius: 50%; background: #e8f1fb; color: var(--navy); place-items: center; }
.lookup-mark .material-symbols-rounded { font-size: 32px; }
.lookup-content .form-card { margin-top: 22px; text-align: left; }
.progress-content { padding-top: 15px; }
.progress-card { padding: 15px; }
.amount-box { margin-bottom: 13px; padding: 14px; border-radius: 9px; background: #eaf1f8; line-height: 1.75; }
.amount-box > strong { display: block; color: var(--navy); font-size: 17px; word-break: break-all; }
.amount-box span { color: #566577; font-size: 11px; }
.timeline { margin: 20px 5px; padding-left: 17px; border-left: 2px solid #c5d6e8; }
.event { position: relative; margin: 0 0 19px; }
.event::before { position: absolute; top: 3px; left: -23px; width: 10px; height: 10px; border: 2px solid var(--navy); border-radius: 50%; background: #fff; content: ""; }
.event b, .event span { display: block; }
.event b { font-size: 12px; }
.event span { margin-top: 3px; color: #687687; font-size: 10px; }
.supplement-card { padding: 14px; }
.supplement-card p { margin: 4px 0 9px; color: #617083; font-size: 11px; }
.supplement-picker { position: relative; display: flex; min-height: 74px; border: 1px dashed #b7c2ce; border-radius: 8px; color: var(--navy); align-items: center; justify-content: center; }
.supplement-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.supplement-card .primary { margin-top: 9px; }
.link-proof { color: var(--navy); font-weight: 700; }
.lookup-empty { color: var(--muted); font-size: 12px; }

.fixed-action {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  width: min(100%, 390px);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(220, 226, 233, .9);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}
.primary, .secondary { display: flex; min-height: 50px; width: 100%; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 750; }
.primary { border: 0; background: var(--navy); color: #fff; }
.primary:disabled { background: #b6bbc4; color: #fff; cursor: not-allowed; }
.secondary { border: 1px solid var(--navy); background: #fff; color: var(--navy); }

#toast { position: fixed; z-index: 40; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; max-width: min(390px, calc(100vw - 32px)); padding: 10px 15px; transform: translate(-50%, 12px); border-radius: 999px; background: rgba(23, 35, 53, .94); color: #fff; font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 390px) {
  .app-shell { max-width: none; box-shadow: none; }
  .fixed-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
