:root {
  color-scheme: light;
  --page: #f6f5f1;
  --surface: #fdfcf8;
  --raised: #eeede7;
  --ink: #242722;
  --secondary: #50554d;
  --muted: #62685f;
  --accent: #244f3a;
  --accent-dark: #183b2b;
  --selected: #e9eee6;
  --hairline: #2427221a;
  --radius-control: 8px;
  --radius-panel: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --numbers: ui-monospace, "SF Mono", Consolas, monospace;
  --interface-font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-family: var(--interface-font);
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100svh; background: var(--page); color: var(--ink); display: flex; flex-direction: column; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, .upload { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), .upload { cursor: pointer; }
button:disabled { opacity: .52; }
button, a, .upload { transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease); }
:where(button, a, input, textarea, select):focus-visible, .upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong, b { font-weight: 600; }
svg { flex: none; vertical-align: middle; }
small { font-weight: 400; }
.shell { width: min(1248px, 100% - 64px); margin-inline: auto; }
#app { flex: 1; padding-block: 32px 56px; outline: none; }
.topbar { border-bottom: 1px solid var(--hairline); background: var(--surface); }
.top-inner { min-height: 64px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; }
.top-inner:has(.nav) { grid-template-columns: 1fr auto 1fr; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; line-height: 1.15; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.brand-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-control); color: #fdfcf8; background: var(--accent-dark); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; padding-inline: 12px; color: var(--secondary); font-size: 14px; border: 1px solid transparent; border-radius: var(--radius-control); white-space: nowrap; }
.nav a:hover { background: var(--raised); }
.nav a[aria-current] { color: var(--accent-dark); background: var(--selected); border-color: #244f3a17; font-weight: 500; }
.account { display: flex; justify-content: end; align-items: center; gap: 8px; }
.account-phone, .account-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.icon-button { display: grid; place-items: center; min-width: 36px; min-height: 36px; border: 0; background: transparent; color: var(--secondary); border-radius: var(--radius-control); }
.icon-button:hover { background: var(--raised); color: var(--ink); }

.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 32px; border: 1px solid var(--hairline); border-radius: var(--radius-panel); background: var(--surface); }
.hero h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 500; line-height: 1.16; }
.hero p { margin-top: 8px; color: var(--secondary); font-size: 15px; }
.wallet-hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); min-height: 344px; overflow: hidden; background: #e8e6df; padding: 32px 40px; }
.wallet-hero .hero-text { z-index: 1; }
.wallet-hero h1 { font-size: clamp(36px, 4vw, 56px); }
.wallet-hero p { margin-top: 12px; }
.hero-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; width: fit-content; min-width: 168px; margin-top: 24px; padding-top: 12px; border-top: 1px solid #2427222b; }
.hero-count strong { color: var(--accent-dark); font: 500 32px/1 var(--numbers); white-space: nowrap; }
.hero-count span, .hero-count small, .metrics small { font-family: var(--interface-font); color: var(--secondary); font-size: 13px; }

.footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--hairline); padding-block: 20px; color: var(--muted); font-size: 13px; }
.footer > :last-child { text-align: right; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 32px 0 16px; }
.section-heading h2, .panel-heading h2, .dialog-heading h2, .login-panel h2 { font-size: 24px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--raised); }
.filters button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 4px 12px; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--secondary); font-size: 13px; white-space: nowrap; }
.filters button:hover { background: var(--surface); }
.filters button[aria-pressed="true"] { color: var(--accent-dark); border-color: var(--hairline); background: var(--surface); box-shadow: 0 1px 2px #2427220c; font-weight: 500; }
.filters small { color: var(--muted); font: 400 12px/1 var(--numbers); }
.ticket-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.theme-apricot { --ticket-bg: #f4d9c4; --ticket-light: #f8e5d5; --ticket-ink: #553526; }
.theme-lilac { --ticket-bg: #e4ddef; --ticket-light: #eee8f5; --ticket-ink: #423651; }
.theme-sage { --ticket-bg: #dbe4cb; --ticket-light: #e8eedc; --ticket-ink: #34452c; }
.theme-sky { --ticket-bg: #d8e7ec; --ticket-light: #e6f0f3; --ticket-ink: #294853; }
.theme-rose { --ticket-bg: #efd8df; --ticket-light: #f7e5e9; --ticket-ink: #583645; }
.theme-sand { --ticket-bg: #f1e3bc; --ticket-light: #f7edcf; --ticket-ink: #51421e; }
.ticket-card { min-width: 0; filter: drop-shadow(0 2px 0 #302c201f) drop-shadow(0 8px 12px #302c2010); }
.ticket-paper {
  --stub-height: 56px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ticket-paper, .ticket-flight { --notch: 8px; }
.ticket-face {
  position: relative;
  display: grid;
  flex: 1;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 20px;
  min-height: 184px;
  border: 1px solid color-mix(in srgb, var(--ticket-ink) 17%, transparent);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(158deg, var(--ticket-light), var(--ticket-bg) 78%);
  box-shadow: inset 0 1px 0 #fff8;
  color: var(--ticket-ink);
  mask-image:
    radial-gradient(circle at bottom left, transparent var(--notch), #000 calc(var(--notch) + .7px)),
    radial-gradient(circle at bottom right, transparent var(--notch), #000 calc(var(--notch) + .7px));
  mask-composite: intersect;
}
.ticket-face::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--ticket-ink) 42%, transparent);
  opacity: 0;
  pointer-events: none;
}
.ticket-kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.ticket-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.3; }
.ticket-title { align-self: center; min-width: 0; }
.ticket-title h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 600; line-height: 1.24; overflow-wrap: anywhere; }
.ticket-title p { margin-top: 8px; color: var(--ticket-ink); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.ticket-body-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.ticket-body-foot b { font: 500 24px/1 var(--numbers); white-space: nowrap; }
.ticket-body-foot small { font: 400 12px/1 var(--interface-font); }
.ticket-stub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--stub-height);
  padding: 4px 12px 4px 20px;
  border: 1px solid var(--hairline);
  border-top: 1px dashed color-mix(in srgb, var(--ticket-ink) 40%, transparent);
  border-radius: 0 0 14px 14px;
  background: #fcfbf6;
  transform-origin: left top;
  mask-image:
    radial-gradient(circle at top left, transparent var(--notch), #000 calc(var(--notch) + .7px)),
    radial-gradient(circle at top right, transparent var(--notch), #000 calc(var(--notch) + .7px));
  mask-composite: intersect;
}
.ticket-stub > span, .ticket-details > span { font-size: 12px; color: var(--muted); }
.ticket-action { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border: 1px solid var(--hairline); border-radius: var(--radius-control); color: var(--accent-dark); background: var(--surface); font-size: 14px; white-space: nowrap; }
.ticket-action:hover { background: var(--selected); color: var(--accent-dark); }
.stub-detached .ticket-stub { opacity: 0; pointer-events: none; }
.stub-detached .ticket-face::after, .redeemed-ticket .ticket-face::after { opacity: 1; }
.redeemed-ticket { align-self: start; }
.ticket-details { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.past-ticket .ticket-face { background: #eeede7; color: var(--secondary); }
.past-ticket .ticket-title p { color: var(--secondary); }
.stamp { display: grid; place-items: center; flex: none; padding: 4px 8px; border: 1px solid currentColor; outline: 1px solid currentColor; outline-offset: -3px; border-radius: 4px; background: #fffaf0; color: #873435; font-size: 13px; line-height: 1.25; white-space: nowrap; transform: rotate(-7deg); }
.stamp small { margin-top: 2px; font-size: 11px; }

.empty, .loading { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty { border: 1px dashed #24272238; border-radius: var(--radius-panel); display: grid; justify-items: center; gap: 8px; }
.empty h3 { color: var(--ink); font-size: 16px; font-weight: 500; }
.empty.compact { padding: 24px 16px; }
.empty p, .muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.panel { border: 1px solid var(--hairline); background: var(--surface); border-radius: var(--radius-panel); padding: 24px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 16px; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.login-art { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--hairline); border-radius: var(--radius-panel); background: var(--surface); }
.login-art .hero { flex: 1; min-height: 256px; border: 0; border-radius: 0; }
.login-art .wallet-hero { grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 412px; padding: 32px 32px 16px; }
.login-art .wallet-hero h1 { font-size: clamp(32px, 3.2vw, 44px); }
.login-art .wallet-stage { min-height: 240px; }
.login-art .wallet-object { width: min(70%, 320px); }
.login-art-footer { display: flex; align-items: center; gap: 8px; padding: 16px 32px; border-top: 1px solid var(--hairline); color: var(--secondary); font-size: 14px; }
.login-panel { display: grid; align-content: center; padding: clamp(24px, 4vw, 48px); }
.login-panel h2 { margin-bottom: 24px; }
.section-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--hairline); border-radius: var(--radius-control); background: var(--raised); color: var(--secondary); }

.form { display: grid; gap: 12px; }
.form label:has(input):not(.swatch), .form label:has(select), .form label:has(textarea) { display: grid; gap: 8px; }
.form label, .form legend { font-size: 14px; font-weight: 500; }
.form input:not([type="radio"]), .form select, .form textarea { width: 100%; min-width: 0; border: 1px solid #24272232; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: var(--radius-control); min-height: 44px; font-size: 16px; }
.form select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--secondary) 50%), linear-gradient(135deg, var(--secondary) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.form input::placeholder, .form textarea::placeholder { color: var(--muted); }
.form textarea { resize: vertical; }
.form fieldset { margin: 0; padding: 8px 0 0; border: 0; min-width: 0; }
.form legend { padding: 0; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.form-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.primary, .soft, .hero-button, .upload { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 14px; font-weight: 500; white-space: nowrap; }
.primary, .hero-button { background: var(--accent); color: #fff; }
.primary:hover:not(:disabled), .hero-button:hover { background: var(--accent-dark); }
.primary.danger { background: #842e32; }
.primary.danger:hover:not(:disabled) { background: #6d2427; }
.soft, .upload { background: var(--raised); color: var(--ink); border-color: var(--hairline); }
.soft:hover:not(:disabled), .upload:hover { background: #e4e3dc; }
.full { width: 100%; }
.small { min-height: 36px; padding: 4px 8px; font-size: 13px; }
cap-widget {
  display: block;
  margin-block: 4px;
  --cap-background: var(--surface);
  --cap-border-color: #24272232;
  --cap-border-radius: var(--radius-control);
  --cap-color: var(--ink);
}
.feedback { color: var(--accent); font-size: 14px; }
.feedback:empty { display: none; }
.error-text { color: #8a2629; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-block: 16px 24px; }
.metrics > div { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); }
.metrics span { color: var(--muted); font-size: 14px; }
.metrics strong { font: 500 28px/1.3 var(--numbers); }
.admin-grid, .redeem-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.template-list { display: grid; }
.template-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-block: 8px; border-top: 1px solid var(--hairline); }
.template-actions { display: flex; gap: 4px; }
.revoke-action { color: #842e32; }
.mini-ticket { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-control); background: var(--ticket-bg, var(--raised)); color: var(--ticket-ink, var(--secondary)); }
.template-meta { display: grid; gap: 4px; overflow-wrap: anywhere; }
.template-meta strong { font-size: 14px; font-weight: 500; }
.template-meta small { color: var(--muted); font-size: 12px; }
.records, .redeem-grid { margin-top: 24px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 12px; border-top: 1px solid var(--hairline); white-space: nowrap; }
th { color: var(--secondary); font-weight: 500; background: var(--raised); }
td:first-child { max-width: 320px; text-overflow: ellipsis; overflow: hidden; }

.viewfinder { display: grid; place-items: center; position: relative; isolation: isolate; min-height: 236px; overflow: hidden; border-radius: 12px; background: #252d27; color: #d4ded4; }
.viewfinder video { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.scan-corners { width: min(55%, 156px); aspect-ratio: 1; position: absolute; pointer-events: none; }
.scan-corners i { border: 0 solid #d6ded3; position: absolute; width: 20px; height: 20px; }
.scan-corners i:nth-child(1) { border-width: 2px 0 0 2px; top: 0; left: 0; }
.scan-corners i:nth-child(2) { border-width: 2px 2px 0 0; top: 0; right: 0; }
.scan-corners i:nth-child(3) { border-width: 0 2px 2px 0; bottom: 0; right: 0; }
.scan-corners i:nth-child(4) { border-width: 0 0 2px 2px; bottom: 0; left: 0; }
.camera-placeholder { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #d6ded352; border-radius: var(--radius-control); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scan-panel > .actions { margin-block: 12px 16px; }
.upload { position: relative; overflow: hidden; }
.upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.review-result { display: grid; justify-items: center; align-content: center; gap: 12px; min-height: 236px; text-align: center; }
.review-result h2 { color: var(--ink); font-size: 20px; font-weight: 500; }
.review-ticket { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px; border-radius: var(--radius-control); background: var(--ticket-light); color: var(--ticket-ink); overflow-wrap: anywhere; }
.review-ticket p { margin-top: 4px; font-size: 14px; }
.stepper { display: grid; grid-template-columns: 44px minmax(60px, 84px) 44px; gap: 8px; }
.stepper input { text-align: center; }

.dialog { width: min(100% - 32px, 480px); max-height: calc(100% - 32px); padding: 24px; border: 1px solid var(--hairline); border-radius: var(--radius-panel); color: var(--ink); background: var(--surface); box-shadow: 0 24px 64px #171a1640; }
.dialog:has(.designer) { width: min(100% - 32px, 800px); }
.dialog::backdrop { background: #171a1680; }
.dialog.stub-flight { overflow: visible; border-color: transparent; background: transparent; box-shadow: none; }
.dialog.stub-flight::backdrop { animation: ticket-backdrop var(--stub-flight-duration) var(--ease) both; }
.dialog.stub-flight-returning::backdrop { animation-direction: reverse; }
.dialog-content { position: relative; z-index: 1; }
.stub-flight .dialog-content { pointer-events: none; will-change: opacity; }
.ticket-flight { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.ticket-flight-panel, .ticket-flight .ticket-stub { will-change: transform, opacity; }
.ticket-flight-panel {
  position: absolute;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 24px 64px #171a1640;
}
.ticket-flight .ticket-stub { position: absolute; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.dialog-subtitle { color: var(--muted); font-size: 14px; }
.detail-description { padding-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.qr-area { display: grid; justify-items: center; gap: 8px; margin-top: 16px; }
.qr-image { display: grid; place-items: center; width: min(224px, 100%); aspect-ratio: 1; overflow: hidden; border: 1px solid var(--hairline); border-radius: var(--radius-control); color: var(--muted); background: #fff; }
.qr-image img { display: block; max-width: 100%; height: auto; }
.qr-caption { color: var(--accent-dark); font-size: 14px; text-align: center; }
.qr-caption.inactive { color: var(--muted); }
.qr-placeholder { position: relative; background: var(--raised); }
.qr-placeholder > span svg { width: 96px; height: 96px; color: #a3a79e; }
.qr-placeholder .stamp { position: absolute; inset-block-end: 24px; padding: 12px 20px; font-size: 24px; }
.qr-placeholder .stamp small { font-size: 12px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; min-height: 44px; margin-block: 4px 8px; }
.copy-row code { min-width: 0; overflow-wrap: anywhere; text-align: center; font: 400 12px/1.5 var(--numbers); }
.detail-foot { display: grid; place-items: center; min-height: 44px; }
.designer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); align-items: center; gap: 24px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: grid; place-items: center; position: relative; cursor: pointer; width: 32px; height: 32px; }
.swatch input { position: absolute; appearance: none; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; border-radius: var(--radius-control); }
.swatch span { width: 24px; height: 24px; background: var(--ticket-bg); border: 1px solid color-mix(in srgb, var(--ticket-ink), transparent 55%); border-radius: 4px; pointer-events: none; }
.swatch input:checked + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.toast-area { position: fixed; z-index: 10; right: 16px; bottom: 16px; width: min(360px, 100% - 32px); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; border-radius: var(--radius-control); background: var(--accent-dark); color: #fff; padding: 12px; box-shadow: 0 4px 16px #191b1833; font-size: 14px; }
.toast.error { background: #77282b; }

/* The rear leather, paper inserts and front pocket share one camera angle. */
.wallet-stage {
  display: grid;
  place-items: center;
  position: relative;
  min-height: 256px;
  perspective: 880px;
  pointer-events: none;
}
.wallet-stage::before {
  content: "";
  position: absolute;
  inset: 40% 13% 4%;
  background: radial-gradient(ellipse closest-side, #322c2552, transparent);
  transform: translate(6%, 10%) rotate(-9deg);
}
.wallet-object {
  position: relative;
  width: min(75%, 376px);
  aspect-ratio: 1.8;
  margin-top: 16px;
  isolation: isolate;
  transform: rotateX(17deg) rotateY(-15deg) rotateZ(-11deg);
}
.wallet-back, .wallet-pocket, .wallet-insert, .wallet-clasp { position: absolute; }
.wallet-back {
  inset: 0 0 3%;
  border: 1px solid #12291f;
  border-radius: 6% / 10%;
  background: linear-gradient(155deg, #40584a, #293e32 72%);
  box-shadow: inset 0 2px 0 #f5f7e53d, inset 0 -5px 12px #0c21168f, 2px 3px 0 #1b3025;
}
.wallet-insert {
  width: 71%;
  height: 76%;
  border-radius: 4% / 7%;
  border: 1px solid #28231b35;
  background: linear-gradient(150deg, var(--insert-light), var(--insert-paper));
  box-shadow: inset 0 1px 0 #fff9, 0 2px 0 var(--insert-edge), 0 5px 0 var(--insert-paper), 0 6px 0 var(--insert-edge), 0 8px 12px #1b1a194d;
  color: #685e47;
}
.wallet-insert::before {
  content: "";
  position: absolute;
  inset: 0 22% 0 auto;
  border-left: 1px dashed currentColor;
  opacity: .45;
}
.wallet-insert::after {
  content: "";
  position: absolute;
  inset: 25% auto auto 11%;
  width: 29%;
  height: 10%;
  border-block: 1px solid currentColor;
  opacity: .27;
}
.wallet-insert-back {
  --insert-light: #ecdbac;
  --insert-paper: #d8c48d;
  --insert-edge: #ac985f;
  left: 22%;
  top: -21%;
  transform: rotate(10deg);
}
.wallet-insert-middle {
  --insert-light: #e0e7d5;
  --insert-paper: #c7d1b8;
  --insert-edge: #a3ae95;
  left: 7%;
  top: -15%;
  transform: rotate(-8deg);
}
.wallet-insert-front {
  --insert-light: #faf3e0;
  --insert-paper: #eadfc6;
  --insert-edge: #bfb195;
  left: 15%;
  top: -3%;
  transform: rotate(3deg);
}
.wallet-insert-front svg { position: absolute; top: 12%; right: 7%; }
.wallet-pocket {
  inset: 30% 0 0;
  border: 1px solid #172e22;
  border-radius: 5% 5% 7% 6% / 8% 8% 16% 15%;
  background: linear-gradient(154deg, #466051, #314c3d 45%, #20382c 100%);
  box-shadow: inset 0 2px 0 #ebefdb38, inset 0 0 0 3px #192e225c, inset 0 -5px 8px #152b207a, 1px 3px 0 #1b3025, 2px 5px 0 #1f372b, 3px 8px 0 #172920, 7px 11px 14px #1a1c1860, 16px 23px 37px #1a1c1838;
}
.wallet-seam {
  position: absolute;
  inset: 8px;
  border: 1px dashed #a1af9b91;
  border-radius: 4% 4% 6% 5% / 8% 8% 14% 14%;
  box-shadow: 0 0 0 2px #16271e45;
}
.wallet-clasp {
  display: grid;
  place-items: center;
  inset: 51% -3% auto auto;
  width: 25%;
  height: 27%;
  padding-right: 12%;
  border: 1px solid #1c3025;
  border-radius: 34% 10% 10% 34% / 52% 14% 14% 52%;
  background: linear-gradient(162deg, #587164, #324d40 75%);
  box-shadow: inset 0 1px 0 #dce7d24d, inset 0 -2px 4px #1b3025aa, 2px 4px 6px #0c1a1470;
}
.wallet-clasp i {
  width: clamp(12px, 2vw, 22px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #423c2d;
  background: linear-gradient(145deg, #d8ccaa, #9d8d63 49%, #726244);
  box-shadow: inset 0 1px 0 #fff7d5b3, inset 0 0 0 2px #4a402b42, 1px 2px 4px #15231cb0;
}

.stamp-motion { animation: stamp 340ms var(--ease) both; }
@keyframes ticket-backdrop {
  0%, 23% { opacity: 0; }
  76%, 100% { opacity: 1; }
}
@keyframes stamp {
  from { transform: rotate(-7deg) scale(1.12); opacity: 0; }
  to { transform: rotate(-7deg) scale(1); opacity: 1; }
}

@media (max-width: 960px) {
  .ticket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .wallet-hero { padding-inline: 32px; }
  .wallet-object { width: 84%; }
}

@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); }
  #app { padding-block: 20px 36px; }
  .top-inner { gap: 8px; padding-block: 8px; }
  .top-inner:has(.nav) { grid-template-columns: 1fr auto; }
  .account { grid-area: 1 / 2; }
  .nav { grid-area: 2 / 1 / 3 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav a { min-height: 44px; padding-inline: 4px; gap: 4px; font-size: 13px; }
  .hero { padding: 20px; gap: 12px; }
  .hero p { font-size: 14px; }
  .wallet-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 0; padding: 20px 20px 16px; }
  .wallet-stage { min-height: clamp(168px, 48vw, 264px); }
  .wallet-object { width: min(72%, 320px); }
  .hero-count { min-width: 0; margin-top: 12px; padding-top: 8px; }
  .hero-count strong { font-size: 24px; }
  .hero-count span, .hero-count small { font-size: 12px; }
  .section-heading { flex-direction: column; align-items: stretch; gap: 8px; margin: 24px 0 12px; }
  .section-heading h2, .panel-heading h2 { font-size: 20px; }
  .filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters button { min-height: 40px; padding-inline: 4px; flex-wrap: wrap; gap: 0 4px; }
  .ticket-grid, .login-layout, .admin-grid, .redeem-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ticket-face { min-height: 160px; padding: 16px 20px; gap: 12px; }
  .ticket-action { min-height: 44px; }
  .login-art .hero { min-height: 0; padding: 20px; }
  .login-art .wallet-hero { min-height: 0; padding: 20px 20px 16px; }
  .login-art .wallet-stage { min-height: clamp(144px, 40vw, 228px); }
  .login-art .wallet-object { width: min(64%, 276px); }
  .login-art-footer { padding: 12px 20px; }
  .panel { padding: 16px; }
  .login-panel { padding: 20px; }
  .login-panel h2 { margin-bottom: 16px; }
  .metrics { gap: 8px; margin-block: 12px 16px; }
  .metrics > div { padding: 8px; }
  .metrics strong { font-size: 22px; }
  .metrics span { font-size: 12px; }
  .designer { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dialog { padding: 16px; }
  .viewfinder, .review-result { min-height: 196px; }
}

@media (max-width: 360px) {
  .shell { width: calc(100% - 24px); }
  .account-phone svg { display: none; }
  .footer { font-size: 12px; }
  .filters button { font-size: 12px; }
  .filters small { font-size: 11px; }
  .wallet-object { width: 72%; }
}

@media (max-width: 384px) {
  .copy-row { min-height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  button, a, .upload { transition: none; }
  .stamp-motion { animation: none; }
}
