/* 02.12 Windows, sheets, lists and one colour system. Loaded after every other stylesheet on purpose. */

/* ---------- Tokens: a default accent, so «var(--accent, X)» never falls back to a stray orange, green or purple ---------- */
:root:not([data-accent]){--accent:#f2f4f8;--accent-rgb:242 242 247}
:root{--tone-warn:var(--live-warn,#ffd27a);--tone-bad:var(--live-bad,#ff8f86);--sheet:#1a1d23;--sheet-line:#ffffff14}

/* ---------- Mini app: the page never slides sideways and never zooms (pinch, double tap) ---------- */
html{overflow-x:hidden;touch-action:pan-x pan-y;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overscroll-behavior-x:none}
@supports (overflow:clip){.workspace,#content{overflow-x:clip}}

/* ---------- Dock: always full size (the 28.11 shrink to 80 % on scroll is gone) ---------- */
#navigation,.sidebar.is-compact #navigation{transform:none!important;transition:none}

/* ---------- ↑ back to the top: a round glass button like the Portals one, fades in once the page is scrolled down ---------- */
.scroll-top{position:fixed;z-index:31;left:calc(14px + var(--safe-left,0px));bottom:calc(20px + var(--safe-bottom,0px));display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:0;border-radius:50%;
  border:1px solid var(--glass-line,#ffffff2e);background:var(--glass,#1b1b1dcc);color:#fff;backdrop-filter:blur(24px) saturate(140%);-webkit-backdrop-filter:blur(24px) saturate(140%);
  box-shadow:inset 0 1px #ffffff14,0 10px 28px #0007;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .22s ease,visibility 0s linear .22s,background-color .15s}
.scroll-top.is-shown{opacity:1;visibility:visible;pointer-events:auto;transition:opacity .22s ease,visibility 0s,background-color .15s}
.scroll-top:hover{background:#2a2a2ee6}
.scroll-top:active{background:#36363ae6}
.scroll-top .icon{width:22px;height:22px;stroke-width:2.1}

/* ---------- Windows: header hairline after scrolling, a solid footer flush with the bottom edge ---------- */
.dialog-panel .dialog-head{transition:box-shadow .2s}
.dialog-panel.is-scrolled .dialog-head{box-shadow:0 1px 0 var(--sheet-line)}
.dialog-head .icon-button{width:36px;height:36px;min-height:36px;border-radius:50%;background:#ffffff12;color:#d1d1d6}
.dialog-head .icon-button:hover{background:#ffffff1f;color:#fff}
.dialog-body{padding:4px 21px 21px}
/* Old footer: a gradient «curtain» that floated over the content wherever it stood. Now: only the last row of a window
   sticks, it is solid, reaches both edges, and gets a hairline only while content scrolls underneath it. */
.dialog-actions{background:none;margin:20px 0 0;padding:0}
.dialog-body>.dialog-actions:last-child,.dialog-body>form:last-child>.dialog-actions:last-child{position:sticky;bottom:0;z-index:3;margin:22px -21px -21px;padding:14px 21px 21px;background:var(--sheet);border-top:1px solid transparent;transition:border-color .2s}
.dialog-panel.has-more-below .dialog-body>.dialog-actions:last-child,.dialog-panel.has-more-below .dialog-body>form:last-child>.dialog-actions:last-child{border-top-color:var(--sheet-line)}
.dialog-actions:not(:last-child){position:static}
.form-error:empty{display:none}
@media(max-width:760px){
  .dialog-body{padding:4px 18px calc(18px + var(--safe-bottom))}
  .dialog-body>.dialog-actions:last-child,.dialog-body>form:last-child>.dialog-actions:last-child{margin:20px -18px calc(-18px - var(--safe-bottom));padding:12px 18px calc(12px + var(--safe-bottom))}
}
/* A sticky box keeps clear of its scroller's padding: with the body's bottom padding in place the footer floated 18–21 px
   above the edge and the content showed through the gap. Where :has() exists the footer itself carries that padding. */
.dialog-body:has(>.dialog-actions:last-child),.dialog-body:has(>form:last-child>.dialog-actions:last-child){padding-bottom:0}
.dialog-body:has(>.dialog-actions:last-child)>.dialog-actions:last-child,.dialog-body:has(>form:last-child>.dialog-actions:last-child)>form:last-child>.dialog-actions:last-child{margin-bottom:0}
/* Confirmations: a calm card, red only for destructive actions. */
.dialog-panel.is-confirm{max-width:440px}
.dialog-panel.is-confirm .dialog-head{display:flex;align-items:center;gap:12px}
.confirm-badge{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#ffffff12;color:#fff;flex:none}
.dialog-panel.is-danger .confirm-badge{background:#ff453a24;color:#ff8a80}
.confirm-text{margin:4px 0 0;color:var(--soft,#c7cdd7);line-height:1.5}
button.primary.confirm-danger,button.primary.confirm-danger:hover:not(:disabled){background:#ff453a!important;color:#fff!important;border-color:transparent!important}

/* ---------- Pickers: a list under the field on wide screens, a bottom sheet on phones ---------- */
.choice-popover{border-radius:20px!important;background:#1a1d23!important;border:1px solid #ffffff14!important;box-shadow:0 24px 64px #000c,inset 0 1px #ffffff0d!important;padding:0!important;overflow:hidden}
.choice-options{padding:6px!important}
.choice-option{min-height:44px;gap:12px;padding:9px 12px;border-radius:12px!important}
.choice-option:hover:not(:disabled){background:#ffffff0a}
.choice-option[aria-selected=true]{background:#ffffff10}
.choice-popover:not(.choice-backdrops) .choice-option-label{overflow-wrap:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.choice-popover:not(.choice-backdrops) .choice-option-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}
.choice-search{padding:0 14px;border-bottom:1px solid #ffffff0f;box-shadow:none!important}
.choice-search:focus-within{box-shadow:inset 0 -1px rgb(var(--accent-rgb) / .55)!important}
.choice-popover.is-sheet{inset:auto 0 0 0!important;width:100%!important;max-width:none!important;margin:0!important;display:flex;flex-direction:column;
  border-radius:24px 24px 0 0!important;border-width:1px 0 0!important;padding:6px 8px calc(8px + var(--safe-bottom,0px))!important;box-shadow:0 -18px 60px #000c!important;animation:none!important}
.choice-popover.is-sheet::backdrop{background:rgb(0 0 0 / .55)}
.choice-grabber{display:block;flex:none;width:40px;height:5px;margin:4px auto 10px;border-radius:3px;background:#ffffff3d}
.choice-sheet-title{display:block;flex:none;padding:0 12px 10px;font-size:17px;font-weight:600;letter-spacing:-.2px}
.choice-popover.is-sheet .choice-options{flex:1;min-height:0;max-height:none!important;padding:0 0 4px!important}
.choice-popover.is-sheet .choice-option{min-height:52px;padding:10px 12px;font-size:16px}
.choice-popover.is-sheet .choice-search{margin:0 4px 6px;border-radius:14px;border:0;background:#ffffff0d}
.choice-popover.is-sheet .choice-footer{padding:8px 4px 0}
/* Accounts: round avatar over a letter, so a missing photo still looks finished. */
.choice-art-account{position:relative;border-radius:50%!important;background:#2a2d33!important}
.choice-art-account img{object-fit:cover!important;border-radius:50%}
.choice-initial{font-size:14px;font-weight:700;color:#d1d1d6;line-height:1}
.choice-previews .choice-art-account .choice-initial{font-size:13px}

/* ---------- One focus ring: inputs light up their own border, no outline drawn around them as well ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]):focus-visible,textarea:focus-visible,select:focus-visible{outline:none!important}
input:not([type=checkbox]):not([type=radio]):not([type=range]):focus,textarea:focus{border-color:rgb(var(--accent-rgb) / .6)!important;box-shadow:none!important}
.search-field:focus-within{outline:none}
.choice-search input:focus,.choice-search input:focus-visible,.ad-input:focus,.ad-input:focus-visible{border-color:transparent!important}
.ad-input-wrap:focus-within{border-color:rgb(var(--accent-rgb) / .6)}

/* ---------- Toasts: a pill with a tone ---------- */
.toast:not([hidden]){display:flex;align-items:center;gap:10px}
.toast.is-leaving{opacity:0;transition:opacity .2s}
.toast-icon{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;flex:none;background:#ffffff1a}
.toast[data-kind=ok] .toast-icon{background:color-mix(in srgb,var(--ok) 24%,transparent);color:var(--ok)}
.toast[data-kind=error]{background:#3b1f1ef5!important;color:#ffdcd8!important}
.toast[data-kind=error] .toast-icon{background:#ff453a33;color:#ff8a80}
.toast-text{min-width:0}

/* ---------- Endless lists ---------- */
.feed-tail{display:flex;align-items:center;justify-content:center;gap:12px;min-height:52px;padding:10px 0;color:var(--muted);font-size:13px;text-align:center}
.feed-tail[data-state=idle]{min-height:24px}
.feed-dots{display:inline-flex;gap:6px}
.feed-dots i{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.35;animation:feed-dot 1s ease-in-out infinite}
.feed-dots i:nth-child(2){animation-delay:.15s}
.feed-dots i:nth-child(3){animation-delay:.3s}
@keyframes feed-dot{0%,100%{opacity:.25}50%{opacity:1}}
.feed-retry{min-height:34px;padding:6px 14px;font-size:13px}

/* ---------- Subscription cards: the whole card is the way into the editor ---------- */
.subscription{cursor:pointer}
.subscription .switch,.subscription .card-delete,.subscription .card-price-check{cursor:pointer}

/* ---------- Profile ---------- */
.stat-tiles-1{grid-template-columns:1fr!important}
:root[data-accent] .mavro-hero{box-shadow:inset 0 0 0 1px #ffffff14,inset 0 1px 0 #ffffff26}
/* Buyer card: identity + one status, then the balances as a grouped list. */
.trading-buyer-card .buyer-heading,.getgems-card .buyer-heading{display:flex;align-items:center;gap:12px;margin-bottom:14px;min-width:0}
.trading-buyer-card .buyer-identity,.getgems-card .buyer-identity{flex:1}
.trading-buyer-card .buyer-avatar{border-radius:50%}
.buyer-avatar span,.profile-avatar span{pointer-events:none}
.buyer-status{display:inline-flex;align-items:center;gap:6px;max-width:48%;min-width:0;margin-left:auto;padding:5px 10px;border-radius:999px;background:#ffffff0a;color:var(--soft);font-size:12px;font-weight:600;white-space:nowrap;flex:none}
.buyer-status>i{width:7px;height:7px;border-radius:50%;flex:none;background:var(--ok);box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 20%,transparent)}
.buyer-status[data-state=warn]{color:#ffe2b0;background:#ffd27a14}
.buyer-status[data-state=warn]>i{background:var(--tone-warn);box-shadow:0 0 0 3px #ffd27a26}
.buyer-status{overflow:hidden;text-overflow:ellipsis}
.buyer-tiles{display:grid;gap:0;padding:4px;border-radius:18px;background:#ffffff06;box-shadow:inset 0 0 0 1px #ffffff08}
.buyer-tile{display:flex;align-items:center;gap:10px;min-height:46px;padding:6px 10px;border-radius:14px;min-width:0}
.buyer-tile+.buyer-tile{box-shadow:0 -1px 0 #ffffff0a}
.buyer-tile-head{display:flex;align-items:center;gap:10px;flex:1;min-width:0;color:var(--soft);font-size:14px;font-weight:600}
.buyer-tile-art{display:grid;place-items:center;width:24px;height:24px;flex:none;color:#fff}
.buyer-tile-art img,.buyer-tile-art svg,.buyer-tile-art .icon{width:20px;height:20px}
.buyer-tile[data-buyer-market=stars] .buyer-tile-art .icon{width:19px;height:19px}
.buyer-tile-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.buyer-tile-dot{width:6px;height:6px;border-radius:50%;flex:none;background:var(--ok)}
.buyer-tile[data-state=stale] .buyer-tile-dot{background:var(--tone-warn)}
.buyer-tile[data-state=off] .buyer-tile-dot{background:var(--tone-bad)}
.buyer-tile-value{flex:none;font-size:17px;font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap}
.buyer-tile-value span{font-size:12px;font-weight:700;letter-spacing:0;color:var(--muted)}
.buyer-tile[data-state=off] .buyer-tile-value{color:var(--muted)}
/* Getgems: its own card (own wallet, own status). */
.getgems-card{max-width:920px;padding:16px!important}
.getgems-card .buyer-identity small{display:block;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.35}
.gg-logo{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#ffffff0d;flex:none}
.gg-logo img,.gg-logo svg{width:28px;height:28px}
.gg-body{display:grid;grid-template-columns:minmax(150px,auto) minmax(0,1fr);gap:18px;align-items:start}
.gg-balance{padding:6px 2px 0;font-size:30px;font-weight:600;letter-spacing:-.04em;line-height:1.05;font-variant-numeric:tabular-nums;white-space:nowrap}
.gg-balance span{font-size:14px;font-weight:700;letter-spacing:0;color:var(--muted)}
.gg-facts{display:grid;padding:4px;border-radius:18px;background:#ffffff06;box-shadow:inset 0 0 0 1px #ffffff08}
.gg-fact{display:flex;align-items:center;gap:12px;min-height:44px;padding:6px 10px;min-width:0}
.gg-fact+.gg-fact{box-shadow:0 -1px 0 #ffffff0a}
.gg-fact small{flex:1;min-width:0;color:var(--muted);font-size:13px}
.gg-fact>span{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;font-size:14px;font-weight:600;text-align:right}
.gg-fact code{font-family:inherit;font-variant-numeric:tabular-nums;color:var(--soft);white-space:nowrap}
.gg-fact em{font-style:normal;font-size:12px;font-weight:500;color:var(--muted);white-space:nowrap}
.gg-copy{display:grid;place-items:center;width:30px!important;height:30px!important;min-width:30px;min-height:30px!important;padding:0!important;border:0;border-radius:50%;background:#ffffff10;color:var(--soft)}
.gg-copy:hover{background:#ffffff1c;color:#fff}
.gg-copy .icon{width:15px;height:15px}
@media(max-width:760px){.gg-body{grid-template-columns:1fr;gap:12px}.buyer-status{max-width:52%}}

/* ---------- Admin: the letter stays under the photo ---------- */
.adm-avatar.adm-avatar-empty{position:relative;overflow:hidden}
.adm-avatar-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%}

/* ---------- «Массовые действия» ---------- */
.batch-lead{margin:0 0 14px!important;color:var(--muted);font-size:14px;line-height:1.45}
.batch-scope{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0 0 16px;padding:4px;border-radius:16px;background:#ffffff08}
.batch-scope button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1px;min-height:50px;padding:7px 14px;border:0;border-radius:12px;background:transparent;color:var(--soft);font-size:14px;font-weight:700;text-align:left}
.batch-scope button small{font-size:12px;font-weight:500;color:var(--muted)}
.batch-scope button[aria-pressed=true]{background:#ffffff14;color:#fff}
.batch-group{margin:0 0 14px}
.batch-group h3{margin:0 0 8px;font-size:12px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.batch-chips{display:flex;flex-wrap:wrap;gap:8px}
.batch-chip{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:8px 14px;border:1px solid #ffffff14;border-radius:999px;background:#ffffff06;color:var(--soft);font-size:14px;font-weight:600;line-height:1.2}
.batch-chip:hover{background:#ffffff0d;color:#fff}
.batch-chip[aria-pressed=true]{border-color:rgb(var(--accent-rgb) / .7);background:rgb(var(--accent-rgb) / .14);color:#fff}
.batch-chip[data-action=delete][aria-pressed=true]{border-color:#ff8a8099;background:#ff453a1f;color:#ffb4ad}
.batch-chip .icon{width:15px;height:15px}
.batch-chip img{width:16px;height:16px}
.batch-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.batch-row+.batch-row{margin-top:8px}
.batch-row-label{flex:0 0 120px;color:var(--soft);font-size:14px;font-weight:600}
.batch-row .batch-chips{flex:0 1 auto}
.batch-percent{margin:12px 0 4px}
.batch-percent .price-presets{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.batch-note{min-height:20px;margin:4px 0 0!important;color:var(--muted);font-size:13px;line-height:1.45}

/* ---------- Автопополнение: explicit state per buyer, «Пополнить сейчас» per market ---------- */
.ad-buyer{grid-template-columns:minmax(0,1fr) auto minmax(0,auto)}
.ad-buyer small{min-width:0;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ad-buyer[data-state=low] small{color:var(--tone-warn)}
.ad-buyer[data-state=move] small{color:var(--ok)}
.ad-now-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;padding-top:2px}
.ad-now{min-height:40px!important;padding:8px 14px!important;font-size:14px!important;border-radius:999px!important}
.ad-now-note{color:var(--muted);font-size:12px}
.ad-planner{overflow-wrap:anywhere}
@media(max-width:520px){.ad-buyer{grid-template-columns:minmax(0,1fr) auto}.ad-buyer small{grid-column:1/-1;max-width:none;text-align:left}}

/* ---------- One colour for «good»: the accent when a wallpaper sets one, the noir green otherwise ---------- */
.status[data-valid=true],.purchase-badges [data-stage=purchased],.shared-market-card [data-valid=true],.txv-status[data-tone=ok]{background:color-mix(in srgb,var(--ok) 13%,transparent);color:var(--ok)}
.runtime.running .runtime-dot,.buyer-connection[data-connected=true] i{background:var(--ok)}
.buyer-connection[data-connected=true] i{box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 20%,transparent)}
.mavro-hero.running .hero-state i,.profile-pill.running i,.rps-total i{box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 18%,transparent)}.mp-chip[data-tone=up]{background:color-mix(in srgb,var(--ok) 14%,transparent);color:var(--ok)}
.txv-verdict[data-tone=ok],.purchase-txv b[data-tone=up],.txv-pf-delta[data-tone=up],.txv-pf-deal-side b[data-tone=up],.celebrate-speed{color:var(--ok)}
.ad-entry .adm-entry-count[data-on=true]{color:var(--ok)}
.ad-switch-input:checked+.ad-switch-track{background:var(--accent)}
.ad-wallet button.ad-copy[data-done=true]{background:color-mix(in srgb,var(--ok) 16%,transparent)!important;border-color:color-mix(in srgb,var(--ok) 45%,transparent)!important}
.ad-wallet button.ad-copy[data-done=true] svg{stroke:var(--ok)!important;color:var(--ok)!important}
