/* 02.12, Telegram Маркет round. Loaded last. The user's list: no Windows-style selection anywhere, the market filter
   inside the history search field, a gliding highlight on the history tabs, a readable backdrop picker, gifts that open
   inside MAVRO instead of folding it away; plus the Telegram bits (Stars price line on a purchase). */

/* ---------- No focus frames, tap squares or text-selection boxes anywhere (user: «виндовские выделения») ----------
   Text stays selectable where it is typed; addresses have their own copy buttons. */
*,*::before,*::after{-webkit-tap-highlight-color:transparent}
html,body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea,[contenteditable]:not([contenteditable=false]){-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
img,svg,a{-webkit-user-drag:none}
:focus,:focus-visible{outline:none!important}
.adm-switch input:focus-visible+i,.ad-switch-input:focus-visible+.ad-switch-track{outline:none!important}
::selection{background:rgb(var(--accent-rgb) / .3)}
.subscriptions-grid .subscription:has(.card-edit:focus-visible){outline:none!important}

/* ---------- History tabs: one highlight glides to the chosen tab ---------- */
.history-tabs{position:relative;isolation:isolate}
.history-tab-glider{position:absolute;left:0;top:0;width:0;height:0;border-radius:999px;background:#353942;z-index:-1;pointer-events:none;opacity:0;
  transition:transform .42s cubic-bezier(.32,.72,0,1),width .42s cubic-bezier(.32,.72,0,1),height .42s cubic-bezier(.32,.72,0,1),background-color .35s,opacity .2s}
.history-tab-glider[data-ready]{opacity:1}
:root[data-accent] .history-tab-glider{background:rgb(var(--accent-rgb) / .2)}
.history-tabs.has-glider button,.history-tabs.has-glider button[aria-pressed=true],.history-tabs.has-glider button:hover{background:transparent!important}
.history-tabs.has-glider button{transition:color .3s ease}

/* ---------- History: the market filter is a chip inside the search field ---------- */
.history-search-row{max-width:680px}
.history-search-row>.history-search{flex:1 1 auto;min-width:0;position:relative}
.history-search>input{padding-right:118px}
.history-search>.history-market{position:absolute;right:6px;top:50%;transform:translateY(-50%);z-index:1;min-width:0;max-width:58%}
.history-search .history-market .choice-trigger{width:auto;max-width:100%;min-height:36px;height:36px;padding:0 10px 0 9px;gap:6px;border:0;border-radius:999px;background:#ffffff12;color:var(--text);font-size:13px;font-weight:600;box-shadow:none}
.history-search .history-market .choice-trigger:hover{background:#ffffff1c}
.history-search .history-market .choice-trigger[aria-expanded=true]{background:#ffffff24}
.history-search .history-market .choice-trigger>.icon,.history-search .history-market .choice-trigger>svg{width:14px;height:14px;opacity:.55;flex:none}
.history-search .history-market .choice-trigger-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-search .history-market .choice-previews{display:flex;flex:none}
.history-search .history-market .choice-previews:empty{display:none}
.history-search .history-market .choice-previews .choice-art{width:20px;height:20px;border:0;border-radius:6px;background:transparent}
.choice-art-market img{filter:brightness(0) invert(1)!important}
@media(max-width:760px){.history-search-row>.history-search{flex:1 1 100%}}

/* ---------- History: the list dims while another tab loads and the new one fades in ---------- */
.history-results>*{transition:opacity .2s ease}
.history-results[aria-busy=true]>.history-feed,.history-results[aria-busy=true]>.txv-missed{opacity:.45}
.history-feed.is-entering,.history-results>.txv-missed{animation:history-in .34s cubic-bezier(.22,1,.36,1) backwards}
@keyframes history-in{from{opacity:0}to{opacity:1}}

/* ---------- Backdrop picker: a palette of real swatches with whole names ---------- */
.choice-popover.choice-backdrops .choice-options{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(104px,1fr))!important;grid-auto-rows:max-content;gap:8px!important;padding:10px!important;align-content:start}
.choice-popover.choice-backdrops .choice-option{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:7px;min-height:112px!important;height:auto;padding:6px 6px 9px!important;text-align:center;position:relative;border-radius:16px!important;font-size:13px}
.choice-popover.choice-backdrops .choice-art{width:100%!important;height:auto!important;aspect-ratio:16/10;border-radius:12px!important;box-shadow:inset 0 0 0 1px #ffffff14}
.choice-popover.choice-backdrops .choice-option-label{display:block;flex:none;min-width:0;max-width:100%;font-size:14px!important;font-weight:600;line-height:1.25!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;color:var(--text)}
.choice-popover.choice-backdrops .choice-option-meta{display:block;margin-top:2px;font-size:11.5px;font-weight:500;color:var(--muted);white-space:normal!important}
.choice-popover.choice-backdrops .choice-check{position:absolute;right:12px;top:12px;width:20px!important;height:20px!important;box-shadow:0 1px 6px #0009}
.choice-popover.choice-backdrops .choice-option[aria-selected=true]{background:#ffffff10}
.choice-popover.choice-backdrops .choice-option[aria-selected=true] .choice-art{box-shadow:0 0 0 2px var(--text,#fff),inset 0 0 0 1px #0003}

/* ---------- Gift sheet: a gift opens inside MAVRO, stacked over whatever is open ---------- */
dialog#gift-modal{position:fixed;inset:0;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:calc(16px + var(--safe-top) + var(--content-top)) max(12px,var(--safe-right)) calc(16px + var(--safe-bottom)) max(12px,var(--safe-left));border:0;border-radius:0;background:transparent;box-shadow:none;overflow:hidden;backdrop-filter:none;-webkit-backdrop-filter:none;color:var(--text)}
dialog#gift-modal[open]{display:flex;align-items:center;justify-content:center}
#gift-modal .dialog-panel{width:min(420px,100%);animation:gift-sheet-in .32s cubic-bezier(.22,1,.36,1) both}
@keyframes gift-sheet-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.gift-sheet .dialog-body{display:flex;flex-direction:column;align-items:stretch;padding-bottom:18px}
.gift-sheet-art.purchase-art{width:min(240px,72%);height:auto;aspect-ratio:1;margin:6px auto 16px;border-radius:28px}
.gift-sheet-art .purchase-model{width:78%!important;height:78%!important}
.gift-sheet-facts{display:grid;margin:0 0 4px;padding:4px;border-radius:18px;background:#ffffff06;box-shadow:inset 0 0 0 1px #ffffff08}
.gift-sheet-facts>div{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:6px 12px}
.gift-sheet-facts>div+div{box-shadow:0 -1px 0 #ffffff0a}
.gift-sheet-facts dt{color:var(--muted);font-size:14px}
.gift-sheet-facts dd{margin:0;min-width:0;font-size:14px;font-weight:600;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gift-sheet-actions{display:grid!important;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.gift-sheet-actions button{width:100%;justify-content:center}
.gift-sheet-note{margin:10px auto 0;color:var(--muted);font-size:12.5px;text-align:center}
@media(max-width:760px){
  dialog#gift-modal{padding:calc(28px + var(--safe-top) + var(--content-top)) 0 0}
  dialog#gift-modal[open]{align-items:flex-end}
  #gift-modal .dialog-panel{width:100%}
  .gift-sheet .dialog-body{padding-bottom:calc(18px + var(--safe-bottom))}
}

/* ---------- Telegram Маркет purchase: the seller's price in Stars under the TON paid ---------- */
.purchase-value>small.purchase-stars{grid-column:1 / -1;margin:3px 0 6px;color:var(--soft,#c7cdd7);font-size:12px}

/* Autonomous marketplace services share the profile's live reader cards. */
.reader-card[data-activity=true] .activity-note{margin-top:10px;line-height:1.45}
.reader-card[data-activity=true] .activity-note+.activity-note{margin-top:4px}
.reader-card[data-activity=true] .reader-metrics strong{overflow-wrap:anywhere}
