/* Мобильная копия (/mt5m/): один график сверху, торговая панель под ним, позиции и журнал ниже.
   Страница прокручивается целиком; кнопки крупнее под палец. Подключается поверх style.css. */
html, body { height: auto; min-height: 100%; overflow: auto; font-size: 14px; }
body { display: block; -webkit-tap-highlight-color: transparent; }

#top { flex-wrap: wrap; gap: 6px; padding: 6px 8px; white-space: normal; position: sticky; top: 0; z-index: 20; background: #131722; }
#sym { width: 112px; font-size: 15px; }
#favs, #tfs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
#favs::-webkit-scrollbar, #tfs::-webkit-scrollbar { display: none; }
#favs button { padding: 7px 10px; }
#tfs { order: 5; width: 100%; }
#tfs button { padding: 7px 10px; flex: 1; }
#layouts, .grow { display: none !important; }
#quote { order: 6; width: 100%; font-size: 13px; }
#acc { order: 7; font-size: 12px; white-space: normal; }
#badge { order: 8; font-size: 12px; }
#helpbtn { order: 9; }

#main { display: flex; flex-direction: column; }
#left { display: contents; }
#grid { order: 1; flex: none; height: 58vh; min-height: 300px; }
#panel { order: 2; width: auto; border-left: 0; border-top: 1px solid #2a2e39; padding: 10px; overflow: visible; gap: 9px; }
#bottom { order: 3; }
#bbody { height: 45vh !important; }
#bgrip { display: none; }

#lots button { padding: 11px 0; font-size: 15px; }
#lotin { padding: 9px 8px; font-size: 15px; }
.buy, .sell { padding: 17px 0; font-size: 17px; }
#panel .arm, #panel .cls, #panel #cancel { padding: 11px 4px; font-size: 15px; }
#panel .chk { padding: 4px 0; }
#panel .chk input { width: 18px; height: 18px; }
#riskbox input, #riskbox button { padding: 9px 6px; font-size: 15px; }
#log { max-height: 140px; overflow: auto; }

/* рисование и подсказки по наведению под палец не годятся */
#drawbar, #eapop { display: none !important; }
#hint { font-size: 12px; white-space: normal; max-width: calc(100% - 20px); }
.lbl { touch-action: none; height: 24px; font-size: 13px; }
.lbl .x { height: 20px; line-height: 20px; padding: 0 8px; font-size: 16px; }
#gotoend { width: 36px; height: 36px; font-size: 20px; }

/* вход по паролю агента */
#tokdlg { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: center; align-items: center; background: #131722f2; padding: 20px; }
#tokdlg form { max-width: 360px; width: 100%; }
#tokdlg input { width: 100%; padding: 11px; font-size: 16px; background: #1e222d; color: #fff; border: 1px solid #363a45; border-radius: 4px; }
#noagent { font-size: 14px; }
#helpdlg { padding: 8px 4px; } #helpdlg .hbox { padding: 12px 14px; font-size: 13px; }
#btabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
#btabs::-webkit-scrollbar { display: none; }
#btabs button { padding: 9px 9px; flex: none; }
/* без увеличения страницы двойным тапом (двойной тап по графику — сброс вида графика) */
html, body, button, input, #chartwrap { touch-action: manipulation; }

/* закреплённая панель снизу: SELL · объём · BUY (как в приложении FxPro) */
body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
#tradebtns, #lots, #lotin, #panel .ttl:has(+ #lots) { display: none !important; }
#mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: 1fr 0.8fr 1fr; gap: 6px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #131722f5; border-top: 1px solid #2a2e39; }
#mbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; border: 0; border-radius: 14px; color: #fff; }
#mbar small { font-size: 12px; opacity: .85; }
#mbar b { font-size: 18px; font-variant-numeric: tabular-nums; }
#mbar .sell { background: #ef5350; } #mbar .buy { background: #26a69a; }
#mlot { background: #2a2e39 !important; border-bottom: 2px solid #787b86 !important; border-radius: 8px !important; }
#mbar .busy { opacity: .55; }
#mbar button, #mbar button:focus { outline: none; box-shadow: none; }
#mbar .done b::after { content: ' ✓'; }
#mbar .fail { background: #5d606b !important; }
#mbar .fail b::after { content: ' ✕'; }

