@charset "UTF-8";

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --bg-elevated: rgba(255, 255, 255, .72);
  --bg-heavy: rgba(249, 249, 251, .84);
  --surface: rgba(255, 255, 255, .64);
  --surface-solid: #fff;
  --surface-muted: rgba(118, 118, 128, .08);
  --text: #1d1d1f;
  --text-2: #5d5d63;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, .075);
  --line-strong: rgba(0, 0, 0, .12);
  --accent: #ff4655;
  --accent-2: #e73545;
  --blue: #0a84ff;
  --green: #30b56a;
  --orange: #ff9f0a;
  --red-soft: rgba(255, 70, 85, .12);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .055), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, .10), 0 2px 8px rgba(0, 0, 0, .05);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, .18), 0 8px 24px rgba(0, 0, 0, .08);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --spring: cubic-bezier(.22, 1, .36, 1);
  --content: 1240px;
}

html[data-theme="dark"] {
  --bg: #09090b;
  --bg-elevated: rgba(28, 28, 31, .70);
  --bg-heavy: rgba(18, 18, 20, .84);
  --surface: rgba(38, 38, 42, .62);
  --surface-solid: #1c1c1f;
  --surface-muted: rgba(235, 235, 245, .07);
  --text: #f5f5f7;
  --text-2: #b5b5bb;
  --text-3: #8e8e93;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .15);
  --red-soft: rgba(255, 70, 85, .15);
  --shadow-sm: 0 2px 14px rgba(0, 0, 0, .24);
  --shadow-md: 0 18px 56px rgba(0, 0, 0, .38);
  --shadow-lg: 0 34px 100px rgba(0, 0, 0, .54);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #09090b;
    --bg-elevated: rgba(28, 28, 31, .70);
    --bg-heavy: rgba(18, 18, 20, .84);
    --surface: rgba(38, 38, 42, .62);
    --surface-solid: #1c1c1f;
    --surface-muted: rgba(235, 235, 245, .07);
    --text: #f5f5f7;
    --text-2: #b5b5bb;
    --text-3: #8e8e93;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .15);
    --red-soft: rgba(255, 70, 85, .15);
    --shadow-sm: 0 2px 14px rgba(0, 0, 0, .24);
    --shadow-md: 0 18px 56px rgba(0, 0, 0, .38);
    --shadow-lg: 0 34px 100px rgba(0, 0, 0, .54);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}
