/* Gifts Desk — «Бенто» v2.
   Tinted tiles, the gifts themselves as pictures, mono figures.
   Two themes on the same tokens: dark (default) and light. */

:root, :root[data-theme="dark"] {
  --bg: #0D0E12; --card: #17181F; --card2: #1F2129; --ln: #22242D;
  --tx: #EDEBF3; --mu: #8A8896; --dim: #55535F;
  --up: #4ADE80; --dn: #FF6B7A; --acc: #FFC83D; --pink: #FF7EB9;
  --glass: rgba(10, 10, 14, .6);
  --grid: rgba(255, 255, 255, .032); /* the inline card's 40px grid */
  --scrim: rgba(4, 4, 8, .55);
  --gram: #0098EA; /* the official GRAM mark: blue gem, white spark */
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F3F1EC; --card: #FFFFFF; --card2: #F3F1EC; --ln: #E4E1DA;
  --tx: #17171B; --mu: #66656B; --dim: #A3A1A8;
  --up: #15803D; --dn: #DC2647; --acc: #A16207; --pink: #C2185B;
  --glass: rgba(16, 16, 22, .55);
  --grid: rgba(23, 23, 27, .06);
  --scrim: rgba(20, 20, 28, .35);
  color-scheme: light;
}
:root {
  --f-head: "Unbounded", system-ui, sans-serif;
  --f-text: "Onest", system-ui, sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: 0px; /* set from Telegram's safe areas in app.js */
  /* aliases kept for markup that still names the old tokens */
  --gain: var(--up); --loss: var(--dn); --hint: var(--mu);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); }
/* The same grid as on the inline card; it stays put while the page scrolls. */
body { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 40px 40px; background-attachment: fixed; }
body { font: 400 15px/1.4 var(--f-text); -webkit-font-smoothing: antialiased; min-height: 100vh; overscroll-behavior-y: none; touch-action: pan-x pan-y; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; opacity: .5; }
input, select { font: inherit; color: var(--tx); }
svg { width: 24px; height: 24px; flex: none; }
img { -webkit-user-drag: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 12px; }
::-webkit-scrollbar { display: none; }
.up { color: var(--up); }
.down { color: var(--dn); }
.hint { color: var(--mu); }
.mono { font-family: var(--f-num); font-weight: 600; }
.strong { font-weight: 600; }

/* In full-screen Telegram (phones) the status bar and Telegram's own buttons sit over the page:
   the client tells their height in --tg-safe-area-inset-top and --tg-content-safe-area-inset-top. */
#app { max-width: 600px; margin: 0 auto; padding: calc(8px + var(--safe-t)) 14px calc(120px + var(--safe-b)); }
.view { display: none; }
.view.active { display: block; }

/* ---------- type ---------- */
.large-title { font: 700 26px/1.1 var(--f-head); letter-spacing: -.02em; margin: 2px 4px 14px; display: flex; align-items: center; gap: 10px; }
.count:empty { display: none; }
.count { font: 700 12px var(--f-num); letter-spacing: 0; padding: 3px 7px; border-radius: 8px; background: var(--card); border: 1px solid var(--ln); color: var(--tx); }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row .large-title { flex: 1; margin-bottom: 14px; }
.title-row .icon-btn { margin-bottom: 14px; }

/* ---------- numbers ---------- */
.ton { display: inline-flex; align-items: center; gap: .22em; font-family: var(--f-num); font-weight: 600; white-space: nowrap; }
.ton svg { width: .9em; height: .9em; color: var(--gram); }
.ton.usd svg { display: none; }
.chg { display: inline-flex; align-items: center; gap: 2px; font: 600 11.5px var(--f-num); white-space: nowrap; }
.chg.up { color: var(--up); } .chg.down { color: var(--dn); } .chg.flat, .chg.hint { color: var(--mu); }
.chg .trend { width: 12px; height: 12px; }

