:root {
  color-scheme: dark;
  --bg: #0b100e;
  --surface: #131b17;
  --raised: #19241e;
  --border: #2a382f;
  --text: #f4f7ef;
  --muted: #a2b0a4;
  --lime: #d6fc75;
  --green: #212f20;
  --danger: #ffb0a8;
  --display: 'Space Grotesk', 'DM Sans', sans-serif;
  --content: 920px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 1rem/1.45 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; }
:is(a, button, input, select):focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon { display: inline-block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: middle; }
.frame { width: min(calc(100% - 48px), var(--content)); margin-inline: auto; }
.masthead { border-bottom: 1px solid #1f2a23; background: #0d1410; padding-top: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)); }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { background: transparent; border: 0; padding: 0; display: inline-flex; align-items: center; gap: 11px; color: var(--text); font: 700 1.28rem/1 var(--display); letter-spacing: -.055em; min-height: 44px; }
.mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: #11190b; background: var(--lime); }
.mark .icon { width: 23px; height: 23px; stroke-width: 2.2; }
.wordmark-tail { color: #b5c3b5; margin-left: 6px; font-weight: 500; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { border: 1px solid var(--border); border-radius: 99px; color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap; padding: 7px 11px; display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7a897d; }
.status-pill[data-state='live'] { color: #d5f2ac; background: #17241a; border-color: #31452e; }
.status-pill[data-state='live'] .status-dot { background: #b8ed70; box-shadow: 0 0 10px #bcf47680; }
.status-pill[data-state='test'] .status-dot { background: #e7bf73; }
.icon-button { color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; transition: color .18s, background .18s; }
.icon-button:hover { color: var(--text); background: var(--raised); }
.main { padding-top: 35px; padding-bottom: calc(115px + max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px))); }
.page-heading, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-heading { margin-bottom: 25px; }
.page-heading h1 { font: 700 clamp(2.15rem, 5vw, 3.4rem)/1.05 var(--display); letter-spacing: -.07em; }
.page-heading p, .section-heading p, .sheet-head p { color: var(--muted); margin-top: 7px; }
.hero { overflow: hidden; position: relative; isolation: isolate; border: 1px solid #3a4f30; border-radius: 24px; min-height: 237px; background: radial-gradient(ellipse at 77% 50%, #40562b 0, #263922 35%, transparent 67%), linear-gradient(115deg, #192a1c, #192b1c 65%, #263822); }
.hero-lines { position: absolute; inset: 0; z-index: -2; opacity: .36; background: repeating-linear-gradient(0deg, transparent 0 30px, #baf88821 30px 31px), repeating-linear-gradient(90deg, transparent 0 30px, #baf88821 30px 31px); mask-image: linear-gradient(90deg, transparent 33%, black 84%); }
.hero-art { position: absolute; z-index: -1; top: -4%; right: 6%; width: 55%; height: 108%; background: url('/static/fleet-gift.webp') right center / contain no-repeat; }
.hero-content { position: relative; padding: 25px 29px; }
.hero-label { display: inline-flex; align-items: center; gap: 8px; color: #d5e9c4; font-size: .85rem; font-weight: 700; }
.hero-label .icon { width: 17px; height: 17px; color: var(--lime); }
.hero-value { font: 600 clamp(3.3rem, 9vw, 4.75rem)/.99 var(--display); letter-spacing: -.095em; margin-top: 11px; font-variant-numeric: tabular-nums; }
.hero-value small { font: 600 .32em var(--display); color: #c1d6b4; letter-spacing: -.03em; }
.hero-caption { color: #c4d5ba; margin-top: 4px; font-weight: 500; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 15px; margin-top: 20px; color: #d5e9c4; font-size: .79rem; font-weight: 700; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta .icon { width: 16px; height: 16px; color: #b8d6a1; margin-right: 2px; }
.section { margin-top: 31px; }
.section-heading { margin-bottom: 13px; }
.section > .section-heading { align-items: center; }
.section-heading h2, .sheet-head h2 { font: 700 1.51rem/1.16 var(--display); letter-spacing: -.045em; }
.section-heading p { font-size: .88rem; margin-top: 4px; }
.segmented { display: inline-flex; align-items: center; gap: 3px; padding: 3px; width: max-content; max-width: 100%; border: 1px solid var(--border); border-radius: 13px; background: #101813; }
.segmented button { border: 1px solid transparent; background: transparent; color: var(--muted); min-height: 44px; border-radius: 9px; padding: 0 13px; white-space: nowrap; font-size: .81rem; font-weight: 700; transition: background .18s, color .18s; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed='true'] { background: #223123; border-color: #314330; color: #e2f3d0; }
.rows { display: grid; gap: 8px; }
.data-row { padding: 11px 14px; display: flex; align-items: center; gap: 13px; min-height: 74px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); color: var(--text); text-align: left; width: 100%; }
button.data-row { transition: background .18s, border-color .18s; }
button.data-row:hover { background: var(--raised); border-color: #465947; }
.thumb { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 49px; height: 49px; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 36% 28%, #3b5135, #202e22 76%); color: #b4d198; }
.thumb[data-tone='1'] { background: radial-gradient(circle at 36% 28%, #554239, #30221e 76%); color: #edbaa2; }
.thumb[data-tone='2'] { background: radial-gradient(circle at 36% 28%, #414653, #242831 76%); color: #c0c8ef; }
.thumb img { position: absolute; width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.thumb:has(img.loaded) > .icon { visibility: hidden; }
.row-main { flex: 1 1 auto; min-width: 0; }
.row-main strong { display: block; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.row-main small, .metric small { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; overflow-wrap: anywhere; }
.row-metrics { display: flex; gap: 22px; justify-content: flex-end; text-align: right; }
.metric { min-width: 0; }
.metric strong { font-family: var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-primary strong { color: var(--lime); }
.row-arrow { margin-left: auto; width: 18px; height: 18px; color: var(--muted); }
.add-line { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 65px; border: 1px dashed #435638; border-radius: 15px; text-align: left; background: #121c14; color: var(--lime); padding: 9px 14px; margin-top: 11px; transition: background .18s, border-color .18s; }
.add-line:hover { background: #1c2a1c; border-color: var(--lime); }
.add-icon { width: 38px; height: 38px; display: grid; place-items: center; background: #263724; border-radius: 10px; }
.add-line small { display: block; color: var(--muted); font-size: .8rem; }
.bottom-nav { position: fixed; z-index: 2; left: 50%; bottom: calc(16px + max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px))); transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; width: min(calc(100% - 36px), 406px); padding: 6px; border-radius: 21px; border: 1px solid #36463a; background: #111b15fa; backdrop-filter: blur(14px); box-shadow: 0 12px 36px #0008; }
.bottom-nav button { min-height: 49px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 14px; font-size: .87rem; font-weight: 700; background: transparent; color: #adbbae; transition: background .18s, color .18s; }
.bottom-nav button:hover { color: var(--text); }
.bottom-nav button[aria-current] { background: #283922; border-color: #3a5030; color: var(--lime); }
.bottom-nav .icon { width: 19px; height: 19px; }
.wallet-switch { margin-bottom: 17px; }
.wallet-switch button { min-width: 104px; }
.wallet-hero { min-height: 229px; }
.balance-value { overflow-wrap: anywhere; }
.balance-value small { padding-left: .38em; }
.balance-value.compact { font-size: clamp(1.8rem, 6vw, 3.35rem); letter-spacing: -.06em; }
.wallet-watermark { z-index: -1; position: absolute; right: 12%; top: 50%; transform: translateY(-50%) rotate(-13deg); color: #a9d66b45; }
.wallet-watermark .icon { width: clamp(95px, 27vw, 236px); height: auto; stroke-width: .82; }
.wallet-actions { display: flex; gap: 9px; margin-top: 19px; }
.account-actions { display: flex; align-items: center; }
.account-withdraw-btn { min-height: 40px; padding: 0 12px; font-size: .84rem; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; padding: 0 15px; font-weight: 700; font-size: .92rem; transition: background .18s, color .18s; }
.button .icon { width: 18px; height: 18px; }
.primary { background: var(--lime); color: #17200d; }
.primary:hover:not(:disabled) { background: #e5ffab; }
.secondary { background: #253426; color: #e4f1d9; border-color: #485e40; }
.secondary:hover:not(:disabled) { background: #384f37; }
.full-width { width: 100%; }
.assets-heading { margin-top: 29px; }
.count-label { color: var(--muted); font-size: .86rem; }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.asset-grid > :not(.asset-card) { grid-column: 1 / -1; }
.asset-card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.asset-card .thumb { width: 100%; height: auto; aspect-ratio: 1.65; border-radius: 0; }
.asset-card .thumb img { padding: 12px; }
.asset-card .thumb .icon { width: 40px; height: 40px; }
.asset-info { padding: 12px 13px; }
.asset-info h3 { font: 700 1.03rem/1.2 var(--display); overflow-wrap: anywhere; }
.asset-info p, .asset-foot { margin-top: 4px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.asset-info .asset-id { margin-bottom: 6px; }
.asset-foot { margin-top: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.asset-foot strong { color: var(--lime); }
.notice { border: 1px solid #3a5030; background: #19241b; border-radius: 12px; color: #d5e5c9; padding: 10px 12px; margin: 10px 0; font-size: .9rem; overflow-wrap: anywhere; }
.error { border-color: #6a4239; background: #2b1d19; color: var(--danger); }
.empty { min-height: 130px; display: grid; place-items: center; text-align: center; padding: 19px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.empty .icon { margin-bottom: 7px; color: #a9c692; }
.empty strong { display: block; }
.empty p { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.loading { display: grid; gap: 8px; }
.loading span { display: block; height: 61px; border: 1px solid var(--border); border-radius: 15px; background: linear-gradient(100deg, var(--surface) 34%, #202b23 50%, var(--surface) 66%) 0 0 / 240% 100%; animation: shimmer 1.5s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -170% 0; } }

dialog { background: #131c16; color: var(--text); border: 1px solid #415240; border-radius: 20px; padding: 20px; width: min(calc(100% - 28px), 510px); max-height: calc(100dvh - 32px); overscroll-behavior: contain; box-shadow: 0 26px 90px #0009; }
dialog::backdrop { background: #070b09a8; backdrop-filter: blur(5px); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sheet-head p { font-size: .9rem; }
.field { display: grid; gap: 6px; font-size: .88rem; font-weight: 700; min-width: 0; }
.field input, .field select { width: 100%; min-height: 47px; background: #0d1510; color: var(--text); border: 1px solid #3b4c3c; border-radius: 10px; padding: 9px 11px; font-size: 1rem; }
.field input::placeholder { color: #9ba99c; }
.field select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #b2c4ac 50%), linear-gradient(135deg, #b2c4ac 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select:disabled { opacity: .6; }
.picker-button { width: 100%; min-width: 0; overflow: hidden; min-height: 47px; background: #0d1510; color: var(--text); border: 1px solid #3b4c3c; border-radius: 10px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; transition: border-color .18s, background .18s; }
.picker-button:hover:not(:disabled) { background: var(--raised); border-color: #526853; }
.picker-button:disabled { opacity: .6; }
.picker-button span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.picker-button .icon { width: 17px; height: 17px; color: var(--muted); flex: none; }
.trait-row { justify-content: flex-start; }
.trait-row[aria-pressed='true'] { background: #1d2c1e; border-color: #4f6b47; }
.trait-check { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #4d624d; display: grid; place-items: center; flex: none; color: transparent; transition: background .15s, border-color .15s, color .15s; }
.trait-row[aria-pressed='true'] .trait-check { background: var(--lime); border-color: var(--lime); color: #121c0c; }
.trait-check .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); flex: none; }
.rule-list { display: grid; gap: 10px; max-height: min(40dvh, 320px); overflow-y: auto; padding-right: 2px; }
.rule-card { border: 1px solid var(--border); background: #0e1712; border-radius: 13px; padding: 11px 12px; display: grid; gap: 9px; }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rule-head strong { font-size: .9rem; color: var(--lime); overflow-wrap: anywhere; }
.rule-remove { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; flex: none; }
.rule-remove:hover { color: var(--danger); border-color: #6a4239; }
.rule-remove .icon { width: 15px; height: 15px; }
.danger { background: #2c1b18; color: var(--danger); border-color: #6a4239; }
.danger:hover:not(:disabled) { background: #3b231f; }
.pool-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; }
.order-delete { flex: 0 0 auto; padding-inline: 10px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-stack { display: grid; gap: 13px; }
.search-field { position: relative; }
.search-field .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search-field input { padding-left: 39px; }
.catalog-list { display: grid; gap: 6px; height: min(45dvh, 360px); overflow-y: auto; overscroll-behavior: contain; padding: 3px 4px 3px 3px; scrollbar-color: #475d43 transparent; }
.catalog-list .data-row { min-height: 55px; padding: 6px 10px; }
.catalog-list .thumb { width: 39px; height: 39px; }
.selected-gift { min-height: 62px; }
.selected-gift .button { padding-inline: 10px; }
.quote { border: 1px solid #3a5235; border-radius: 12px; background: #1c2a1b; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.quote strong { color: var(--lime); font-family: var(--display); }
.quote small { font-size: .8rem; color: var(--muted); text-align: right; }
.help { color: var(--muted); font-size: .85rem; }
.address { display: block; padding: 12px; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; overflow-wrap: anywhere; user-select: all; font-size: .91rem; }
.toast { position: fixed; z-index: 4; bottom: calc(88px + max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px))); left: 50%; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 10px 15px; border: 1px solid #526a48; border-radius: 12px; background: #263723; color: #e7f6dc; box-shadow: 0 10px 35px #0008; text-align: center; font-size: .91rem; }

@media (max-width: 600px) {
  .frame { width: calc(100% - 32px); }
  .topbar { min-height: 58px; }
  .main { padding-top: 20px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading p { font-size: .91rem; }
  .hero { min-height: 183px; border-radius: 19px; }
  .hero-content { padding: 17px 16px; }
  .hero-art { right: -2%; width: 59%; height: 100%; top: 0; }
  .hero-meta { max-width: 60%; gap: 5px 8px; margin-top: 14px; }
  .section { margin-top: 20px; }
  .section-heading { align-items: flex-start; }
  .order-switch button { padding-inline: 9px; }
  .order-switch { align-self: flex-end; }
  .rows .data-row { padding: 8px 10px; gap: 9px; min-height: 64px; }
  .rows .data-row .thumb { width: 43px; height: 43px; }
  .row-metrics { gap: 9px; }
  .metric strong { font-size: .88rem; }
  .optional-metric { display: none; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-row { flex-wrap: wrap; }
  .account-row .row-metrics { flex: 0 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 10px 1px 0; border-top: 1px solid var(--border); text-align: left; }
  .account-actions { flex: 0 0 100%; margin-top: 4px; }
  .account-actions .button { width: 100%; }
  .bottom-nav button { gap: 6px; }
  dialog { max-height: calc(100dvh - 18px); margin: auto auto 0; width: 100%; padding: 17px 15px calc(17px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
}
@media (max-width: 365px) {
  .frame { width: calc(100% - 24px); }
  .topbar, .top-actions { gap: 6px; }
  .status-pill { padding-inline: 8px; font-size: .74rem; }
  .wordmark { gap: 7px; font-size: 1.1rem; }
  .order-switch button { font-size: .73rem; padding-inline: 6px; }
  .section-heading p { font-size: .8rem; }
  .asset-info { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