button, input, textarea, select { font: inherit; color: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: -1; width: 42vw; height: 42vw; border-radius: 50%; filter: blur(100px); opacity: .13; pointer-events: none; }
.ambient-one { top: -18vw; right: -12vw; background: #ff4655; }
.ambient-two { left: -18vw; bottom: -22vw; background: #0a84ff; opacity: .09; }
.material { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
.material-heavy { background: var(--bg-heavy); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%); }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 730; }
h2 { margin-bottom: .35rem; font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.035em; }
h3 { margin-bottom: .3rem; font-size: 1.1rem; letter-spacing: -.015em; }
.eyebrow { margin: 0 0 .65rem; color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.lead, .login-copy, .sheet-copy { margin-bottom: 0; color: var(--text-2); font-size: 1.02rem; line-height: 1.65; }
.muted { color: var(--text-3); font-size: .84rem; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 430px); padding: 42px; border-radius: 32px; text-align: center; box-shadow: var(--shadow-lg); animation: materialize .45s var(--spring) both; }
.login-card h1 { font-size: 2.4rem; }
.login-copy { margin: 0 auto 28px; max-width: 320px; }
.brand-mark { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 20px; background: linear-gradient(145deg, #ff5b68, #e9283a); color: white; box-shadow: 0 14px 30px rgba(255, 70, 85, .28), inset 0 1px rgba(255,255,255,.35); font-size: 1.7rem; font-weight: 850; letter-spacing: -.08em; }
.brand-mark-small { width: 38px; height: 38px; margin: 0; border-radius: 12px; font-size: 1rem; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 22px 0 0; color: var(--text-3); font-size: .78rem; }
.privacy-note svg { width: 15px; }
.auth-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 19px; padding: 4px; border-radius: 14px; background: var(--surface-muted); }
.auth-segmented button { min-height: 38px; border-radius: 10px; color: var(--text-2); background: transparent; cursor: pointer; font-size: .82rem; font-weight: 650; transition: color .18s ease, background .2s ease, box-shadow .2s ease, transform 100ms ease; }
.auth-segmented button:active { transform: scale(.98); }
.auth-segmented button.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 1px 5px rgba(0,0,0,.1); }
.auth-form { animation: route-in .24s var(--spring) both; }
.form-note { margin: -3px 2px 0; color: var(--text-3); font-size: .72rem; line-height: 1.55; text-align: left; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.verification-row .button { min-width: 112px; min-height: 46px; }
.verification-row .button:disabled { cursor: not-allowed; }
#register-code-note.success { color: var(--green); }
#register-code-note.error { color: var(--accent); }
@media (max-width: 430px) {
  .verification-row { grid-template-columns: 1fr; }
  .verification-row .button { width: 100%; }
}

.stack { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; text-align: left; }
.field > span, .query-controls label > span:first-child, .compact-select > span { padding-left: 3px; color: var(--text-2); font-size: .78rem; font-weight: 620; }
input, textarea, select { width: 100%; border: 1px solid var(--line); outline: none; background: var(--surface-muted); border-radius: 13px; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
input, select { min-height: 46px; padding: 0 14px; }
textarea { min-height: 185px; padding: 13px 14px; resize: vertical; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
input:focus, textarea:focus, select:focus { border-color: color-mix(in srgb, var(--accent) 62%, transparent); background: var(--surface-solid); box-shadow: 0 0 0 4px var(--red-soft); }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border-radius: 13px; cursor: pointer; font-size: .9rem; font-weight: 680; white-space: nowrap; transition: transform 100ms ease-out, filter .18s ease, box-shadow .2s ease, opacity .2s ease; }
.button:active, .icon-button:active, .avatar-button:active, .history-row:active { transform: scale(.97); transition-duration: 70ms; }
.button:disabled { cursor: wait; opacity: .66; }
.button-primary { background: linear-gradient(180deg, #ff5663, var(--accent-2)); color: #fff; box-shadow: 0 7px 18px rgba(231, 53, 69, .22), inset 0 1px rgba(255,255,255,.25); }
.button-primary:hover { filter: brightness(1.04); }
.button-secondary { background: var(--surface-muted); border: 1px solid var(--line); }
.button-danger { color: #ff3b4c; background: var(--red-soft); }
.button-large { min-height: 50px; border-radius: 15px; }
.button svg { width: 18px; }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .spinner { display: inline-block; }
.is-loading > span, .is-loading > svg { opacity: .65; }
.icon-button, .avatar-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--surface-muted); cursor: pointer; transition: transform 100ms ease-out, background .2s ease; }
.icon-button:hover, .avatar-button:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.avatar-button { color: white; background: linear-gradient(145deg, #6e75f8, #8854d8); font-size: .85rem; font-weight: 750; }

.topbar { position: sticky; z-index: 30; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; height: 72px; align-items: center; padding: 0 max(24px, env(safe-area-inset-left)); }
.brand { display: inline-flex; width: max-content; align-items: center; gap: 11px; }
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand b { font-size: .95rem; }
.brand small { margin-top: 4px; color: var(--text-3); font-size: .65rem; letter-spacing: .03em; }
.segmented { display: flex; padding: 4px; border-radius: 15px; background: var(--surface-muted); }
.segmented a { display: flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 15px; border-radius: 11px; color: var(--text-2); font-size: .82rem; font-weight: 620; white-space: nowrap; transition: color .18s ease, background .22s ease, box-shadow .22s ease, transform 100ms ease; }
.segmented a:active { transform: scale(.97); }
.segmented a.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 1px 5px rgba(0,0,0,.1); }
.segmented svg { width: 16px; }
.top-actions { position: relative; z-index: 40; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.top-logout { min-height: 40px; padding: 0 13px; color: #fff; border-color: transparent; background: linear-gradient(180deg, #ff5663, var(--accent-2)); box-shadow: 0 6px 16px rgba(231, 53, 69, .22); }
.popover { position: absolute; z-index: 50; top: 49px; right: 0; width: 210px; padding: 8px; border-radius: 17px; box-shadow: var(--shadow-md); transform-origin: top right; animation: popover-in .22s var(--spring) both; }
.popover-user { display: grid; padding: 10px 11px 12px; border-bottom: 1px solid var(--line); }
.popover-user small { color: var(--text-3); }
.popover button { display: flex; width: 100%; align-items: center; gap: 9px; margin-top: 6px; padding: 10px 11px; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; }
.popover button:hover { background: var(--surface-muted); }

.content { width: min(calc(100% - 40px), var(--content)); min-height: calc(100vh - 160px); margin: 0 auto; padding: clamp(48px, 7vw, 84px) 0 60px; }
.route { animation: route-in .32s var(--spring) both; }
.hero-row, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; margin-bottom: 42px; }
.hero-row > div:first-child { max-width: 660px; }
.query-controls { display: grid; width: min(100%, 390px); flex: 0 0 390px; gap: 13px; padding: 18px; border-radius: 22px; }
.query-controls > label:first-child { display: grid; gap: 6px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 3px; cursor: pointer; }
.switch-row > span { display: grid; }
.switch-row b { font-size: .86rem; }
.switch-row small { color: var(--text-3); font-size: .71rem; }
.switch-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch { position: relative; width: 45px; height: 27px; flex: 0 0 45px; border-radius: 99px; background: rgba(120,120,128,.25); transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 23px; height: 23px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform .24s var(--spring); }
.switch-row input:checked + .switch { background: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); outline-offset: 2px; }

.status-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.daily-mail-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 16px; margin-bottom: 42px; padding: 17px 19px; border-radius: 21px; }
.daily-mail-main { min-width: 0; }
.daily-mail-main > small { color: var(--blue); font-size: .67rem; font-weight: 750; letter-spacing: .11em; }
.daily-mail-main h3 { margin: 2px 0 2px; }
.daily-mail-main p { margin: 0 0 3px; color: var(--text-2); font-size: .78rem; }
.daily-mail-card .switch-row { min-height: 44px; padding: 0 12px; border-radius: 13px; background: var(--surface-muted); }
.daily-mail-card.is-saving { pointer-events: none; opacity: .7; }
.stat { display: flex; align-items: center; gap: 14px; padding: 17px 18px; border-radius: 19px; }
.stat-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; }
.stat-icon.coral { color: var(--accent); background: var(--red-soft); }
.stat-icon.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.stat-icon.green { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.stat div { display: grid; }
.stat small { color: var(--text-3); font-size: .74rem; }
.stat strong { margin-top: 1px; font-size: 1.1rem; letter-spacing: -.02em; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }

.store-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.weapon-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface-solid); box-shadow: var(--shadow-sm); transition: transform .32s var(--spring), box-shadow .32s ease; animation: card-in .42s var(--spring) both; }
.weapon-card:nth-child(2) { animation-delay: 35ms; }.weapon-card:nth-child(3) { animation-delay: 70ms; }.weapon-card:nth-child(4) { animation-delay: 105ms; }
.weapon-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.weapon-visual { position: relative; display: grid; height: 190px; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.16), transparent 62%), linear-gradient(145deg, #253765, #121b31); }
.weapon-card.quality-green .weapon-visual { background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.17), transparent 62%), linear-gradient(145deg, #267b69, #12362f); }
.weapon-card.quality-purple .weapon-visual, .weapon-card.quality-pink .weapon-visual { background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.16), transparent 62%), linear-gradient(145deg, #70439a, #2b183d); }
.weapon-card.quality-orange .weapon-visual, .weapon-card.quality-yellow .weapon-visual { background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.18), transparent 62%), linear-gradient(145deg, #a85f2a, #482511); }
.weapon-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 38%); pointer-events: none; }
.weapon-visual img { position: relative; z-index: 1; display: block; width: 90%; height: 78%; object-fit: contain; filter: drop-shadow(0 14px 14px rgba(0,0,0,.34)); transition: transform .38s var(--spring); }
.weapon-card:hover img { transform: scale(1.045); }
.quality-chip { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 99px; background: rgba(10,10,12,.28); color: rgba(255,255,255,.92); backdrop-filter: blur(12px); font-size: .66rem; font-weight: 650; }
.weapon-body { padding: 17px 18px 18px; }
.weapon-name { min-height: 2.8em; margin: 0 0 12px; font-size: 1rem; line-height: 1.38; }
.price { display: flex; align-items: baseline; gap: 6px; color: var(--accent); }
.price strong { font-size: 1.55rem; line-height: 1; letter-spacing: -.04em; }
.price span { font-size: .72rem; font-weight: 600; }
.weapon-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-3); font-size: .7rem; }
.weapon-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { padding: 70px 20px; border-radius: 25px; text-align: center; }
.empty-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 17px; border-radius: 18px; color: var(--accent); background: var(--red-soft); }
.empty-state p { color: var(--text-3); }
.empty-state .button { margin-top: 8px; }
.page-heading { align-items: center; margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(2.1rem, 4vw, 3.5rem); }
.heading-actions, .empty-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.empty-actions { justify-content: center; margin-top: 10px; }