/* шторка выбора объёма */
#msheet { position: fixed; inset: 0; z-index: 150; background: #0009; display: none; align-items: flex-end; }
#msheet.show { display: flex; }
#msheet .box { width: 100%; background: #1e222d; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
#msheet .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 16px; }
#msheet .close { background: none; border: 0; font-size: 20px; padding: 4px 8px; }
#msheet .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
#msheet .grid button { padding: 13px 0; font-size: 16px; font-variant-numeric: tabular-nums; }
#msheet .grid button.on { background: #2962ff; border-color: #2962ff; color: #fff; }
#msheet .own { display: flex; gap: 7px; margin-top: 10px; }
#msheet .own input { flex: 1; padding: 12px; font-size: 16px; background: #131722; color: #fff; border: 1px solid #363a45; border-radius: 6px; }
#msheet .own .ok { padding: 0 20px; background: #2962ff; border-color: #2962ff; color: #fff; font-weight: 700; }

#tokdlg input { margin-bottom: 8px; }
#tokdlg .aerr { color: #ef5350; min-height: 1em; }
#tokdlg a.guidebtn { display: inline-block; text-decoration: none; }
#tokdlg .totpkey { font-size: 16px; letter-spacing: 1px; word-break: break-all; }
#tokdlg .qr svg { background: #fff; border-radius: 6px; max-width: 200px; height: auto; }

/* выбор инструмента: список под полем */
#msymdd { position: fixed; z-index: 160; width: 220px; max-height: 50vh; overflow-y: auto; display: none; background: #1e222d;
          border: 1px solid #363a45; border-radius: 6px; box-shadow: 0 6px 20px #000a; }
#msymdd.show { display: block; }
#msymdd button { display: block; width: 100%; text-align: left; padding: 11px 12px; font-size: 15px; font-weight: 600;
                 background: none; border: 0; border-bottom: 1px solid #2a2e39; border-radius: 0; }
#msymdd button.on { color: #5b8cff; }

/* верхняя строка компактнее: без «?», вместо плашки «LIVE · советник подключён» — точка в правом верхнем углу */
#helpbtn { display: none !important; }
#top { padding-right: 26px; }
#badge { position: absolute; top: 9px; right: 9px; width: 12px; height: 12px; padding: 0 !important; border-radius: 50%;
         font-size: 0 !important; overflow: hidden; order: 0; }
#badge.live { background: #ef5350; } #badge.warn { background: #f0b90b; } #badge.paper { background: #5b8cff; }
#mtip { position: fixed; top: 26px; right: 8px; z-index: 60; background: #1e222df2; border: 1px solid #363a45; border-radius: 6px;
        padding: 6px 10px; font-size: 13px; display: none; }
#mtip.show { display: block; }

/* приложение на экране «Домой» (iPhone): страница заходит под строку состояния — отступ на «чёлку» */
#top { padding-top: calc(6px + env(safe-area-inset-top)); }
#badge { top: calc(9px + env(safe-area-inset-top)); }
#mtip { top: calc(26px + env(safe-area-inset-top)); }

/* ↻ обновить — ненавязчиво, левее точки состояния */
#top { padding-right: 52px; }   /* место под ↻ и точку в первой строке */
#tfs { width: calc(100% + 44px) !important; }   /* таймфреймы — на всю ширину, под ↻ и точкой */
#mreload { position: absolute; top: calc(1px + env(safe-area-inset-top)); right: 24px; width: 28px; height: 28px; padding: 0;
           background: none !important; border: 0; color: #787b86; font-size: 19px; line-height: 28px; }
#mreload:active { color: #d1d4dc; }
#mreload.spin { animation: spin .8s linear infinite; }
#tfs button { padding: 7px 3px; min-width: 0; }
#lotrow { display: none !important; }
#mlot small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
