/* Micro-polish pass (21.10.2026): small layout fixes on top of the base styles. */

/* Status tabs never squeeze into each other — they scroll sideways instead. */
.tabs{-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
.tabs .tab{flex:0 0 auto;white-space:nowrap;scroll-snap-align:start}

/* Wide tables scroll inside their panel; chips and codes never break mid-word. */
.tablewrap{-webkit-overflow-scrolling:touch}
.tablewrap td .badge,.tablewrap td .code,.tablewrap td .method,.tablewrap td .idchip{white-space:nowrap}
.tablewrap .wrapurl{display:inline-block;min-width:150px;max-width:340px;vertical-align:top}
.tablewrap td.rowact{white-space:nowrap}

/* The dashboard hint only takes space while the layout is being edited. */
.dashboard-status:empty{display:none}

/* Guest: a calm "view only" chip in the top bar instead of the trading switch. */
.r-guest{--rc:var(--warn)}
.topbar .rolechip.r-guest{cursor:help}

/* Audit: readable action name with the technical code underneath. */
td b.act{font-weight:600}
td b.act + small.mono{opacity:.7}

/* Phone: the login form is visible without scrolling past the illustration. */
@media(max-width:760px){
  .auth .scene{display:none}
  .authstory{padding:22px 22px 6px;gap:12px}
  .authcopy h1{font-size:clamp(30px,9vw,40px)}
  .authcopy p{font-size:14px}
  .authform{padding:10px 16px 28px}
  .formcard .demoroles,.formcard .chips{flex-wrap:wrap}
}

/* Phone: a long number pushes its unit to the next line instead of clipping it. */
@media(max-width:760px){.card .metric{flex-wrap:wrap;row-gap:0}}
small.blockline{display:block;margin-top:10px}

/* Phone: dialog actions wrap; the main action gets its own full-width row, nothing is clipped. */
@media(max-width:760px){
  #modal .dialog-actions{flex-wrap:wrap}
  #modal .dialog-actions>button{flex:1 1 calc(50% - 4px);min-width:0;white-space:normal;line-height:1.25;padding-block:9px}
  #modal .dialog-actions>button.mag,#modal .dialog-actions>button.primary{flex-basis:100%;order:-1}
}

/* ── in-site file viewer (viewer.js) ── */
body.fv-open { overflow: hidden; }
.fv { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: rgba(8, 10, 14, .92); color: #f2f4f7; backdrop-filter: blur(6px); animation: fv-in .14s ease-out; }
@keyframes fv-in { from { opacity: 0; } to { opacity: 1; } }
.fv-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(0, 0, 0, .35); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.fv-title { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.fv-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.fv-title small { opacity: .65; font-size: 12px; }
.fv-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fv-tools button, .fv-btn { appearance: none; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: inherit; border-radius: 8px; height: 34px; min-width: 34px; padding: 0 10px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.fv-tools button:hover, .fv-btn:hover { background: rgba(255, 255, 255, .14); }
.fv-btn.primary { background: #3b82f6; border-color: #3b82f6; color: #fff; height: 40px; padding: 0 18px; }
.fv-zoom { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; opacity: .8; }
.fv-x { margin-left: 4px; }
.fv-stage { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; }
.fv[data-kind="image"] .fv-stage { cursor: zoom-in; }
.fv-stage.fv-drag { cursor: grabbing; }
.fv-img { max-width: none; max-height: none; transform-origin: center center; transition: transform .12s ease-out; user-select: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); border-radius: 4px; background: #fff; }
.fv-stage.fv-drag .fv-img { transition: none; }
.fv-pdf { width: min(1100px, 100%); height: 100%; border: 0; background: #525659; }
.fv-video { max-width: 100%; max-height: 100%; }
.fv-text { margin: 16px; padding: 16px; max-width: min(1000px, 100%); max-height: calc(100% - 32px); overflow: auto; background: #10141b; border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.fv-empty { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 24px; }
.fv-load { opacity: .7; font-size: 14px; }
.fv-nav { display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 30px; cursor: pointer; }
.fv-nav:hover { background: rgba(255, 255, 255, .18); }
.fv-nav.prev { left: 12px; } .fv-nav.next { right: 12px; }
.fv.fv-multi .fv-nav { display: block; }
.fv-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .5); }
.fv-count:empty { display: none; }
.fv:not([data-kind="image"]) [data-fv-act="in"], .fv:not([data-kind="image"]) [data-fv-act="out"], .fv:not([data-kind="image"]) [data-fv-act="fit"], .fv:not([data-kind="image"]) [data-fv-act="rot"], .fv:not([data-kind="image"]) .fv-zoom { display: none; }
a[data-view] { cursor: zoom-in; }
@media (max-width: 640px) {
  .fv-bar { flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .fv-title { flex-basis: 100%; }
  .fv-tools { justify-content: flex-start; width: 100%; }
  .fv-tools .fv-x { margin-left: auto; }
  [data-fv="tab"] { display: none; }
  .fv-nav { width: 36px; height: 52px; font-size: 24px; }
  .fv-pdf { width: 100%; }
}
/* the viewer is a modal <dialog> (top layer, above the trade dialog): no UA box */
/* full screen over the blurred page; the file itself is fitted with a margin (owner 21.10.2026) */
dialog.fv { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10, 12, 18, .62); backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%); }
dialog.fv::backdrop { background: transparent; }
dialog.fv .fv-bar { background: rgba(10, 12, 18, .55); border-bottom-color: rgba(255, 255, 255, .06); }
dialog.fv .fv-nav { background: rgba(0, 0, 0, .35); }
dialog.fv .fv-img, dialog.fv .fv-page { box-shadow: 0 20px 60px rgba(0, 0, 0, .55); border-radius: 8px; }
.fv-pages { align-self: stretch; width: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.fv-page { flex: none; background: #fff; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.fv[data-kind="pdf"] .fv-stage { touch-action: pan-x pan-y; }
.fv[data-kind="pdf"] [data-fv-act="in"], .fv[data-kind="pdf"] [data-fv-act="out"], .fv[data-kind="pdf"] [data-fv-act="fit"], .fv[data-kind="pdf"] [data-fv-act="rot"], .fv[data-kind="pdf"] .fv-zoom { display: inline-flex; }
@media (max-width: 640px) { .fv-bar { position: relative; padding-right: 54px; } .fv-tools .fv-x { position: absolute; top: 8px; right: 10px; margin: 0; } }

/* bell: new-order alerts */
.alertset { display: grid; gap: 8px; margin-bottom: 6px; }
.alertopt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line, rgba(127,127,127,.2)); border-radius: 10px; }
.alertopt span { display: flex; flex-direction: column; } .alertopt small { opacity: .7; }
.alertsound { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.alertsound label { flex: 1 1 140px; } .alertsound input[type=range] { width: 100%; }
#toasts > * { white-space: pre-line; }
/* viewer docked to the right of the trade dialog: the order on the left, the receipts on the right */
#modal.fv-split { width: min(1720px, calc(100vw - 32px)); height: 94dvh; max-height: 94dvh; }
#modal.fv-split .tgrid { grid-template-columns: 1fr; }
#modal.fv-split #modal-content { flex: 0 0 min(600px, 40%); border-right: 1px solid var(--line, rgba(127, 127, 127, .2)); }
.fv.fv-dock { position: relative; inset: auto; z-index: auto; flex: 1 1 auto; min-width: 0; height: auto; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: rgba(8, 10, 14, .5); color: #f2f4f7; border-radius: 0; animation: fv-in .14s ease-out; }
.fv.fv-dock .fv-bar { padding: 12px 14px; }
.fv.fv-dock .fv-tools [data-fv-act="close"] { margin-left: 6px; }
a[data-view].fv-active { color: var(--accent, #8b7cff); font-weight: 600; text-decoration: none; }
a[data-view].fv-active::before { content: '▸ '; }
/* owner 28.10.2026: the viewer in the colours of the chosen theme («Пісок» — light, the dark themes — dark), not a grey overlay */
.fv { background: color-mix(in oklab, var(--bg) 94%, transparent); color: var(--text); }
.fv-bar { background: color-mix(in oklab, var(--glass-strong) 85%, var(--bg)); border-bottom: 1px solid var(--line); }
.fv-title small { color: var(--muted); }
.fv-tools button, .fv-btn { border-color: var(--line); background: var(--field); color: var(--text); }
.fv-tools button:hover, .fv-btn:hover { border-color: var(--accent); color: var(--text); background: color-mix(in oklab, var(--accent) 10%, var(--field)); }
.fv-zoom { color: var(--text-2); opacity: 1; }
.fv-nav { background: color-mix(in oklab, var(--field) 85%, transparent); color: var(--text); border: 1px solid var(--line); }
.fv-count { background: color-mix(in oklab, var(--field) 90%, transparent); color: var(--text); border: 1px solid var(--line); }
.fv-img { box-shadow: 0 10px 40px color-mix(in oklab, var(--text) 18%, transparent); }
.fv-text { background: var(--field); border-color: var(--line); color: var(--text); }
.fv.fv-dock { background: color-mix(in oklab, var(--bg) 70%, var(--glass)); color: var(--text); }
/* the copy button on the bank card: readable on the card in every theme (it was brown on green in «Пісок») */
.bankcard .bc-copy { color: #fff !important; background: rgba(255, 255, 255, .14) !important; border: 1px solid rgba(255, 255, 255, .35) !important; border-radius: 8px; padding: 0 10px; }
.bankcard .bc-copy:hover { background: rgba(255, 255, 255, .24) !important; }
/* owner 28.10.2026: the trading switch — no frame around it and no «Увімкнено» line; the label, then a larger switch that lights up */
.tradeswitch, .tradeswitch:hover, .tradeswitch.on { background: none !important; box-shadow: none !important; border: 0 !important; padding: 4px 6px !important; gap: 12px; min-height: 40px; }
.tradeswitch .ts-label b { font-size: 13.5px; font-weight: 600; color: var(--muted); transition: color .3s; letter-spacing: .01em; }
.tradeswitch.on .ts-label b { color: var(--text); }
.tradeswitch:hover .ts-label b { color: var(--text); }
.tradeswitch .ts-track { width: 52px; height: 30px; border-radius: 16px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line-2); position: relative; }
.tradeswitch .ts-knob { top: 3px; left: 3px; width: 24px; height: 24px; background: color-mix(in oklab, var(--muted) 70%, var(--text)); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.tradeswitch.on .ts-track { background: linear-gradient(135deg, var(--ok), color-mix(in oklab, var(--ok) 70%, var(--accent))); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ok) 16%, transparent), 0 6px 18px -6px color-mix(in oklab, var(--ok) 70%, transparent); }
.tradeswitch.on .ts-knob { transform: translateX(22px); background: #fff; }
.tradeswitch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