.account-list { display: grid; gap: 13px; }
.account-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; padding: 19px 20px; border-radius: 21px; }
.account-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 15px; color: var(--accent); background: var(--red-soft); font-size: 1.1rem; font-weight: 780; }
.account-main { min-width: 0; }
.account-title { display: flex; align-items: center; gap: 9px; }
.account-title h3 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.badge { padding: 3px 7px; border-radius: 99px; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); font-size: .65rem; font-weight: 680; }
.account-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 5px; color: var(--text-3); font-size: .73rem; }
.account-error { margin: 8px 0 0; color: var(--accent); font-size: .75rem; }
.account-actions { display: flex; gap: 8px; }
.compact-select { display: grid; min-width: 220px; gap: 5px; }

.history-list { max-height: 540px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent; border-radius: 23px; }
.history-row { display: grid; width: 100%; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; transition: background .17s ease, transform 100ms ease; }
.history-row:last-child { border-bottom: 0; }
.history-row:hover { background: var(--surface-muted); }
.history-date { display: grid; }
.history-date small, .history-cell small { color: var(--text-3); font-size: .68rem; }
.history-cell { display: grid; min-width: 95px; }
.history-row > svg { color: var(--text-3); }

.modal-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(0,0,0,.32); backdrop-filter: blur(5px); animation: fade-in .2s ease both; }
.sheet { position: fixed; z-index: 90; top: 50%; left: 50%; width: min(calc(100% - 32px), 560px); max-height: calc(100vh - 40px); overflow-y: auto; padding: 27px; border-radius: 28px; box-shadow: var(--shadow-lg); transform: translate(-50%, -50%); animation: sheet-in .32s var(--spring) both; }
.sheet-wide { width: min(calc(100% - 32px), 1000px); }
.sheet-handle { display: none; width: 42px; height: 6px; margin: -14px auto 14px; border-radius: 99px; background: var(--line-strong); }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.sheet-header h2 { margin: 0; }
.sheet-copy { margin-bottom: 20px; font-size: .9rem; }
.sheet code { padding: 2px 5px; border-radius: 6px; background: var(--surface-muted); font-size: .85em; }
.callout { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border-radius: 13px; color: var(--text-2); background: color-mix(in srgb, var(--blue) 9%, transparent); font-size: .78rem; }
.callout svg { flex: 0 0 18px; color: var(--blue); }
.confirmation-modal { width: min(calc(100% - 32px), 500px); }
.confirmation-copy { margin: 2px 0 4px; color: var(--text-2); line-height: 1.7; }
.confirmation-phrase { display: grid; gap: 11px; padding: 15px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 16px; background: var(--red-soft); }
.confirmation-phrase p { margin: 0; color: var(--text-2); font-size: .78rem; }
.confirmation-phrase > code { display: block; overflow-wrap: anywhere; padding: 11px 12px; border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--line)); border-radius: 11px; background: var(--surface-solid); color: var(--accent); font: 720 .88rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; }
.confirmation-phrase small { color: var(--text-3); font-size: .7rem; }
.confirmation-phrase small.error { color: var(--accent); }
.confirmation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 3px; }
.confirmation-actions .button:disabled { cursor: not-allowed; filter: saturate(.55); opacity: .5; }
.confirmation-modal.is-danger #action-confirm-submit { color: #fff; background: linear-gradient(180deg, #ff5663, var(--accent-2)); box-shadow: 0 7px 18px rgba(231, 53, 69, .22); }
 .qr-login { display: grid; justify-items: center; gap: 17px; padding: 5px 0 2px; text-align: center; }
 .qr-frame { position: relative; display: grid; width: 244px; height: 244px; place-items: center; padding: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 25px; background: #fff; box-shadow: 0 16px 38px rgba(0,0,0,.12); }
 .qr-frame::after { content: ""; position: absolute; inset: 7px; border: 2px solid rgba(10,132,255,.18); border-radius: 18px; pointer-events: none; }
 .qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
 .qr-status { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; }
 .qr-status > i { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 6px color-mix(in srgb, var(--blue) 13%, transparent); animation: status-pulse 1.5s ease-in-out infinite; }
 .qr-status.confirm > i { background: var(--orange); box-shadow: 0 0 0 6px color-mix(in srgb, var(--orange) 13%, transparent); }
 .qr-status.success > i { background: var(--green); box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 13%, transparent); animation: none; }
 .qr-status.error > i { background: var(--accent); box-shadow: 0 0 0 6px var(--red-soft); animation: none; }
 .qr-status div { display: grid; text-align: left; }
 .qr-status b { font-size: .92rem; }
 .qr-status small { color: var(--text-3); font-size: .75rem; }
 .qr-countdown { margin: -8px 0 0; color: var(--text-3); font-size: .73rem; }
 @keyframes status-pulse { 50% { transform: scale(.76); opacity: .7; } }
 .snapshot-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; color: var(--text-2); font-size: .8rem; }
