/* Биржа использует карточки, монету и кнопки общего интерфейса. */
.market-tabs { display:flex; gap:5px; overflow:auto; padding:8px 0; }
.market-tabs button { flex:1; white-space:nowrap; border:1px solid #383149; background:#181321; color:#a9a3b5; border-radius:9px; padding:10px 8px; font:inherit; font-size:12px; }
.market-tabs button.on { background:#282039; border-color:#a687f4; color:#eee3ff; }
.market-tools { display:flex; align-items:center; gap:7px; margin:7px 0 15px; }
.market-tools .btn:first-child { flex:1; }
#worldMarket input,#worldMarket select,.market-field input,.market-field select { width:100%; min-width:0; box-sizing:border-box; color:#efe9f9; background:#181321; border:1px solid #40354f; border-radius:10px; padding:12px; font:inherit; font-size:16px; }
.market-selects { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:8px; }
.market-selects select:last-child { grid-column:1/-1; }
.market-summary { font-size:12px; color:#bcb4cc; line-height:1.6; }
.market-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 9px; padding:0 0 18px; }
.market-tile { display:flex; flex-direction:column; gap:5px; min-width:0; padding:0 0 10px; background:#181321; color:#eae5f2; border:1px solid #342b42; border-radius:14px; overflow:hidden; text-align:center; font:inherit; }
.market-tile > .card { --card-w:100%; width:100%; }
.market-tile > span,.market-tile > small { padding:0 5px; font-size:11px; overflow-wrap:anywhere; }
.market-tile > .market-price { display:flex; align-items:center; justify-content:center; gap:6px; padding-top:3px; font-size:20px; font-weight:700; color:#ffe091; }
.market-tile .market-price .coin { width:20px; height:20px; }
.market-tile > small { color:#a59bb5; }
.market-preview { width:min(190px,70%); margin:0 auto 18px; }
.market-preview .card { --card-w:100%; width:100%; cursor:pointer; }
.market-field { display:block; margin:15px 0; color:#c3b8d5; font-size:13px; }
.market-field input,.market-field select { display:block; margin-top:7px; }
.market-field[hidden] { display:none; }
.market-detail { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.market-detail > b { display:flex; gap:6px; align-items:center; font-size:24px; color:#ffe091; }
.market-detail .coin { width:24px; height:24px; }
.market-detail > span { font-size:13px; color:#b9adc9; }
.market-estimate { padding:14px; margin:16px 0; background:#221a30; border-radius:12px; line-height:1.6; font-size:13px; }
.market-estimate small { display:block; color:#ac9dbc; font-size:11px; margin-top:5px; }
.market-error { color:#ffa4b7; font-size:13px; overflow-wrap:anywhere; }
.market-error:empty { display:none; }
.market-picker { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:15px 0; }
.market-pick-card { min-width:0; display:block; padding:0; border:2px solid transparent; border-radius:12px; color:inherit; background:transparent; }
.market-picker .card { --card-w:100%; width:100%; }
.market-pick-card.selected { border-color:#8df5b5; box-shadow:0 0 0 2px #224d36; }
.market-trade { grid-column:1/-1; display:flex; flex-direction:column; gap:8px; padding:15px; text-align:left; color:#eae5f2; background:#20172d; border:1px solid #49365e; border-radius:12px; font:inherit; font-size:13px; overflow-wrap:anywhere; }
.market-trade small { color:#b5a4c7; }
.market-trade[data-direction="incoming"] { border-left:3px solid #74dfdf; }
.market-trade[data-direction="outgoing"] { border-left:3px solid #c1a0ff; }
.market-trade[data-state="accepted"] { background:#162920; }
.market-trade:is([data-state="cancelled"],[data-state="expired"],[data-state="unavailable"]) { background:#1b1822; }
.market-trade-badges { display:flex; flex-wrap:wrap; gap:6px; }
.market-trade-direction,.market-trade-status { display:inline-flex; align-items:center; padding:5px 8px; border:1px solid; border-radius:7px; font-size:11px; line-height:1.4; }
.market-trade-direction.incoming { color:#a0eeee; background:#173338; border-color:#34696e; }
.market-trade-direction.outgoing { color:#d5bcff; background:#322346; border-color:#71538e; }
.market-trade-status { color:#c7c1d1; background:#282431; border-color:#524959; }
.market-trade-status[data-state="active"] { color:#bbdaff; background:#1b2e49; border-color:#496890; }
.market-trade-status[data-state="accepted"] { color:#a2f1b9; background:#193b28; border-color:#3e7851; }
.market-trade-status:is([data-state="declined"],[data-state="unavailable"]) { color:#ffb2bd; background:#421f2b; border-color:#8d4a5d; }
.market-trade-status[data-state="expired"] { color:#f1d49a; background:#3b3020; border-color:#80673b; }
.market-card-status { display:flex; width:fit-content; align-items:center; margin:8px auto 0; padding:8px 12px; color:#ffe5a5; background:#3a2c17; border:1px solid #967541; border-radius:9px; font-weight:600; }
.market-card-status[data-source="trade"] { color:#d5bcff; background:#322346; border-color:#71538e; }
.market-card-status[hidden] { display:none; }
#modal:has(.market-card-status:not([hidden])) .card { --card-w:min(84vw,380px,calc((100dvh - 200px) * 0.716)); }
/* Только предложение обмена — полный экран; замена содержимого возвращает обычную шторку. */
#profile:has(.market-proposal-header) { align-items:stretch; background:var(--bg-2); }
#profileBody:has(> .market-proposal-header) { height:100%; max-height:100%; border-radius:0; display:flex; flex-direction:column; overflow:hidden; padding: max(14px,env(safe-area-inset-top,0px),calc(var(--tg-safe-area-inset-top,0px) + var(--tg-content-safe-area-inset-top,0px))) 18px max(24px,env(safe-area-inset-bottom,0px),calc(var(--tg-safe-area-inset-bottom,0px) + var(--tg-content-safe-area-inset-bottom,0px))); }
.market-proposal-header { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-shrink:0; }
.market-proposal-header .icon-btn { flex-shrink:0; font-size:26px; width:40px; height:40px; }
.market-proposal-content { display:grid; align-content:start; gap:14px; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding-bottom:4px; }
.market-exchange { display:flex; flex-direction:column; gap:8px; text-align:center; padding:16px; border-radius:12px; background:#231a30; overflow-wrap:anywhere; }
.market-reserved { position:absolute; left:5px; right:5px; bottom:5px; z-index:4; background:#291837ee; color:#f0ceff; border-radius:5px; padding:4px; font-size:9px; text-align:center; pointer-events:none; }
.market-empty { grid-column:1/-1; font-size:13px; color:#ac9dbc; }
.market-tile:focus-visible,.market-tabs button:focus-visible,.market-pick-card:focus-visible,.market-trade:focus-visible { outline:2px solid #a9f0ce; outline-offset:3px; }
@media(max-width:380px) { .world-mode button { padding:9px 6px; font-size:11px; } .market-tabs button { font-size:11px; padding:9px 6px; } .market-picker { gap:5px; } }
.world #worldGrid[hidden],.world #worldMore[hidden],.world #worldMarket[hidden] { display:none; }
.world-mode { grid-template-columns:repeat(3,minmax(0,1fr)); }
