@font-face {
  font-family: "Noto Sans VI";
  src: url("fonts/noto-sans-vi.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans VI";
  src: url("fonts/noto-sans-vi-bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif Display VI";
  src: url("fonts/noto-serif-display-vi-italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #dcebe6;
  --glow: #f8fff9;
  --bg: #effaf5;
  --surface: #fbfffc;
  --panel: #e1f0e9;
  --ink: #122a25;
  --muted: #47625a;
  --line: #cbded5;
  --accent: #006347;
  --on-accent: #fff;
  --selected: #cfeee0;
  --focus: #14785f;
  --error: #9c292e;
  --shadow: #20473838;
  --rail: #435961;
  --button-surface: linear-gradient(145deg, #fbfffd, #e6f5ef);
  --button-selected: linear-gradient(145deg, #dcfff1, #c5ebdf);
  --button-primary: linear-gradient(135deg, #006a53, #095965);
  --button-border: #bedad0;
  --button-active-border: #79bca8;
  --button-highlight: #ffffffa8;
  --button-shadow: #0b5a4d18;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #09111e;
  --glow: #1c3544;
  --bg: #0b1523;
  --surface: #101e2d;
  --panel: #182839;
  --ink: #f1f8f6;
  --muted: #b3c6c7;
  --line: #304456;
  --accent: #9cf0ce;
  --on-accent: #0b2c26;
  --selected: #203b41;
  --focus: #9cf0ce;
  --error: #ffabae;
  --shadow: #02050a8c;
  --rail: #506479;
  --button-surface: linear-gradient(145deg, #172a3b, #111e2d);
  --button-selected: linear-gradient(145deg, #234d52, #1d3444);
  --button-primary: linear-gradient(135deg, #a9f7d6, #70e0de);
  --button-border: #385366;
  --button-active-border: #619c9d;
  --button-highlight: #aef9e020;
  --button-shadow: #020b16a8;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 55% 42%, var(--glow), transparent 69%), var(--canvas); }
button, input { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible, [tabindex="-1"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button:disabled { cursor: default; opacity: .55; }
button svg { width: 20px; height: 20px; flex: none; vertical-align: middle; }
p { margin: 0; line-height: 1.5; }

.stage {
  --device-height: clamp(655px, calc(100dvh - 44px), 920px);
  --device-width: calc(var(--device-height) * 78 / 163.4);
  min-height: 100dvh;
  width: min(100%, 1120px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--device-width);
  gap: clamp(36px, 7vw, 110px);
  align-items: center;
  padding: 22px clamp(24px, 5vw, 84px);
}
.intro { padding-block: 18px; }
.intro, .catalog-feature { font-family: "Noto Sans VI", "Noto Sans", Arial, sans-serif; }
.brand { display: inline-flex; flex: none; }
.brand-wordmark { display: block; width: 173px; height: auto; }
.app-header .brand-wordmark { width: clamp(110px, 36cqw, 149px); }
.intro h1 { font-size: clamp(44px, 4.6vw, 68px); font-weight: 700; line-height: 1.09; letter-spacing: -.065em; margin: 34px 0 23px; }
.intro h1 em, .catalog-feature em { font-family: "Noto Serif Display VI", "Noto Serif", Georgia, serif; font-weight: 400; }
.intro h1 em { color: var(--accent); letter-spacing: -.06em; }
.intro p { font-size: 18px; max-width: 320px; color: var(--muted); }
.intro small { display: block; color: var(--muted); font-size: 13px; margin-top: 34px; }

.phone {
  position: relative;
  width: 100%;
  height: var(--device-height);
  background: var(--bg);
  border: 7px solid #121c26;
  border-radius: 49px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 2px var(--rail), 0 0 0 3px #192733, 0 22px 58px var(--shadow);
  isolation: isolate;
  container-type: inline-size;
}
.status { height: 43px; flex: none; display: flex; align-items: center; justify-content: space-between; padding-inline: 23px; font-size: 14px; }
.island { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); width: 29%; max-width: 122px; height: 25px; border-radius: 24px; background: #05090d; }
.status-icons svg { width: 49px; height: 16px; }
.app-header { height: 52px; flex: none; display: flex; align-items: center; gap: 9px; padding-inline: 15px; }
.header-title { font-weight: 760; font-size: 15px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--button-surface); border: 1px solid var(--button-border); flex: none; }
.theme-toggle { margin-left: auto; color: var(--accent); width: 38px; height: 40px; border: 0; background: transparent; }
.wallet-button + .theme-toggle { margin-left: 0; }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle:hover, .theme-toggle:focus-visible { background: var(--button-selected); }
.search-toggle { color: var(--accent); width: 37px; height: auto; min-height: 39px; flex: none; }
.search-toggle svg { width: 17px; height: 17px; }
.search-toggle:hover { background: var(--button-selected); }
.wallet-button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; margin-left: auto; padding: 0 7px; min-height: 34px; flex: none; border-radius: 9px; background: var(--button-selected); border: 1px solid var(--button-active-border); color: var(--accent); font-weight: 720; font-size: 10px; white-space: nowrap; }
.wallet-button svg { width: 11px; height: 11px; }

.screen { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.screen-content { padding: 10px 15px 18px; }
.screen h2 { font-size: clamp(21px, 2.6vw, 24px); line-height: 1.14; letter-spacing: -.04em; margin: 5px 0 6px; }
.screen p { color: var(--muted); font-size: 14px; }
.catalog-feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 106px;
  display: grid;
  align-content: center;
  padding: 12px 14px;
  border: 1px solid #477a71;
  border-radius: 15px;
  color: #f2fff9;
  background: #102a2d;
}
.catalog-feature::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #0d272b 8%, #102a2dee 41%, #102a2dbb 56%, #102a2d12 87%); }
.catalog-feature h2 { margin: 0 0 5px; font-size: clamp(19px, 4.6vw, 23px); font-weight: 700; line-height: 1.15; letter-spacing: -.038em; }
.catalog-feature em { color: #a8efd6; }
.catalog-feature p { color: #cae9df; font-size: 11px; }
.feature-art { position: absolute; inset: 0 0 0 auto; width: 58%; display: flex; z-index: -2; }
.feature-art img { width: 50%; height: 100%; object-fit: cover; object-position: center 36%; }
.feature-art img + img { object-position: center 34%; }
.lead { margin-bottom: 14px; }

.collection-row { display: flex; align-items: center; gap: 6px; margin: 10px -2px 4px; padding-left: 2px; }
.collections {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 3px 2px 6px;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
}
.collections::-webkit-scrollbar { display: none; }
@media (pointer: fine) {
  .collections, .collections .collection { cursor: grab; }
  .collections.is-dragging, .collections.is-dragging * { cursor: grabbing; }
}
.collection, .filter { min-height: 39px; border-radius: 9px; font-weight: 720; font-size: 12px; white-space: nowrap; }
.collection { min-height: 31px; flex: none; padding-inline: 7px; border-radius: 7px; font-size: 10px; background: var(--button-surface); border: 1px solid var(--button-border); }
.collection[aria-pressed="true"] { color: var(--accent); background: var(--button-selected); border-color: var(--button-active-border); box-shadow: inset 0 1px var(--button-highlight), 0 2px 5px var(--button-shadow); }
.collection.collection-hot { position: relative; cursor: pointer; padding-inline: 9px; color: #4d2103; border-color: #e8751b; background: linear-gradient(170deg,#fff2a1 3%,#ffcf53 39%,#ff8c25 82%,#ffaf39); box-shadow: inset 0 1px 1px #fffbd1, 0 2px 6px #bd5b1455; }
.collection.collection-hot svg { color: #c3261e; fill: #e63b26; filter: drop-shadow(0 1px 0 #fff1a1); }
.collection.collection-hot[aria-pressed="true"] { color: #421c03; border-color: #ad460d; box-shadow: inset 0 0 0 1px #fff0a8, 0 2px 7px #ba571e77; }
.collection svg, .filter svg { width: 13px; height: 13px; margin-right: 4px; }
.collection svg { width: 11px; height: 11px; margin-right: 3px; }
.collection:not(.collection-hot):not([aria-pressed="true"]) svg { color: var(--muted); }
.filter-row { display: flex; align-items: stretch; gap: 6px; margin: 0 0 10px; }
.filters { display: flex; flex: 1; min-width: 0; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.filter { min-height: 34px; flex: 1; color: var(--muted); background: transparent; border: 1px solid transparent; }
.filter[aria-pressed="true"] { background: var(--button-surface); border-color: var(--button-active-border); color: var(--accent); box-shadow: inset 0 1px var(--button-highlight); }

.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { display: flex; flex-direction: column; width: 100%; overflow: hidden; text-align: left; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.card-media { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; background: var(--panel); }
.picture { display: block; object-fit: cover; background: var(--panel); }
.card-media .picture { width: 100%; height: 100%; }
.card[data-hold-preview] { touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card[data-hold-preview] img, .template-loop { pointer-events: none; }
.template-loop { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.card-hold { position: absolute; bottom: 7px; left: 7px; padding: 3px 5px; background: #0a1419e3; color: #fff; border-radius: 6px; font-size: 9px; }
.video-hold { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; background: #05070880; backdrop-filter: blur(2px); color: #fff; pointer-events: none; }
.video-hold[hidden] { display: none; }
.video-hold-panel { position: relative; width: min(var(--preview-width), calc(100vw - 24px), calc((100dvh - 36px) * var(--media-aspect))); aspect-ratio: var(--media-aspect); overflow: hidden; border-radius: 18px; outline: 1px solid #fff5; box-shadow: 0 14px 50px #0009; background: #050708; }
.video-hold video { display: block; width: 100%; height: 100%; object-fit: contain; }
.video-hold-label, .video-hold-status { position: absolute; left: 50%; transform: translateX(-50%); padding: 6px 10px; background: #000b; border-radius: 8px; text-align: center; font-size: 13px; }
.video-hold-label { bottom: 9px; white-space: nowrap; }
.video-hold-status { top: 9px; }
.video-hold-status:empty { display: none; }
.card-type, .type { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 730; background: #0a1419e3; color: #fff; border-radius: 8px; padding: 5px 6px; }
.card-type { position: absolute; top: 7px; left: 7px; }
.card-type svg { width: 11px; height: 11px; }
.card-type-right { left: auto; right: 7px; padding: 3px 5px; font-size: 9px; font-weight: 630; }
.card-hot { position: absolute; top: 7px; left: 7px; display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #ffd2a48c; border-radius: 8px; background: linear-gradient(155deg,#774025eb,#2d1511f2); color: #ff6047; }
.card-hot svg { width: 15px; height: 15px; fill: #f33d29; filter: drop-shadow(0 0 3px #ff7d4d90); }
.card-credits { position: absolute; bottom: 7px; right: 7px; display: flex; align-items: center; gap: 3px; min-height: 19px; border: 1px solid #ffe18b55; border-radius: 6px; color: #fff2c5; background: #131916e8; padding: 2px 4px; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 700; }
.coin-face { width: 11px; height: 11px; display: inline-grid; place-items: center; border-radius: 50%; color: #6b3e11; background: linear-gradient(140deg,#fff1a6 12%,#e6a332 78%); box-shadow: inset 0 0 0 1px #ffe6a7; }
.coin-face svg { width: 10px; height: 10px; }
.card-copy { display: block; padding: 7px 8px 8px; min-height: 30px; font-size: 12px; font-weight: 400; line-height: 1.3; }

.app-footer { flex: none; background: var(--bg); border-top: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 5px 12px 1px; }
.tab { min-height: 54px; background: none; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 710; border-radius: 12px; }
.tab-icon { position: relative; width: 33px; height: 29px; border-radius: 10px; display: grid; place-items: center; }
.tab-icon svg { width: 18px; height: 18px; }
.tab[aria-current="page"] { color: var(--accent); background: var(--selected); }
.tab-guide { color: var(--ink); }
.tab-guide .tab-icon {
  width: 37px;
  height: 33px;
  margin-top: -4px;
  color: var(--on-accent);
  background: var(--button-primary);
  border: 1px solid var(--button-active-border);
  box-shadow: inset 0 1px var(--button-highlight), 0 4px 9px var(--button-shadow);
}
.tab-guide .tab-icon::after { content: ""; position: absolute; inset: 2px 4px auto; height: 36%; border-radius: 8px; background: linear-gradient(#ffffff40, #ffffff00); pointer-events: none; }
.tab-guide:active .tab-icon { transform: translateY(1px); }
.home-bar { width: 31%; max-width: 132px; height: 5px; border-radius: 99px; background: var(--ink); margin: 7px auto 8px; flex: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.search-field { display: flex; align-items: center; gap: 7px; min-height: 48px; padding: 0 7px 0 10px; margin: 12px 0; color: var(--accent); border: 1px solid var(--button-border); border-radius: 12px; background: var(--surface); }
.search-field:focus-within { border-color: var(--focus); }
.search-field > svg { width: 19px; height: 19px; flex: none; }
.search-field input { min-width: 0; width: 100%; border: 0; padding: 8px 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-field input:focus-visible { outline: none; }
.search-field input::-webkit-search-cancel-button { appearance: none; }
.search-clear { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 9px; background: var(--panel); color: var(--accent); }
.search-clear[hidden] { display: none; }
.screen .search-count { margin: 8px 0; font-size: 12px; }
.search-hint { padding: 6px 0; }
.guide-steps { display: grid; gap: 8px; margin: 12px 0 15px; padding: 0; list-style: none; }
.guide-steps li { display: flex; gap: 9px; align-items: flex-start; padding: 11px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.guide-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: none; border-radius: 9px; background: var(--selected); color: var(--accent); }
.guide-icon svg { width: 18px; height: 18px; }
.guide-steps h3 { margin: 0 0 3px; font-size: 14px; }
.guide-steps p { font-size: 13px; }

.actions { padding: 9px 15px 2px; display: grid; gap: 6px; }
.primary, .secondary, .link-button { min-height: 46px; border-radius: 13px; font-weight: 770; font-size: 15px; padding: 9px 10px; }
.primary { background: var(--button-primary); color: var(--on-accent); width: 100%; border: 1px solid var(--button-active-border); box-shadow: inset 0 1px var(--button-highlight), 0 3px 10px var(--button-shadow); }
.secondary { background: var(--button-surface); color: var(--ink); width: 100%; border: 1px solid var(--button-border); box-shadow: inset 0 1px var(--button-highlight); }
.primary:active:not(:disabled), .secondary:active, .wallet-button:active { transform: translateY(1px); }
.link-button { background: transparent; color: var(--accent); }
.actions .link-button { min-height: 40px; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; list-style: none; margin: 0 0 16px; padding: 0; font-size: 12px; font-weight: 720; color: var(--muted); text-align: center; }
.stepper li { min-width: 0; border-top: 3px solid var(--line); padding-top: 7px; }
.stepper .done, .stepper [aria-current] { border-color: var(--accent); color: var(--accent); }
.summary { display: flex; align-items: center; gap: 9px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; }
.summary .picture { width: 44px; height: 62px; border-radius: 8px; flex: none; }
.summary strong, .summary small { display: block; }
.summary strong { font-size: 14px; font-weight: 500; }
.summary small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.summary b { margin-left: auto; font-size: 13px; white-space: nowrap; }
.input-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 11px 0 0; }
.input-actions button { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; }
.recent-photos { margin-top: 13px; }
.recent-photos h3 { margin: 0 0 7px; font-size: 13px; }
.recent-photos p { font-size: 12px; }
.recent-photo-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.recent-photo { min-width: 0; aspect-ratio: 1; display: grid; padding: 2px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); }
.recent-photo img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 6px; }
.recent-photo[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.upload-preview { display: grid; place-items: center; min-height: 110px; max-height: 186px; overflow: hidden; border: 1px dashed var(--focus); background: var(--panel); border-radius: 15px; text-align: center; padding: 8px; }
.upload-preview img { height: 155px; max-width: 100%; object-fit: contain; border-radius: 9px; }
.upload-preview svg { width: 32px; height: 32px; color: var(--accent); }
.upload-preview span { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
.error { color: var(--error) !important; font-size: 14px; margin-top: 8px; }
.qr-box { display: grid; justify-items: center; text-align: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 11px; margin: 11px 0; }
.qr-box img { width: 133px; height: 133px; image-rendering: pixelated; border-radius: 6px; }
.qr-box strong { font-size: 21px; letter-spacing: -.045em; }
.qr-box small { color: var(--muted); font-size: 12px; }
.credit-breakdown { margin: 13px 0 10px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.credit-breakdown div { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; padding: 9px 0; font-size: 13px; }
.credit-breakdown div + div { border-top: 1px solid var(--line); }
.credit-breakdown dt { color: var(--muted); }
.credit-breakdown dd { margin: 0; font-weight: 750; white-space: nowrap; }
.wallet-balance { display: grid; gap: 5px; padding: 14px; margin: 12px 0; border-radius: 14px; background: var(--selected); color: var(--accent); font-size: 13px; }
.wallet-balance strong { font-size: 22px; letter-spacing: -.025em; }
.success-pill { display: inline-block; font-size: 12px; font-weight: 750; color: var(--accent); background: var(--selected); padding: 6px 9px; border-radius: 9px; }
.phone-field { display: block; font-weight: 750; margin-top: 15px; }
.phone-field input { display: block; margin-top: 7px; width: 100%; height: 49px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 12px; color: var(--ink); font-size: 17px; }
.phone-field input[aria-invalid="true"] { border-color: var(--error); }
.state-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 12px; margin-top: 12px; }
.state-panel h3 { font-size: 15px; margin: 0 0 5px; }
.state-panel p+p { margin-top: 4px; }
.state-icon { width: 48px; height: 48px; background: var(--selected); color: var(--accent); border-radius: 16px; display: grid; place-items: center; margin-bottom: 10px; }
.state-icon svg { width: 25px; height: 25px; }
.orders-list { display: grid; gap: 8px; margin-top: 14px; }
.order-button { background: none; padding: 0; text-align: left; border-radius: 14px; }
.order-button .summary { margin: 0; }
.order-status { margin-left: auto; color: var(--accent); font-size: 12px; text-align: right; white-space: nowrap; }
.empty { margin-top: 11px; padding: 23px 14px; background: var(--panel); border-radius: 16px; display: grid; justify-items: start; gap: 9px; }
.empty .primary { width: auto; }
.final-media { position: relative; width: min(100%, 164px); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 13px; margin-top: 11px; }
.demo-result { width: 100%; height: 100%; display: block; object-fit: cover; }
.video-label { position: absolute; inset: auto auto 7px 7px; }

@media (max-width: 780px) {
  .stage { grid-template-columns: var(--device-width); justify-content: center; padding-inline: 16px; }
  .intro { display: none; }
}
@media (max-width: 500px) {
  body { background: var(--bg); }
  .stage { display: block; padding: 0; }
  .phone { height: 100dvh; width: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .status, .home-bar { display: none; }
  .app-header { height: 56px; margin-top: env(safe-area-inset-top); }
  .screen h2 { font-size: 23px; }
  .app-footer { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
}
@media (max-width: 340px) {
  .screen-content, .app-header, .actions { padding-inline: 10px; }
  .app-header { gap: 5px; }
}