.snapshot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.snapshot-grid .weapon-card { border-radius: 18px; }
.snapshot-grid .weapon-visual { height: 150px; }
.snapshot-grid .weapon-body { padding: 13px; }
.snapshot-grid .weapon-name { font-size: .87rem; }

.toast-region { position: fixed; z-index: 110; top: max(88px, env(safe-area-inset-top)); right: 20px; display: grid; width: min(calc(100% - 40px), 370px); gap: 10px; pointer-events: none; }
.toast { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--bg-heavy); box-shadow: var(--shadow-md); backdrop-filter: blur(25px) saturate(180%); pointer-events: auto; animation: toast-in .35s var(--spring) both; }
.toast-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 13%, transparent); }
.toast.error .toast-dot { background: var(--accent); box-shadow: 0 0 0 5px var(--red-soft); }
.toast b { display: block; font-size: .86rem; }
.toast p { margin: 2px 0 0; color: var(--text-2); font-size: .76rem; }
footer { display: flex; width: min(calc(100% - 40px), var(--content)); justify-content: space-between; margin: 0 auto; padding: 15px 0 calc(30px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--text-3); font-size: .7rem; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 52%, transparent); outline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes materialize { from { opacity: 0; transform: translateY(14px) scale(.975); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes route-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes popover-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); filter: blur(5px); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .topbar { z-index: 90; height: 64px; grid-template-columns: 1fr auto; padding: 0 18px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .segmented { position: fixed; z-index: 80; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 14px; justify-content: space-around; padding: 5px; border: 1px solid var(--line); background: var(--bg-heavy); box-shadow: var(--shadow-md); backdrop-filter: blur(28px) saturate(190%); }
  .segmented a { min-width: 0; min-height: 48px; flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; font-size: .7rem; line-height: 1.05; white-space: nowrap; }
  .segmented svg { width: 18px; height: 18px; }
  .content { padding-bottom: 110px; }
  .page-heading h1 { font-size: clamp(2rem, 6vw, 2.7rem); }
  footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}

@media (max-width: 980px) {
  .daily-mail-card { grid-template-columns: auto minmax(0, 1fr) auto; }
  .daily-mail-toggle { grid-column: 3; grid-row: 1 / span 2; }
  .daily-mail-flip { grid-column: 2; justify-self: start; }
  .store-grid, .snapshot-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-row { align-items: stretch; flex-direction: column; }
  .query-controls { width: 100%; flex-basis: auto; grid-template-columns: 1.2fr 1fr auto; align-items: end; }
  .query-controls .switch-row { min-height: 46px; }
}

@media (max-width: 720px) {
  .history-list { max-height: 400px; }
  .daily-mail-card { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .daily-mail-card > .stat-icon { margin-top: 2px; }
  .daily-mail-flip, .daily-mail-toggle { grid-row: auto; justify-self: stretch; }
  .daily-mail-flip { grid-column: 1 / -1; }
  .daily-mail-toggle { grid-column: 1 / -1; }
  .daily-mail-card .switch-row { justify-content: space-between; }
  .topbar { height: 62px; grid-template-columns: 1fr auto; padding: 0 16px; }
  .top-logout span { display: none; }
  .top-logout { width: 40px; padding: 0; border-radius: 50%; }
  .brand small { display: none; }
  .segmented { position: fixed; z-index: 50; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 14px; justify-content: space-around; padding: 5px; border: 1px solid var(--line); background: var(--bg-heavy); box-shadow: var(--shadow-md); backdrop-filter: blur(28px) saturate(190%); }
  .segmented a { flex: 1; justify-content: center; }
  .content { width: min(calc(100% - 28px), var(--content)); padding-top: 42px; padding-bottom: 105px; }
  h1 { font-size: 2.65rem; }
  .hero-row, .page-heading { align-items: stretch; flex-direction: column; gap: 23px; }
  .query-controls { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr; gap: 9px; }
  .stat { padding: 13px 15px; }
  .page-heading .button { align-self: flex-start; }
  .account-card { grid-template-columns: auto 1fr; }
  .account-actions { grid-column: 1 / -1; }
  .account-actions .button { flex: 1; }
  .compact-select { min-width: 0; }
  .history-row { grid-template-columns: 1fr auto; gap: 10px; }
  .history-cell:nth-of-type(3) { display: none; }
  .history-row > svg { display: none; }
  .sheet { --sheet-drag-y: 0px; top: auto; bottom: 0; left: 0; width: 100%; max-height: 90vh; border-radius: 28px 28px 0 0; transform: translateY(var(--sheet-drag-y)); padding-bottom: calc(26px + env(safe-area-inset-bottom)); animation-name: sheet-mobile-in; will-change: transform; }
  .sheet.is-dragging { overflow-y: hidden; animation: none; transition: none; user-select: none; }
  .sheet.is-settling { transition: transform .3s var(--spring); }
  .sheet-handle { position: relative; display: block; width: 64px; height: 22px; margin: -16px auto 8px; background: transparent; cursor: grab; touch-action: none; }
  .sheet-handle::after { content: ""; position: absolute; top: 8px; left: 50%; width: 42px; height: 6px; border-radius: 99px; background: var(--line-strong); transform: translateX(-50%); }
  .sheet-handle:active { cursor: grabbing; }
  footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  @keyframes sheet-mobile-in { from { opacity: .7; transform: translateY(100%); } to { opacity: 1; transform: none; } }
}

@media (max-width: 500px) {
  .avatar-button { display: none; }
  .top-actions { gap: 6px; }
  .login-card { padding: 34px 22px; border-radius: 26px; }
  .store-grid, .snapshot-grid { grid-template-columns: 1fr; }
  .weapon-visual { height: 220px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .account-icon { display: none; }
  .account-card { grid-template-columns: 1fr; }
  .account-actions { grid-column: auto; }
  footer { flex-direction: column; gap: 4px; }
}

@media (hover: hover) {
  .history-list::-webkit-scrollbar { width: 8px; }
  .history-list::-webkit-scrollbar-track { background: transparent; }
  .history-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: color-mix(in srgb, var(--text-3) 42%, transparent); background-clip: padding-box; }
  .history-list::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text-2) 58%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .weapon-card:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .material, .material-heavy, .popover, .toast, .segmented { background: var(--surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .modal-backdrop { backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0,0,0,.26); --line-strong: rgba(0,0,0,.45); }
  html[data-theme="dark"] { --line: rgba(255,255,255,.28); --line-strong: rgba(255,255,255,.5); }
  .material { background: var(--surface-solid); }
}