/* ---------- controls ---------- */
.search { height: 48px; border-radius: 16px; background: var(--card); border: 1px solid var(--ln); display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--mu); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--mu); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-row { display: flex; gap: 8px; }
.search-row .search { flex: 1; min-width: 0; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--card); border: 1px solid var(--ln); display: grid; place-items: center; color: var(--mu); }
.search-row .icon-btn { width: 48px; height: 48px; border-radius: 16px; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.fav.on { color: var(--acc); }

/* segment control: a container, the active item in ink */
.segmented { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-top: 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--ln); }
.segmented button { position: relative; z-index: 1; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--mu); text-align: center; white-space: nowrap; transition: color .2s var(--ease); }
.segmented button.active { color: var(--bg); }
.segmented .thumb { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 12px; background: var(--tx); transition: transform .24s var(--ease), width .24s var(--ease); }
.segmented .thumb.instant { transition: none; }
.segmented.seg-sm, .segmented.pf-cur { margin: 0; border-radius: 14px; grid-auto-columns: auto; }
.seg-sm button, .pf-cur button { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.seg-sm .thumb, .pf-cur .thumb { border-radius: 10px; }
.segmented.seg-xs { margin: 0; padding: 3px; gap: 3px; border-radius: 11px; background: var(--card2); border: 0; grid-auto-columns: auto; }
.seg-xs button { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.seg-xs .thumb { border-radius: 8px; }

/* chips: a row of separate pills, the chosen one in ink */
.chips, .mk-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 12px -14px 0; padding: 0 14px; }
.chips .thumb { display: none; }
.chips button { flex: none; height: 40px; padding: 0 16px; border-radius: 14px; display: flex; align-items: center; font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--ln); color: var(--tx); transition: background-color .15s, color .15s; }
.chips button.active { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.mk-chip { flex: none; height: 38px; padding: 0 12px 0 6px; border-radius: 13px; display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; background: var(--card); border: 1px solid var(--ln); }
.mk-chip:first-child { padding-left: 12px; }
.mk-chip small { font: 600 11px var(--f-num); opacity: .6; }
.mk-chip.on { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.mk-chip .cell-icon { width: 24px; height: 24px; }

.primary-btn, .main-fallback button { width: 100%; height: 54px; border-radius: 17px; background: var(--tx); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; text-align: center; }
.secondary-btn { width: 100%; height: 52px; margin-top: 12px; border-radius: 17px; background: var(--card); border: 1px solid var(--ln); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; }
.secondary-btn svg { width: 20px; height: 20px; color: var(--up); }
.main-fallback { margin-top: 12px; }

/* press: every tappable surface sinks a little */
.primary-btn, .secondary-btn, .main-fallback button, .icon-btn, .tab, .dock-me, .chips button, .mk-chip, .segmented button,
.bento, .recent-card, .act-tile, .pick-tile, .filter-chip, .picker-cell, .gcard, .card2, .theme-prev, .deal-hero, .model-cta, .tile, button.cell, .picker-row, .sheet-btn, .ob-next {
  transition: transform .15s var(--ease), background-color .15s, color .15s; }
.primary-btn:active, .secondary-btn:active, .main-fallback button:active, .icon-btn:active, .chips button:active, .mk-chip:active,
.bento:active, .recent-card:active, .act-tile:active, .pick-tile:active, .filter-chip:active, .picker-cell:active, .gcard:active, .card2:active, .theme-prev:active, .deal-hero:active, .model-cta:active, .tile:active, .sheet-btn:active, .ob-next:active { transform: scale(.96); }
.tab:active, .dock-me:active { transform: scale(.94); }
button.cell:active, .picker-row:active { background: var(--card2); }

/* ---------- sections and grouped lists ---------- */
.section { margin-top: 22px; }
.section-header { display: flex; align-items: center; gap: 8px; font: 700 15px var(--f-head); margin: 0 4px 10px; }
.hdr-count { font: 700 12px var(--f-num); }
.hdr-count.pink { color: var(--pink); }
.section-footer { font-size: 12.5px; color: var(--mu); margin: 8px 6px 0; line-height: 1.4; }
.cells { background: var(--card); border: 1px solid var(--ln); border-radius: 22px; overflow: hidden; }
.cell { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; text-align: left; }
.cells > * + * { border-top: 1px solid var(--ln); }
.cell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cell-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { font-size: 12.5px; color: var(--mu); overflow: hidden; text-overflow: ellipsis; }
.cell.two-line .cell-sub { display: flex; flex-direction: column; }
.sub-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-line.warn { color: var(--acc); }
.cell-after { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; font-size: 14px; }
.cell-after .ton { font-size: 14px; }
.chev { color: var(--dim); display: flex; margin-right: -4px; }
.chev svg { width: 18px; height: 18px; }
.cell.hint .cell-title { color: var(--mu); font-weight: 500; }
.row-diff { font: 600 11px var(--f-num); color: var(--mu); white-space: nowrap; }
.row-diff.best { color: var(--acc); font-family: var(--f-text); font-weight: 600; }
.cell.best-row { background: color-mix(in oklch, var(--acc) 8%, var(--card)); }

.cell-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; overflow: hidden; }
.cell-icon svg { width: 20px; height: 20px; }
.cell-icon.mkt { background: none; }
.cell-icon.mkt img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
:root[data-theme="light"] .cell-icon.mkt img[src*="tonnel"], :root[data-theme="light"] .mkt-badge[src*="tonnel"] { background: #17171B; }
.cell-icon.soft { border-radius: 12px; background: var(--card2); color: var(--acc); }

/* a collection's picture on its own colour */
.cell-media { flex: none; width: 48px; height: 48px; border-radius: 14px; object-fit: contain; background: color-mix(in oklch, var(--c, var(--mu)) 35%, var(--card2)); }
.fallback { display: grid; place-items: center; font: 700 18px var(--f-head); color: #fff; background: color-mix(in oklch, var(--c, var(--mu)) 70%, var(--card2)); }
.media-wrap { position: relative; flex: none; display: flex; }
.mkt-badge { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--card); background: var(--card); }

/* ---------- home: bento ---------- */
.bento-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 118px; gap: 10px; }
.bento { position: relative; overflow: hidden; border-radius: 22px; padding: 14px; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  background: linear-gradient(180deg, color-mix(in oklch, var(--c) 24%, var(--card)), var(--card) 70%); border: 1px solid var(--ln); }
.bento-text { position: relative; z-index: 1; display: flex; flex-direction: column; max-width: 110px; }
.bento-text b { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.bento-text small { font-size: 11.5px; color: var(--mu); margin-top: 4px; line-height: 1.3; }
.bento-count { font: 700 30px/1 var(--f-head); color: var(--pink); margin-top: 8px; }
.bento-count small { font: inherit; color: var(--dim); margin: 0; }
.bento-art { position: absolute; right: -10px; bottom: -10px; width: 78px; height: 78px; object-fit: contain; pointer-events: none; }
.bento-art.fallback, .rc-art.fallback, .card2-art.fallback { display: none; }
.b-owner { grid-column: 1; grid-row: span 2; }
.b-owner .bento-text { max-width: 130px; }
.b-owner .bento-text b, .b-deals .bento-text b { font-size: 17px; }
.b-owner .bento-art { width: 150px; height: 150px; right: -18px; bottom: -12px; }
.b-calc { grid-column: 2; grid-row: 1; }
.b-calc .bento-text { max-width: 100px; }
.b-calc .bento-art { width: 82px; height: 82px; }
.b-search { grid-column: 2; grid-row: 2; }
.b-deals { grid-column: span 2; }
.b-deals .bento-text { max-width: 160px; }
.b-deals .bento-art { width: 124px; height: 124px; right: 8px; bottom: -8px; }
.b-alerts .bento-art, .b-admin .bento-art { width: 72px; height: 72px; bottom: -8px; }
.b-alerts .bento-text { max-width: 120px; }
.b-admin .bento-text { max-width: 96px; }
.bento-grid.no-admin .b-alerts { grid-column: span 2; }

/* recent checks: a snapping strip */
.strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; scroll-snap-type: x mandatory; scroll-padding: 0 14px; }
.strip > * { scroll-snap-align: start; }
.strip.dragging { scroll-snap-type: none; cursor: grabbing; }
.recent-card { flex: none; position: relative; overflow: hidden; width: 150px; height: 96px; border-radius: 18px; padding: 12px; text-align: left; display: flex; flex-direction: column;
  background: color-mix(in oklch, var(--c) 30%, var(--card)); border: 1px solid var(--ln); }
.rc-name, .rc-num, .rc-price { position: relative; z-index: 1; }
.rc-name { font-size: 13px; font-weight: 600; max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-num { font-size: 11.5px; color: var(--mu); }
.rc-price { position: absolute; left: 12px; bottom: 10px; font-size: 12px; }
.rc-price .ton { font-weight: 700; }
.rc-art { position: absolute; right: -8px; bottom: -8px; width: 72px; height: 72px; object-fit: contain; }
.rc-art.market-art { border-radius: 16px; right: 8px; bottom: 8px; width: 52px; height: 52px; object-fit: cover; }

/* ---------- market ---------- */
#view-market .search { margin-top: 0; }
.stat-strip { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat-card { min-width: 0; border-radius: 18px; padding: 12px; background: var(--card); border: 1px solid var(--ln); }
.stat-card.tone-up { background: linear-gradient(180deg, color-mix(in oklch, var(--up) 22%, var(--card)), var(--card)); }
.stat-card.tone-dn { background: linear-gradient(180deg, color-mix(in oklch, var(--dn) 22%, var(--card)), var(--card)); }
.stat-k { font-size: 11.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-v { font: 700 17px var(--f-num); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-v .chg { font-size: 17px; font-weight: 700; }
.stat-v .chg .trend { width: 16px; height: 16px; }
.stat-v .ton { font-weight: 700; }
.market-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 4px 10px; font-size: 12.5px; color: var(--mu); }
.sort-note { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.updated-chip { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mu); min-height: 32px; }
.updated-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); }
.updated-chip.busy .dot { background: var(--acc); animation: pulse-dot 1s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: .35; } }
.cells.with-media .cell { padding: 10px 12px; }
.spark { width: 60px; height: 26px; flex: none; }
.spark.up { color: var(--up); } .spark.down { color: var(--dn); }
.with-media .cell-after { min-width: 68px; }
.flash { display: inline-flex; border-radius: 8px; padding: 1px 5px; margin: -1px -5px; animation: flash-up 1.4s ease-out; }
.flash-down { animation-name: flash-down; }
@keyframes flash-up { 0%, 30% { background: color-mix(in oklch, var(--up) 28%, transparent); } 100% { background: transparent; } }
@keyframes flash-down { 0%, 30% { background: color-mix(in oklch, var(--dn) 28%, transparent); } 100% { background: transparent; } }
.ptr { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -4px auto 10px; width: max-content; padding: 6px 14px; border-radius: 999px; font-size: 12px; color: var(--mu); background: var(--card); border: 1px solid var(--ln); }
.ptr svg { width: 14px; height: 14px; color: var(--acc); transition: transform .2s; }
.ptr.ready svg { transform: rotate(180deg); }

/* market as tiles */
.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { position: relative; overflow: hidden; height: 164px; border-radius: 22px; padding: 12px; text-align: left; display: flex; flex-direction: column; align-items: flex-start;
  background: linear-gradient(180deg, color-mix(in oklch, var(--c, var(--mu)) 34%, var(--card)), var(--card) 80%); border: 1px solid var(--ln); }
.tile .media-wrap { position: absolute; right: -6px; top: 26px; }
.tile .t-img { width: 92px; height: 92px; object-fit: contain; background: none; }
.tile .mkt-badge { display: none; }
.t-name { position: relative; z-index: 1; font-size: 14px; font-weight: 600; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile > .ton { position: absolute; left: 12px; bottom: 12px; z-index: 1; font-size: 18px; font-weight: 700; }
.t-num { position: absolute; left: 12px; bottom: 36px; z-index: 1; font-size: 11.5px; color: var(--mu); }

/* ---------- collection ---------- */
.col-hero { position: relative; overflow: hidden; border-radius: 26px; padding: 18px 18px 8px; border: 1px solid var(--ln);
  background: linear-gradient(160deg, color-mix(in oklch, var(--c) 34%, var(--card)), var(--card) 70%); }
.col-hero .hero-art { position: absolute; right: -8px; top: 22px; width: 118px; height: 118px; object-fit: contain; background: none; pointer-events: none; }
.col-hero .hero-art.fallback { border-radius: 50%; width: 110px; height: 110px; right: 10px; font-size: 44px; opacity: .5; }
.detail-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.detail-head h1 { margin: 0; font: 700 20px/1.15 var(--f-head); letter-spacing: -.01em; }
.detail-head .hint { font-size: 13px; margin-top: 2px; }
.detail-head .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
.big-price { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 18px; font: 700 40px/1.05 var(--f-num); letter-spacing: -.03em; }
.big-price svg { width: 30px; height: 30px; color: var(--gram); }
.col-change { position: relative; z-index: 1; margin-top: 2px; }
.col-hero .chg { font-size: 13px; }
.chart-box { position: relative; z-index: 1; margin-top: 10px; }
.chart { display: block; width: 100%; height: 160px; overflow: visible; }
.chart .grid { stroke: var(--ln); }
.chart .axis { fill: var(--mu); font: 500 9px var(--f-num); }
.chart .chart-tag { fill: var(--bg); font-family: var(--f-num); }
.chart-box.refreshing { opacity: .45; transition: opacity .2s; }
.chart-box.settled { opacity: 1; transition: opacity .3s; }
.chart-box .empty { padding: 26px 10px; }
#view-collection > .segmented { grid-template-columns: repeat(4, 1fr); }
.stat-strip:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
#view-collection .stat-v { font-size: 16px; }
.models-toggle { margin-top: 22px; background: var(--card); border: 1px solid var(--ln); border-radius: 22px; }
.models-toggle .chev { transition: transform .2s; }
.models-toggle.open .chev { transform: rotate(90deg); }

/* liquidity */
.liq-card { border-radius: 22px; padding: 16px; border: 1px solid var(--ln); background: var(--card); }
.liq-card.up { background: linear-gradient(180deg, color-mix(in oklch, var(--up) 22%, var(--card)), var(--card) 80%); }
.liq-card.mid { background: linear-gradient(180deg, color-mix(in oklch, var(--acc) 20%, var(--card)), var(--card) 80%); }
.liq-card.down { background: linear-gradient(180deg, color-mix(in oklch, var(--dn) 20%, var(--card)), var(--card) 80%); }
.liq-top { display: flex; justify-content: space-between; align-items: center; }
.liq-level { font: 700 22px var(--f-head); }
.liq-level.mid, .liq-score.mid { color: var(--acc); }
.liq-score { font: 700 13px var(--f-num); }
.liq-sub { display: block; font-size: 13px; color: var(--mu); margin-top: 4px; }
.liq-sub b { color: var(--tx); font-weight: 600; }
.liq-gauge { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 12px; }
.liq-gauge span { height: 6px; border-radius: 3px; background: var(--card2); }
.liq-gauge .down { background: var(--dn); } .liq-gauge .mid { background: var(--acc); } .liq-gauge .up { background: var(--up); }
.liq-bars { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-top: 16px; }
.liq-bars span { flex: 1; border-radius: 4px; background: color-mix(in oklch, var(--up) 35%, var(--card2)); }
.liq-bars span.now { background: var(--up); }
.liq-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 6px; }
.liq-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.liq-stat { border-radius: 18px; padding: 12px; background: var(--card); border: 1px solid var(--ln); display: flex; flex-direction: column; min-width: 0; }
.liq-stat > span { font-size: 11.5px; color: var(--mu); }
.liq-stat b { font: 700 17px var(--f-num); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liq-stat small { font-size: 11px; color: var(--dim); margin-top: 2px; }
.model-art { background: color-mix(in oklch, var(--c, var(--mu)) 45%, var(--card2)); }

/* ---------- gift cards (models, portfolio, search) ---------- */
/* No square in a square: the gift's own picture, blown up and blurred, fills the card. */
.gc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gcard { position: relative; overflow: hidden; isolation: isolate; border-radius: 20px; padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0;
  background: linear-gradient(180deg, color-mix(in oklch, var(--c, var(--mu)) 40%, var(--card)), var(--card)); border: 1px solid var(--ln); }
.gc-bg { position: absolute; inset: -30%; width: 160%; height: 160%; object-fit: cover; filter: blur(26px) saturate(1.2); opacity: .55; z-index: -1; pointer-events: none; }
.gc-art { width: 76px; height: 76px; object-fit: cover; border-radius: 50%; -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 72%); mask-image: radial-gradient(circle, #000 58%, transparent 72%); }
.gc-art.model-art, .gc-art.market-art { object-fit: contain; border-radius: 0; -webkit-mask-image: none; mask-image: none; background: none; }
.gc-art.fallback { border-radius: 50%; -webkit-mask-image: none; mask-image: none; font-size: 28px; }
.gc-name { font-size: 12.5px; font-weight: 600; margin-top: 2px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-num { font: 600 10.5px var(--f-num); color: var(--mu); }
.gc-price { margin-top: 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 13px; }
.gc-price .ton { font-weight: 700; }
.gc-price .chg { font-size: 11px; }
.gc-price-row { flex-direction: row; gap: 6px; }
.gc-price-row .cell-icon { width: 18px; height: 18px; }
.gc-pnl { position: absolute; left: 6px; top: 6px; z-index: 1; font: 700 10px var(--f-num); padding: 2px 5px; border-radius: 6px; background: var(--glass); }
.gc-pnl.up { color: #7CF0A6; } .gc-pnl.down { color: #FF9AA6; }
.gc-wallet { position: absolute; right: 6px; top: 6px; z-index: 1; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--glass); color: #fff; }
.gc-wallet svg { width: 14px; height: 14px; }

/* search lots: tall cards, a glass plate with the price */
.search-grid { grid-template-columns: 1fr 1fr; }
.lot-card { height: 200px; padding: 0; border: 0; border-radius: 22px; justify-content: flex-start; background: radial-gradient(circle at 50% 35%, color-mix(in oklch, var(--c, var(--mu)) 50%, #2a2a30), #121216); }
.lot-card .gc-bg { opacity: .9; filter: blur(30px) saturate(1.3); }
.lot-card .gc-art { width: 128px; height: 128px; margin-top: 14px; }
.lot-card .gc-num { position: absolute; left: 12px; top: 12px; font: 700 11px var(--f-num); color: #fff; background: rgba(0, 0, 0, .28); border-radius: 7px; padding: 3px 6px; }
.lot-plate { position: absolute; left: 6px; right: 6px; bottom: 6px; border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); padding: 8px 10px; color: #fff; display: flex; align-items: center; gap: 8px; text-align: left; }
.lot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lot-text b { font-size: 14px; }
.lot-plate .gc-attrs { font-size: 10.5px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lot-plate .cell-icon { width: 24px; height: 24px; }

/* ---------- owner of a gift ---------- */
.gift-hero { position: relative; overflow: hidden; margin-top: 12px; height: 300px; border-radius: 28px; background: radial-gradient(circle at 50% 40%, color-mix(in oklch, var(--c) 40%, #3a3a3f), #141416); }
.gift-art { position: absolute; inset: 0; }
.gift-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gift-img.market-art { object-fit: contain; padding: 30px 40px 70px; }
.gift-img.fallback { font-size: 80px; }
.gift-plate { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; display: flex; justify-content: space-between; align-items: flex-end; color: #fff; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .45)); }
.gift-name { font: 700 22px/1.15 var(--f-head); }
.gift-meta { font: 600 12px var(--f-num); opacity: .75; margin-top: 2px; }
.attr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.attr-tile { min-width: 0; border-radius: 18px; padding: 12px; background: var(--card); border: 1px solid var(--ln); display: flex; flex-direction: column; }
.attr-tile small { font-size: 11.5px; color: var(--mu); }
.attr-tile b { font-size: 14px; font-weight: 600; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rarity { font: 700 12px var(--f-num); color: var(--acc); margin-top: 2px; }
.owner-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--ln); }
.owner-ava { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: color-mix(in oklch, var(--c) 80%, #000); }
.owner-text { display: flex; flex-direction: column; min-width: 0; }
.owner-text small { font-size: 11.5px; color: var(--mu); }
.owner-text b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#owner-anchor > .section { margin-top: 10px; }
.model-cta { width: 100%; display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 14px; border-radius: 20px; text-align: left; border: 1px solid var(--ln);
  background: linear-gradient(90deg, color-mix(in oklch, #3F8FD8 26%, var(--card)), var(--card)); }
.model-cta .cell-icon { width: 40px; height: 40px; }
.model-cta > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.model-cta b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-cta small { font-size: 12.5px; color: var(--mu); }
.model-cta > .ton { font-size: 16px; font-weight: 700; }
.act-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.act-tile { position: relative; min-height: 64px; border-radius: 20px; padding: 14px; text-align: left; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--ln); }
.act-tile:nth-child(-n+2) { min-height: 96px; }
.act-tile b { font-size: 14.5px; font-weight: 600; padding-right: 18px; }
.act-tile > span:not(.act-ic) { font-size: 12px; color: var(--mu); margin-top: 4px; }
.act-tile.tone-pink { background: linear-gradient(180deg, color-mix(in oklch, var(--pink) 22%, var(--card)), var(--card)); }
.act-tile.tone-up { background: linear-gradient(180deg, color-mix(in oklch, var(--up) 22%, var(--card)), var(--card)); }
.act-ic { position: absolute; right: 12px; top: 14px; color: var(--mu); display: flex; }
.act-ic svg { width: 16px; height: 16px; }

/* ---------- portfolio ---------- */
.pf-top { display: flex; align-items: center; margin: 2px 4px 14px; }
.pf-share { width: 38px; height: 38px; margin-right: 8px; border-radius: 13px; background: var(--card); border: 1px solid var(--ln); color: var(--tx); display: grid; place-items: center; }
.pf-share svg { width: 18px; height: 18px; }
.pf-title { flex: 1; margin: 0; font: 700 26px/1.1 var(--f-head); letter-spacing: -.02em; }
.pf-hero { border-radius: 24px; padding: 16px 16px 8px; border: 1px solid var(--ln); display: flex; flex-direction: column;
  background: linear-gradient(180deg, color-mix(in oklch, var(--pink) 20%, var(--card)), var(--card) 75%); }
.pf-hero > .hint { font-size: 12.5px; }
.pf-value { display: flex; align-items: center; gap: 8px; margin-top: 4px; font: 700 40px/1.05 var(--f-num); letter-spacing: -.03em; }
.pf-value svg { width: 30px; height: 30px; color: var(--gram); }
.pf-chart { margin-top: 8px; }
.pf-chart .chart { height: 130px; }
.pf-paid { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0 6px; }
.pf-paid b { font-family: var(--f-num); }
.pf-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.pf-tile { min-width: 0; border-radius: 18px; padding: 12px; background: var(--card); border: 1px solid var(--ln); display: flex; flex-direction: column; text-align: left; }
.pf-tile span { font-size: 11.5px; color: var(--mu); }
.pf-tile b { font: 700 15px var(--f-num); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-tile.up { background: color-mix(in oklch, var(--up) 18%, var(--card)); }
.pf-tile.up b { color: var(--up); }
.pf-tile.down { background: color-mix(in oklch, var(--dn) 18%, var(--card)); }
.pf-tile.down b { color: var(--dn); }
.pf-tile-add b { font-family: var(--f-text); font-weight: 600; color: var(--acc); }
.pf-split { margin-top: 16px; }
.pf-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--mu); }
.pf-legend span { display: flex; align-items: center; gap: 6px; }
.pf-legend i { width: 8px; height: 8px; border-radius: 50%; }
.pf-head { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; }
.pf-head .section-header { margin: 0; }
.pf-src { margin-left: auto; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--ln); font-size: 12.5px; font-weight: 600; }
.pf-src svg { width: 16px; height: 16px; }
.pf-gifts .segmented { margin: 0 0 10px; }

/* ---------- calculator, search: picker tiles ---------- */
.tool-head { display: flex; align-items: center; gap: 10px; margin: 2px 4px 14px; }
.tool-head .large-title { flex: 1; margin: 0; min-width: 0; }
.tool-head:has(.segmented) .large-title { font-size: 20px; white-space: nowrap; }
.pick-grid, .filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick-tile { position: relative; overflow: hidden; min-height: 76px; border-radius: 18px; padding: 12px; text-align: left; display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--ln); }
.pick-tile[style*="--c"] { background: color-mix(in oklch, var(--c) 22%, var(--card)); }
.pick-tile .cell-label { font-size: 11.5px; color: var(--mu); }
.pick-value { position: relative; z-index: 1; font-size: 15px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-tile.has-art .pick-value { padding-right: 34px; }
.pick-tile small { font-size: 11.5px; color: var(--dim); }
.pick-art { position: absolute; right: -8px; bottom: -8px; width: 52px; height: 52px; object-fit: contain; background: none; }
.pick-art.fallback { border-radius: 50%; font-size: 20px; }
.filter-chip { min-width: 0; border-radius: 18px; padding: 11px 14px; text-align: left; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--ln); }
.filter-chip[style*="--c"] { background: color-mix(in oklch, var(--c) 22%, var(--card)); }
.filter-chip small { font-size: 11.5px; color: var(--mu); }
.filter-chip > span { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; }
.filter-chip > span svg { width: 16px; height: 16px; color: var(--dim); transform: rotate(90deg); }
.calc-mode { margin-top: 10px; }
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.calc-field { border-radius: 16px; padding: 10px 12px; background: var(--card); border: 1px solid var(--ln); display: flex; flex-direction: column; }
.calc-field > span:first-child { font-size: 11px; color: var(--mu); }
.calc-box { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.calc-box svg { width: 16px; height: 16px; color: var(--gram); }
.calc-input { width: 100%; min-width: 0; border: 0; background: none; outline: none; font: 700 18px var(--f-num); padding: 0; }
.calc-result { margin-top: 10px; border-radius: 24px; padding: 16px; border: 1px solid var(--ln); display: flex; flex-direction: column;
  background: linear-gradient(180deg, color-mix(in oklch, var(--up) 26%, var(--card)), var(--card) 85%); }
.calc-result.down { background: linear-gradient(180deg, color-mix(in oklch, var(--dn) 22%, var(--card)), var(--card) 85%); }
.calc-result.risky { background: linear-gradient(180deg, color-mix(in oklch, var(--acc) 22%, var(--card)), var(--card) 85%); }
.calc-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.calc-top > div { display: flex; flex-direction: column; min-width: 0; }
.calc-top .hint { font-size: 12.5px; }
.calc-right { align-items: flex-end; text-align: right; }
.calc-buy { font-size: 22px; margin-top: 4px; }
.calc-buy .ton { font-weight: 700; }
.calc-profit { font: 700 32px/1.1 var(--f-num); letter-spacing: -.02em; margin-top: 4px; color: var(--up); }
.calc-result.down .calc-profit { color: var(--dn); }
.calc-sub { display: flex; justify-content: flex-end; gap: 8px; font: 600 12px var(--f-num); color: var(--up); }
.calc-result.down .calc-sub { color: var(--dn); }
.calc-route { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 14px; padding: 10px; border-radius: 14px; background: var(--card2); font-size: 13px; }
.calc-route .cell-icon { width: 24px; height: 24px; }
.calc-note { font-size: 12.5px; color: var(--mu); margin-top: 10px; line-height: 1.4; }
.calc-demand { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--ln); font-size: 13px; color: var(--mu); line-height: 1.4; }
.calc-demand > svg { width: 20px; height: 20px; color: #FF8A3D; }
.calc-demand.none > svg { color: var(--dim); }
.calc-demand b { color: var(--tx); font-weight: 600; }
.search-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.search-bar .segmented { flex: 1; margin: 0; }
.search-count { font-size: 12.5px; margin: 12px 4px 0; }
.search-count b { color: var(--tx); font-family: var(--f-num); }
.search-count + .mk-chips { margin-bottom: 0; }
.search-grid { margin-top: 10px; }

/* ---------- deals ---------- */
.deal-hero { position: relative; display: block; width: 100%; overflow: hidden; isolation: isolate; height: 260px; border-radius: 28px; padding: 16px; color: #fff; text-align: left;
  background: radial-gradient(circle at 60% 35%, color-mix(in oklch, var(--c) 70%, #000), color-mix(in oklch, var(--c) 25%, #0a0a0c)); }
.deal-hero .gc-bg { opacity: .55; }
.deal-badge { position: relative; z-index: 1; display: inline-block; font: 700 11px var(--f-num); letter-spacing: .08em; background: rgba(0, 0, 0, .25); border-radius: 8px; padding: 5px 8px; text-transform: uppercase; }
.deal-mkt { position: absolute; right: 16px; top: 16px; z-index: 2; }
.deal-mkt .cell-icon { width: 30px; height: 30px; }
.deal-art { position: absolute; right: -6px; top: 20px; width: 190px; height: 190px; object-fit: cover; border-radius: 50%; -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 70%); mask-image: radial-gradient(circle, #000 55%, transparent 70%); }
.deal-art.market-art { object-fit: contain; border-radius: 0; -webkit-mask-image: none; mask-image: none; }
.deal-plate { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1; display: flex; flex-direction: column; }
.deal-plate > span:first-child { display: flex; flex-direction: column; }
.deal-plate b { font: 700 18px var(--f-head); }
.deal-plate small { font-size: 12.5px; opacity: .75; margin-top: 2px; }
.deal-price { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.deal-price .ton { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.deal-price small { font: 700 13px var(--f-num); color: #7CF0A6; opacity: 1; }
.deal-list.cells { background: none; border: 0; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 8px; }
.deal-list.cells > * + * { border-top: 1px solid var(--ln); }
.deal-row { border-radius: 20px; border: 1px solid var(--ln); background: linear-gradient(90deg, color-mix(in oklch, var(--c) 22%, var(--card)), var(--card) 60%); }
.deal-row .cell-media { background: none; width: 52px; height: 52px; }
.deal-row .row-diff { color: var(--up); }
.deal-row .cell-after .ton { font-size: 15px; font-weight: 700; }

/* ---------- alerts ---------- */
.alert-new { position: relative; overflow: hidden; border-radius: 24px; padding: 16px; border: 1px solid var(--ln);
  background: linear-gradient(180deg, color-mix(in oklch, var(--pink) 22%, var(--card)), var(--card) 70%); }
.alert-new-art { position: absolute; right: -10px; top: -6px; width: 90px; height: 90px; object-fit: contain; pointer-events: none; }
.alert-new-title { margin: 0; font: 700 16px var(--f-head); }
.alert-new-text { margin: 4px 0 0; max-width: 230px; font-size: 12.5px; color: var(--mu); line-height: 1.4; }
.alert-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
#alert-bd-btn { grid-column: 1 / -1; }
.picker-cell, .input-cell { min-width: 0; border-radius: 16px; padding: 10px 12px; background: var(--card2); text-align: left; display: flex; flex-direction: column; }
.picker-cell .cell-label, .input-cell .cell-label { font-size: 11px; color: var(--mu); }
.picker-value { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 14px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-value .ton { margin-left: auto; font-size: 12px; color: var(--mu); }
.picker-value .picker-thumb { width: 22px; height: 22px; border-radius: 7px; }
.input-cell { grid-column: span 2; flex-direction: row; align-items: center; gap: 10px; }
.input-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.input-cell input { width: 100%; border: 0; background: none; outline: none; padding: 0; margin-top: 2px; font: 700 20px var(--f-num); }
.input-cell input::placeholder { color: var(--dim); }
.cur-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mini-seg { display: flex; gap: 4px; }
.mini-seg button { padding: 6px 10px; border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--mu); }
.mini-seg button.active { background: var(--tx); color: var(--bg); font-weight: 700; }
#alert-submit { grid-column: span 2; height: 52px; margin-top: 4px; border-radius: 16px; }
#alert-submit:disabled { opacity: .6; }
#alerts .cells { background: none; border: 0; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 8px; }
#alerts .cells > * + * { border-top: 1px solid var(--ln); }
.alert-row { border-radius: 20px; border: 1px solid var(--ln); background: var(--card); padding: 10px 10px 10px 12px; }
.alert-row.fired { background: color-mix(in oklch, var(--up) 14%, var(--card)); }
.alert-art { flex: none; width: 48px; height: 48px; border-radius: 14px; object-fit: contain; background: color-mix(in oklch, var(--c, var(--mu)) 35%, var(--card2)); }
.alert-sub { display: flex; flex-wrap: wrap; gap: 0 8px; }
.alert-col { width: 100%; }
.alert-target .ton { color: var(--tx); }
.alert-state { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.alert-state.wait { background: color-mix(in oklch, var(--pink) 22%, var(--card2)); color: var(--pink); }
.alert-state.fired { background: var(--up); color: #06240F; }
.alert-del { width: 40px; height: 40px; border-radius: 12px; background: var(--card2); border: 0; }
.alert-del svg { width: 16px; height: 16px; }

/* ---------- bottom sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: sheet-fade .2s var(--ease); }
.sheet { width: 100%; max-width: 520px; max-height: 86vh; padding: 18px 16px calc(18px + var(--safe-b)); border-radius: 28px 28px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; background: var(--card); border: 1px solid var(--ln); border-bottom: 0; animation: sheet-up .26s var(--ease); }
.sheet > * { min-width: 0; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
@keyframes sheet-fade { from { opacity: 0; } }
.picker-sheet { grid-template-rows: auto auto minmax(0, 1fr); height: 80vh; }
.picker-head, .sheet-head { display: flex; align-items: center; gap: 12px; }
.picker-head b { flex: 1; font: 700 17px var(--f-head); }
.picker-head .icon-btn { width: 36px; height: 36px; border-radius: 12px; background: var(--card2); border: 0; }
.picker-search { height: 44px; border-radius: 14px; border: 1px solid var(--ln); background: var(--card2); padding: 0 14px; outline: none; }
.picker-list { overflow-y: auto; margin: 0 -16px; padding: 0 16px; }
.picker-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 4px; border-radius: 14px; text-align: left; }
.picker-row + .picker-row { border-top: 1px solid var(--ln); border-radius: 0; }
.picker-row > .ton { font-size: 14px; }
.picker-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picker-name b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-name small { font-size: 12.5px; color: var(--mu); }
.picker-thumb { flex: none; width: 42px; height: 42px; border-radius: 13px; object-fit: contain; background: color-mix(in oklch, var(--c, var(--mu)) 35%, var(--card2)); }
.picker-thumb.fallback { font-size: 16px; }
.soft-any { display: grid; place-items: center; color: var(--acc); background: var(--card2); font-weight: 700; }
.soft-any svg { width: 20px; height: 20px; }
.backdrop-dot { border-radius: 50%; }
.symbol-tile { display: grid; place-items: center; background: var(--card2); }
.symbol-img { width: 30px; height: 30px; object-fit: contain; }
.symbol-img.fallback { background: none; color: var(--mu); font-size: 14px; }
.picker-empty { text-align: center; padding: 30px 0; }
.sheet-art { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; }
.sheet-head > div { display: flex; flex-direction: column; }
.sheet-head b { font: 700 17px var(--f-head); }
.sheet-floor { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--card2); }
.sheet-label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--mu); }
.sheet-field { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; border-radius: 16px; background: var(--card2); }
.sheet-field svg { width: 18px; height: 18px; color: var(--gram); }
.sheet-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 700 20px var(--f-num); }
.sheet-pnl { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.sheet-pnl:empty { display: none; }
.sheet-pnl b { font-family: var(--f-num); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-btn { height: 52px; border-radius: 16px; background: var(--card2); font-weight: 600; text-align: center; }
.sheet-btn.primary { background: var(--tx); color: var(--bg); }
.sheet-link { color: var(--acc); font-size: 14px; font-weight: 600; text-align: center; padding: 6px; }
.search-bar .sheet-link { flex: none; }

/* ---------- profile ---------- */
.me-head { display: flex; align-items: center; gap: 14px; margin: 2px 4px 16px; }
.me-head > div:not(.ava) { display: flex; flex-direction: column; min-width: 0; }
.me-head b { font: 700 20px var(--f-head); }
.me-head span { font-size: 13px; color: var(--mu); }
.ava { flex: none; width: 60px; height: 60px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font: 700 24px var(--f-head); background: #B9A2FF; color: #1A1033; }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card2 { position: relative; overflow: hidden; height: 100px; border-radius: 20px; padding: 14px; text-align: left; border: 1px solid var(--ln); display: flex; flex-direction: column; align-items: flex-start;
  background: linear-gradient(180deg, color-mix(in oklch, var(--c) 24%, var(--card)), var(--card)); }
.card2 b { position: relative; z-index: 1; font-size: 15px; font-weight: 600; }
.card2-art { position: absolute; right: -8px; bottom: -8px; width: 64px; height: 64px; object-fit: contain; }
.cards2 .card2:first-child { --c: #3F8FD8; }
.cards2 .card2:last-child { --c: #C9A227; }
.theme-card { margin-top: 10px; border-radius: 22px; padding: 14px; background: var(--card); border: 1px solid var(--ln); }
.theme-card > b { font-size: 15px; font-weight: 600; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.theme-prev { border-radius: 14px; padding: 8px; border: 1px solid var(--ln); text-align: left; display: flex; flex-direction: column; }
.theme-prev i { height: 30px; border-radius: 8px; }
.theme-prev span { font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.theme-dark { background: #0D0E12; color: #EDEBF3; } .theme-dark i { background: #17181F; }
.theme-light { background: #F3F1EC; color: #17171B; } .theme-light i { background: #fff; }
.theme-auto { background: linear-gradient(135deg, #0D0E12 50%, #F3F1EC 50%); color: #7D7B88; }
.theme-prev.on { border-color: transparent; box-shadow: 0 0 0 2px var(--acc); }
#settings .section { margin-top: 10px; }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; }
.set-text { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; }
.switch { flex: none; width: 48px; height: 28px; border-radius: 14px; padding: 3px; background: var(--card2); position: relative; transition: background-color .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s var(--ease); }
.switch.on { background: var(--up); }
.switch.on::after { transform: translateX(20px); }
.app-sign { text-align: center; font-size: 12px; color: var(--dim); margin-top: 16px; }
.badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.badge.own { background: color-mix(in oklch, var(--up) 22%, var(--card2)); color: var(--up); }
.badge.wait { background: var(--card2); color: var(--mu); }

/* ---------- dock ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: center; max-width: 600px; margin: 0 auto;
  padding: 28px 14px calc(14px + var(--safe-b)); background: linear-gradient(180deg, transparent, var(--bg) 40%); pointer-events: none; }
.dock > * { pointer-events: auto; }
.tabbar { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 60px; padding: 4px; border-radius: 22px; background: var(--card); border: 1px solid var(--ln); }
.tab { border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--mu); min-width: 0; }
.tab svg { width: 22px; height: 22px; }
.tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.active { background: var(--tx); color: var(--bg); }
.dock-me { flex: none; width: 60px; height: 60px; border-radius: 50%; background: var(--card); border: 1px solid var(--ln); display: grid; place-items: center; transition: box-shadow .2s; }
.dock-me.active { box-shadow: 0 0 0 2px var(--acc); }
.me-ava { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #B9A2FF; color: #1A1033; font-weight: 700; font-size: 16px; }
.dock-me > svg { color: var(--mu); }

/* ---------- states ---------- */
.empty { margin-top: 16px; padding: 28px 18px; border-radius: 22px; background: var(--card); border: 1px solid var(--ln); text-align: center; color: var(--mu); font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty-title { color: var(--tx); font: 700 15px var(--f-head); }
.empty .primary-btn, .empty .cell.action-cell { margin-top: 10px; height: 46px; width: auto; padding: 0 22px; border-radius: 14px; background: var(--tx); color: var(--bg); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.skeleton-cell { height: 64px; background: var(--card); }
.skeleton-block { background: var(--card); border-radius: 26px; height: 300px; margin-top: 12px; }
.skeleton-cell, .skeleton-block { animation: breathe 1.1s linear infinite alternate; }
@keyframes breathe { from { opacity: .55; } to { opacity: 1; } }
.enter { animation: enter .28s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(96px + var(--safe-b)); z-index: 50; max-width: 420px; margin: 0 auto; padding: 13px 18px; border-radius: 16px; background: var(--tx); color: var(--bg); font-size: 14.5px; font-weight: 600; text-align: center; pointer-events: none; opacity: 0; transform: translateY(8px); transition: transform .2s var(--ease), opacity .2s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.credit { display: block; margin: 14px auto 0; padding: 8px 10px; font-size: 11.5px; color: var(--dim); text-align: center; }
.drag-scroll { cursor: grab; }

/* ---------- first launch ---------- */
.ob { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; padding: calc(18px + max(env(safe-area-inset-top), var(--safe-t))) 24px calc(30px + env(safe-area-inset-bottom)); background: var(--bg); animation: sheet-fade .3s var(--ease); }
.ob-skip { align-self: flex-end; min-height: 40px; padding: 0 12px; color: var(--mu); font-weight: 600; font-size: 14px; display: grid; place-items: center; }
.ob-art { position: relative; height: 300px; display: grid; place-items: center; margin-top: 8px; }
.ob-gem { width: 112px; height: 112px; border-radius: 32px; display: grid; place-items: center; color: var(--acc); background: linear-gradient(180deg, color-mix(in oklch, var(--acc) 26%, var(--card)), var(--card)); border: 1px solid var(--ln); }
.ob-gem svg { width: 56px; height: 56px; }
.ob-markets .ob-gem { color: var(--gram); }
.ob-logo { position: absolute; width: 58px; height: 58px; border-radius: 50%; box-shadow: 0 0 0 4px var(--bg); }
.ob-l0 { left: 8%; top: 6%; } .ob-l1 { right: 8%; top: 2%; } .ob-l2 { left: 0; bottom: 18%; } .ob-l3 { right: 2%; bottom: 14%; } .ob-l4 { left: 42%; bottom: 0; }
.ob-title { margin: 18px 0 0; font: 700 26px/1.15 var(--f-head); letter-spacing: -.02em; }
.ob-text { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--mu); }
.ob-foot { margin-top: auto; display: grid; gap: 18px; }
.ob-dots { display: flex; justify-content: center; gap: 6px; }
.ob-dots span { width: 6px; height: 6px; border-radius: 999px; background: var(--dim); transition: width .2s; }
.ob-dots span.on { width: 22px; background: var(--tx); }
.ob-next { min-height: 56px; border-radius: 18px; font-weight: 600; font-size: 16px; color: var(--bg); background: var(--tx); display: grid; place-items: center; }

/* ---------- animations off ---------- */
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (hover: hover) {
  button.cell:hover, .picker-row:hover { background: var(--card2); }
}

/* gift photo cards: the picture (backdrop, symbols, model) on top, whole and uncropped;
   under it the picture's own bottom edge carries the backdrop colour behind the text. No blur. */
.gcard:has(> .gc-bg) { padding: 0 6px 10px; justify-content: flex-start; color: #fff; border: 0; background: #1a1a20; }
.gcard:has(> .gc-bg) > .gc-art:not(.fallback):not(.market-art) { position: relative; z-index: -1; width: calc(100% + 12px); height: auto; aspect-ratio: 1; margin: 0 -6px; border-radius: 0; object-fit: cover; -webkit-mask-image: none; mask-image: none; }
/* only the picture's bottom edge, stretched down: the backdrop colour continues under the text */
.gcard:has(> .gc-bg) > .gc-bg { display: block; position: absolute; left: 0; right: auto; top: auto; bottom: 0; width: 100%; height: 2400%; object-fit: fill; opacity: 1; filter: none; z-index: -2; transform: none; }
.gcard:has(> .gc-bg) > .gc-art.market-art, .gcard:has(> .gc-bg) > .gc-art.fallback { margin-top: 10px; }
.gcard:has(> .gc-bg)::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .18) 75%, rgba(0, 0, 0, .32)); }
.gcard:has(> .gc-bg) .gc-name { margin-top: 6px; text-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.gcard:has(> .gc-bg) .gc-num { color: rgba(255, 255, 255, .75); }
.gcard:has(> .gc-bg) .gc-price { margin-top: 4px; }
.gcard:has(> .gc-bg) .gc-price .chg.up { color: #7CF0A6; }
.gcard:has(> .gc-bg) .gc-price .chg.down { color: #FF9AA6; }
.lot-card::after { display: none; }
.lot-card > .gc-bg { display: none !important; }
.lot-card > .gc-art:not(.fallback):not(.market-art) { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; margin: 0 !important; aspect-ratio: auto !important; z-index: 0 !important; }
/* search lots: the whole card is the gift */
.lot-card > .gc-art:not(.fallback):not(.market-art) { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; margin: 0; -webkit-mask-image: none; mask-image: none; }
.lot-card .gc-num, .lot-card .lot-plate { z-index: 1; }

/* portfolio cards drawn from the gift's parts: backdrop gradient over the whole card,
   the symbol scattered across it, the model on top, the text at the bottom. */
.gcard-built { padding: 0 6px 10px; border: 0; color: #fff; justify-content: flex-start;
  background: radial-gradient(circle at 50% 36%, var(--bd-c), var(--bd-e) 78%); }
.gc-pattern { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.gc-pattern img { position: absolute; aspect-ratio: 1; object-fit: contain; filter: brightness(0); opacity: .2; }
.gc-model { width: 78%; aspect-ratio: 1; height: auto; margin-top: 10%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.gc-model.market-art { width: calc(100% + 12px); margin: 0 -6px; object-fit: cover; }
.gc-model.fallback { border-radius: 50%; width: 60%; font-size: 26px; background: rgba(0, 0, 0, .15); }
.gcard-built .gc-name { margin-top: 2px; text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.gcard-built .gc-num { color: rgba(255, 255, 255, .75); }
.gcard-built .gc-price { margin-top: 4px; text-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.gcard-built .gc-price .chg.up { color: #B8FFD0; }
.gcard-built .gc-price .chg.down { color: #FFC2CA; }

/* search lots drawn from parts */
.lot-built { background: radial-gradient(circle at 50% 40%, var(--bd-c), var(--bd-e) 80%); }
.lot-built .gc-model { width: 66%; margin-top: 12%; }
.lot-built .gc-num, .lot-built .lot-plate { z-index: 1; }
/* the gift's own page: backdrop, symbols and model, sharp at any size */
.gift-built { background: radial-gradient(circle at 50% 42%, var(--bd-c), var(--bd-e) 80%); }
.gift-built .gc-pattern { z-index: 0; }
.gift-built .gc-pattern img { opacity: .16; }
.gift-built .gift-art { display: grid; place-items: center; padding-bottom: 40px; z-index: 1; }
.gift-model { width: 62%; max-width: 230px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .3)); }
.gift-model.market-art { width: 100%; height: 100%; max-width: none; object-fit: cover; padding: 0; }
.gift-built .gift-plate { z-index: 2; }

/* ---------- gift estimate ---------- */
.est-card { margin: 12px 0; padding: 14px 16px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--ln); }
.est-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.est-k { font: 600 13px var(--f-text); color: var(--mu); }
.est-v, .est-v .ton { font: 600 24px var(--f-num); letter-spacing: -.5px; }
.est-range { display: block; margin-top: 2px; text-align: right; font-size: 12px; color: var(--mu); }
.est-range .ton { font-size: 12px; color: var(--mu); }
.est-basis { margin-top: 10px; border-top: 1px solid var(--ln); }
.est-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--ln); font-size: 13.5px; }
.est-row:last-child { border-bottom: 0; padding-bottom: 0; }
.est-label { min-width: 0; }
.est-label small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--mu); }
.liq-pill { padding: 4px 10px; border-radius: 999px; font: 600 12px var(--f-text); }
.liq-pill.hi { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }
.liq-pill.mid { background: color-mix(in srgb, var(--acc) 18%, transparent); color: var(--acc); }
.liq-pill.lo { background: color-mix(in srgb, var(--dn) 16%, transparent); color: var(--dn); }
.model-hist:empty { display: none; }
.model-hist { margin: 12px 0; }
.model-chart { margin-top: 6px; padding: 12px 10px 6px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--ln); }
.model-hist-note { margin: 6px 4px 0; font-size: 12px; color: var(--mu); }

/* ---------- alert kinds ---------- */
.alert-kind { margin-top: 12px; position: relative; z-index: 1; }
.alert-fields .kind-move, .alert-fields .kind-volume { display: none; grid-column: 1 / -1; }
.alert-fields[data-kind="move"] .kind-price, .alert-fields[data-kind="volume"] .kind-price { display: none; }
.alert-fields[data-kind="move"] .kind-move, .alert-fields[data-kind="volume"] .kind-volume { display: flex; }
.alert-fields[data-kind="move"] #alert-col-btn, .alert-fields[data-kind="volume"] #alert-col-btn { grid-column: 1 / -1; }
