@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Regular.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-SemiBold.woff2") format("woff2"); font-style: normal; font-weight: 600 800; font-display: swap; }

:root {
  --bg: #050b14;
  --bg-deep: #030811;
  --sidebar: #07111d;
  --surface: #0a1522;
  --surface-2: #0d1a29;
  --surface-3: #101f30;
  --border: #1a2a3b;
  --border-gold: rgba(245, 183, 0, .35);
  --gold: #f5b700;
  --gold-soft: #ffd45a;
  --text: #f3f5f7;
  --text-muted: #8f9baa;
  --green: #4fd266;
  --red: #ef4e4e;
  --blue: #4aa8ff;
  --purple: #a268ff;
  --shadow: 0 14px 40px rgba(0, 0, 0, .2);
  --sidebar-width: 248px;
  --topbar-height: 64px;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
html[data-theme="light"] { color-scheme: light; --bg:#f1f5f9; --bg-deep:#e2e8f0; --sidebar:#ffffff; --surface:#ffffff; --surface-2:#f8fafc; --surface-3:#eef2f7; --border:#cbd5e1; --text:#0f172a; --text-muted:#64748b; --shadow:0 14px 35px rgba(15,23,42,.08); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  direction: inherit;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, a { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid rgba(245, 183, 0, .55); outline-offset: 2px; }
.hidden { display: none !important; }
.ltr-number { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link { position: fixed; top: 8px; right: 8px; z-index: 100; padding: 8px 14px; color: #171000; background: var(--gold); border-radius: 6px; font-weight: 700; transform: translateY(-150%); transition: transform .2s ease; }
.skip-link:focus { transform: translateY(0); }

/* Application shell */
.app-layout { min-height: 100vh; direction: inherit; }
.app-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: linear-gradient(180deg, #07111d 0%, #050d17 100%);
  border-inline-end: 1px solid var(--border);
  direction: inherit;
}
.app-main { min-width: 0; margin-inline-start: var(--sidebar-width); direction: inherit; }
html[dir="rtl"] .app-sidebar { right:0;left:auto; }
html[dir="ltr"] .app-sidebar { left:0;right:auto; }
html[dir="rtl"] .app-main { margin-right:var(--sidebar-width);margin-left:0; }
html[dir="ltr"] .app-main { margin-left:var(--sidebar-width);margin-right:0; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 18px;
  background: rgba(5, 11, 20, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.topbar-title-group, .topbar-tools, .user-chip, .polling-chip { display: flex; align-items: center; }
.topbar-title-group { gap: 11px; }
.topbar-title-group h1 { margin: 0; font-size: 16px; line-height: 1.3; }
.topbar-title-group p { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; }
.live-orb { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(79, 210, 102, .1), 0 0 12px rgba(79, 210, 102, .55); }
.topbar-tools { gap: 16px; }
.polling-chip { gap: 8px; min-height: 34px; padding: 5px 10px; color: #bcc5cf; background: rgba(13, 26, 41, .72); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }
.health-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(79, 210, 102, .55); }
.health-dot.paused { background: var(--red); box-shadow: 0 0 8px rgba(239, 78, 78, .55); }
.app-clock { direction: ltr; color: #dfe5eb; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.user-chip { gap: 9px; padding-inline-start: 16px; border-inline-start: 1px solid var(--border); }
.user-chip > span:last-child { display: flex; flex-direction: column; }
.user-chip strong { font-size: 11px; }
.user-chip small { color: var(--text-muted); font-size: 9px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #171000; background: linear-gradient(145deg, var(--gold), #d69200); border-radius: 50%; font-weight: 800; }
.menu-button, .sidebar-close { width: 44px; height: 44px; display: none; place-items: center; color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: 7px; }
.button-icon { width: 20px; height: 20px; }
.theme-toggle { min-height: 34px; display:flex;align-items:center;gap:6px;padding:5px 10px;color:var(--text-muted);background:var(--surface-2);border:1px solid var(--border);border-radius:6px; }
.theme-toggle:hover { color:var(--gold);border-color:var(--border-gold); }

.sidebar-brand { min-height: 76px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand > span:nth-child(2), .auth-brand > span:last-child { display: flex; flex-direction: column; }
.sidebar-brand strong { color: var(--gold-soft); font-size: 19px; }
.sidebar-brand small { color: var(--text-muted); font-size: 10px; }
.brand-mark { width: 38px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--gold); }
.brand-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; }
.side-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-section-label { margin: 0 10px 8px; color: #5f6c7a; font-size: 9px; letter-spacing: .1em; }
.side-nav-link, .sidebar-logout { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; color: #b8c1cb; border: 1px solid transparent; border-radius: 7px; text-decoration: none; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
.side-nav-link:hover, .sidebar-logout:hover { color: var(--text); background: rgba(255, 255, 255, .025); }
.side-nav-link.active { color: var(--gold-soft); background: linear-gradient(90deg, rgba(245, 183, 0, .1), rgba(245, 183, 0, .025)); border-color: rgba(245, 183, 0, .23); box-shadow: inset 3px 0 0 var(--gold); }
.nav-icon { width: 21px; height: 21px; flex: 0 0 auto; }
.sidebar-control { position:fixed;top:auto;bottom:max(14px,env(safe-area-inset-bottom));z-index:42;width:min(225px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto;padding:12px;background:rgba(7,17,29,.96);border:1px solid var(--border);border-radius:9px;box-shadow:0 18px 45px rgba(0,0,0,.32);backdrop-filter:blur(14px); }
html[dir="rtl"] .sidebar-control { left:max(14px,env(safe-area-inset-left));right:auto; }
html[dir="ltr"] .sidebar-control { right:max(14px,env(safe-area-inset-right));left:auto; }
.sidebar-control-heading { display: flex; align-items: center; gap: 10px; }
.sidebar-control-heading > div { display: flex; flex-direction: column; }
.sidebar-control h2 { margin: 0; font-size: 13px; }
.sidebar-control small { color: var(--gold); font-size: 10px; direction: ltr; text-align: right; }
.section-icon { width: 22px; height: 22px; color: var(--gold); }
.system-health { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: #c5ccd4; font-size: 11px; }
.sidebar-kill-button { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #ffd4d4; background: linear-gradient(180deg, rgba(170, 38, 38, .8), rgba(120, 25, 25, .9)); border: 1px solid rgba(239, 78, 78, .5); border-radius: 6px; font-weight: 700; font-size: 12px; transition: filter .18s, opacity .18s; }
.sidebar-kill-button:hover { filter: brightness(1.12); }
.sidebar-kill-button.is-active { color: #111; background: linear-gradient(180deg, #e9ad00, #b98500); border-color: var(--gold); }
.kill-indicator { width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 50%; }
.robot-control-actions { display:grid;grid-template-columns:1fr 1fr;gap:7px; }.robot-action { min-height:40px;padding:6px 8px;border-radius:6px;font-size:10px;font-weight:700; }.robot-action.start { color:#07130a;background:linear-gradient(180deg,#5ed878,#36a950);border:1px solid #6ce084; }.robot-action.pause { color:#211700;background:linear-gradient(180deg,#f4bd19,#c58e00);border:1px solid #ffd65d; }.robot-control-actions .sidebar-kill-button { grid-column:1/-1; }
.control-minimize { width:36px;height:36px;display:grid;place-items:center;margin-inline-start:auto;color:var(--text);background:var(--surface-3);border:1px solid var(--border);border-radius:6px;font-size:19px;line-height:1; }
.system-control-body { overflow:hidden;transition:max-height .22s ease,opacity .18s ease;max-height:230px;opacity:1; }
.sidebar-control.is-minimized { width:auto;min-width:168px; }
.sidebar-control.is-minimized .system-control-body { max-height:0;opacity:0; }
html[dir="rtl"] .side-nav-link.active { box-shadow:inset -3px 0 0 var(--gold); }
html[dir="ltr"] .side-nav-link.active { box-shadow:inset 3px 0 0 var(--gold); }
.sidebar-logout { margin: 0 10px 12px; color: #8995a2; border-top: 1px solid var(--border); border-radius: 0; }
.sidebar-update-check { min-height:44px;display:flex;align-items:center;gap:12px;margin:0 10px 6px;padding:8px 12px;color:var(--text-muted);background:transparent;border:1px solid transparent;border-radius:7px;text-align:start;transition:color .18s ease,background-color .18s ease,border-color .18s ease; }
.sidebar-update-check:hover { color:var(--gold-soft);background:rgba(245,183,0,.06);border-color:rgba(245,183,0,.18); }
.sidebar-update-check svg { width:21px;height:21px;flex:0 0 auto; }
.sidebar-update-check span { flex:1; }
.sidebar-update-check small { direction:ltr;color:var(--gold);font-size:9px; }
.sidebar-update-check.is-checking svg { animation:spin .8s linear infinite; }
.sidebar-overlay { display: none; }
.mobile-tabbar { display:none; }

/* Workspace */
.workspace { width: 100%; padding: 16px 18px 16px; }
.page-shell { width: 100%; margin: 0; }
.workspace-intro, .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.workspace-intro h2, .page-heading h2 { margin: 0; font-size: 20px; }
.workspace-intro p:not(.eyebrow), .heading-description { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.intro-actions { display: flex; align-items: center; gap: 10px; }
.eyebrow, .section-kicker { margin: 0 0 3px; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .14em; direction: ltr; text-align: right; }
.mode-pill, .count-chip, .connection-chip { min-height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; color: var(--gold-soft); background: rgba(245, 183, 0, .07); border: 1px solid rgba(245, 183, 0, .25); border-radius: 5px; font-size: 10px; font-weight: 700; direction: ltr; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi-card, .stat-box { min-width: 0; min-height: 108px; padding: 12px 13px; background: linear-gradient(145deg, rgba(13, 26, 41, .97), rgba(8, 18, 30, .97)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #aab4bf; font-size: 12px; }
.kpi-icon { width: 27px; height: 27px; display: grid; place-items: center; color: var(--gold); background: rgba(245, 183, 0, .07); border: 1px solid rgba(245, 183, 0, .15); border-radius: 6px; }
.card-icon { width: 16px; height: 16px; }
.kpi-value { display: block; margin-top: 6px; overflow: hidden; color: #f5f7fa; font-family: "Vazirmatn", Tahoma, sans-serif; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.kpi-text { color: var(--green); font-size: 20px; }
.kpi-card small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 10px; }
.value-positive { color: var(--green) !important; }
.value-negative, .status-error { color: var(--red) !important; }

.terminal-card, .history, .settings-section { background: linear-gradient(145deg, rgba(10, 21, 34, .98), rgba(7, 16, 27, .98)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.market-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 12px; align-items: start; direction: ltr; }
.market-layout > * { direction: rtl; }
.chart-card { min-width: 0; overflow: hidden; }
.terminal-card-header { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 13px; border-bottom: 1px solid var(--border); }
.terminal-card-header h2 { margin: 0; font-size: 14px; }
.symbol-title { display: flex; align-items: center; gap: 12px; direction: ltr; }
.symbol-title strong { font-size: 15px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; direction: rtl; }
.live-badge span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.chart-subbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 13px 0; }
.chart-subbar h2 { margin: 0; font-size: 13px; }
.chart-tags { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 9px; }
.chart-tags span::before { content: ""; width: 13px; display: inline-block; margin-left: 5px; border-top: 2px solid currentColor; vertical-align: middle; }
.chart-tags .fast { color: #7dd3fc; }
.chart-tags .slow { color: #c084fc; }
.refresh-tools { display: flex; align-items: center; gap: 10px; }
.refresh-state { color: var(--text-muted); font-size: 9px; }
.icon-text-button, .button-link, .button-secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 11px; color: #cbd3dc; background: rgba(16, 31, 48, .85); border: 1px solid var(--border); border-radius: 6px; text-decoration: none; font-size: 10px; transition: background .18s, border-color .18s, color .18s; }
.icon-text-button:hover, .button-link:hover, .button-secondary:hover { color: var(--text); background: var(--surface-3); border-color: #30455c; }
.icon-text-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-text-button.is-loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.price-chart-wrap { height: 392px; padding: 4px 8px 0; }
.rsi-chart-wrap { position: relative; height: 132px; padding: 26px 8px 3px; border-top: 1px solid var(--border); }
.mini-chart-label { position: absolute; inset: 6px 12px auto; display: flex; justify-content: space-between; color: var(--text-muted); font-size: 9px; }
.chart-legend-note { margin: 0; padding: 7px 12px; color: #687687; border-top: 1px solid var(--border); font-size: 9px; }

.market-side-column { display: grid; gap: 12px; }
.signal-panel { overflow: hidden; }
.signal-status-dot { color: var(--gold); font-size: 10px; }
.empty-state { min-height: 225px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 12px; color: #536273; background: rgba(255,255,255,.025); border: 1px dashed #304052; border-radius: 50%; }
.empty-svg { width: 25px; height: 25px; }
.empty-state strong { font-size: 13px; }
.empty-state p { max-width: 250px; margin: 5px 0 0; color: var(--text-muted); font-size: 10px; }
.signal-content { padding: 14px; }
.signal-symbol-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; direction: ltr; }
.signal-symbol-row strong { font-size: 18px; }
.signal-symbol-row span { padding: 2px 7px; color: var(--red); background: rgba(239, 78, 78, .08); border: 1px solid rgba(239, 78, 78, .22); border-radius: 4px; font-size: 9px; direction: rtl; }
.signal-reason { margin: 12px 0; color: #c3cbd4; font-size: 11px; line-height: 1.85; }
.signal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-confirm, .btn-ignore { min-height: 44px; border-radius: 6px; font-weight: 700; font-size: 11px; }
.btn-confirm { color: #041109; background: linear-gradient(180deg, #58d772, #32a94e); border: 1px solid #65e37e; }
.btn-ignore { color: #fff; background: linear-gradient(180deg, #c83c3c, #9c2828); border: 1px solid #e45959; }
.disclaimer { margin: 10px 0 0; color: #718091; font-size: 9px; line-height: 1.7; }
.system-panel .terminal-card-header > .health-dot { margin-left: 3px; }
.system-list { margin: 0; padding: 4px 13px; }
.system-list div { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(26, 42, 59, .75); }
.system-list div:last-child { border: 0; }
.system-list dt { color: var(--text-muted); font-size: 11px; }
.system-list dd { margin: 0; color: #dbe1e7; font-size: 11px; font-weight: 700; direction: ltr; }
.panel-link { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--gold); border-top: 1px solid var(--border); text-decoration: none; font-size: 10px; }
.panel-link:hover { background: rgba(245, 183, 0, .035); }
.inline-icon { width: 16px; height: 16px; }

.history { margin-top: 12px; overflow: hidden; }
.history > .section-heading { min-height:50px;padding:10px 13px;border-bottom:1px solid var(--border); }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid rgba(26, 42, 59, .72); font-size: 11px; vertical-align: middle; }
th { color: #8190a0; background: rgba(13, 26, 41, .75); font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .018); }
td:last-child { max-width: 430px; color: #9ca7b3; }
.status-badge { min-height: 24px; display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 9px; white-space: nowrap; }
.status-confirmed { color: #8aee9d; background: rgba(79, 210, 102, .09); border: 1px solid rgba(79, 210, 102, .24); }
.status-pending { color: #ffe17a; background: rgba(245, 183, 0, .08); border: 1px solid rgba(245, 183, 0, .24); }
.status-ignored { color: #c3cad2; background: rgba(143, 155, 170, .08); border: 1px solid rgba(143, 155, 170, .2); }
.status-expired { color: #ff9696; background: rgba(239, 78, 78, .08); border: 1px solid rgba(239, 78, 78, .23); }
.table-subtext { display: block; color: var(--text-muted); direction: ltr; }
.trades-table { min-width: 1120px; }
.report-note { margin: 14px 0 0; color: var(--text-muted); text-align: center; font-size: 10px; }

/* Settings and reports */
.page-heading { align-items: flex-start; }
.settings-grid { display:block;column-count:2;column-gap:12px; }
.settings-section { display:inline-block;width:100%;margin:0 0 12px;padding:16px;break-inside:avoid; }
.settings-wide { column-span:all; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.settings-section h2, .history h2 { margin: 0; font-size: 14px; }
.help-text { margin: 6px 0 14px; color: var(--text-muted); font-size: 11px; line-height: 1.9; }
.settings-section form { display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.settings-section label, .login-box label { display: flex; flex-direction: column; gap: 5px; color: #c8d0d8; font-size: 12px; }
.settings-section input[type="text"], .settings-section input[type="password"], .settings-section input[type="number"], .settings-section input[type="email"], .settings-section input[type="url"], .settings-section select, .login-box input { width: 100%; min-height: 44px; padding: 8px 10px; color: var(--text); background: #06101b; border: 1px solid #26394d; border-radius: 6px; font-size: 13px; transition: border-color .18s, box-shadow .18s; }
.settings-section input:hover, .settings-section select:hover, .login-box input:hover { border-color: #38516a; }
.settings-section input:focus, .settings-section select:focus, .login-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 183, 0, .1); outline: none; }
.settings-section input::placeholder, .login-box input::placeholder { color: #536273; }
.settings-section button, .login-box button, .upgrade-card button { min-height: 44px; align-self: flex-start; padding: 8px 16px; color: #171000; background: linear-gradient(180deg, #ffc928, #db9f00); border: 1px solid #ffda5d; border-radius: 6px; font-weight: 700; font-size: 11px; transition: filter .18s, opacity .18s; }
.settings-section button:hover, .login-box button:hover, .upgrade-card button:hover { filter: brightness(1.08); }
.settings-section .button-secondary { color: var(--text); background: var(--surface-3); border-color: var(--border); }
.masked { margin-right: 5px; color: var(--gold); font-family: Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
.checkbox-label { flex-direction: row !important; align-items: flex-start; gap: 9px !important; padding: 10px; background: rgba(255, 255, 255, .018); border: 1px solid var(--border); border-radius: 6px; }
.checkbox-label input { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--gold); }
.checkbox-label span { display: flex; flex-direction: column; }
.checkbox-label small { color: var(--text-muted); }
.live-lock { border-color: rgba(239, 78, 78, .25); }
.danger-note, .legal-note { padding: 9px 11px; border-radius: 5px; font-size: 9px; line-height: 1.8; }
.danger-note { color: #ffb1b1; background: rgba(239, 78, 78, .06); border: 1px solid rgba(239, 78, 78, .2); }
.legal-note { margin-top: 13px; color: var(--text-muted); background: rgba(255,255,255,.015); border-right: 3px solid var(--gold); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.connection-chip { color: #87e99a; background: rgba(79, 210, 102, .07); border-color: rgba(79, 210, 102, .22); direction: rtl; }
.connection-chip::before { content: ""; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--green); }
.connection-chip.is-error { color: #ff9999; background: rgba(239, 78, 78, .07); border-color: rgba(239, 78, 78, .22); }
.connection-chip.is-error::before { background: var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-box { min-height: 100px; }
.stat-box .label { display: block; color: var(--text-muted); font-size: 10px; }
.stat-box .value { display: block; margin-top: 7px; color: var(--gold-soft); font-size: 23px; line-height: 1.2; }
.stat-box small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 9px; }

.banner { padding: 10px 13px; margin: 0 0 12px; border-radius: 6px; font-size: 10px; line-height: 1.8; }
.banner.success { color: #a4f0b2; background: rgba(79, 210, 102, .07); border: 1px solid rgba(79, 210, 102, .25); }
.banner.error { color: #ffaaaa; background: rgba(239, 78, 78, .07); border: 1px solid rgba(239, 78, 78, .25); }
.banner.warn { color: #ffe797; background: rgba(245, 183, 0, .07); border: 1px solid rgba(245, 183, 0, .25); }

/* Full Live control plane */
.full-live-control { display:block;margin-bottom:16px;padding:20px;border-color:rgba(245,183,0,.3); }
.live-control-header,.live-section-heading,.live-wizard-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:16px; }
.live-control-header h2,.live-section-heading h3,.live-wizard h3,.live-wizard h4,.live-dialog h3 { margin:0; }
.live-state-stack { display:flex;align-items:center;gap:8px;flex:0 0 auto; }
.live-state-pill { min-height:34px;display:inline-flex;align-items:center;gap:8px;padding:6px 11px;border:1px solid var(--border);border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.06em;direction:ltr; }
.live-state-icon { width:9px;height:9px;border-radius:50%;background:currentColor;box-shadow:0 0 0 4px color-mix(in srgb,currentColor 15%,transparent); }
.live-state-pill.state-locked { color:#ff9d9d;background:rgba(239,78,78,.07);border-color:rgba(239,78,78,.28); }
.live-state-pill.state-ready { color:#ffe38a;background:rgba(245,183,0,.08);border-color:rgba(245,183,0,.3); }
.live-state-pill.state-active { color:#96eba5;background:rgba(79,210,102,.08);border-color:rgba(79,210,102,.3); }
.live-safety-banner { min-height:48px;display:flex;align-items:center;gap:10px;margin:14px 0;padding:10px 12px;color:#b8eec2;background:rgba(79,210,102,.05);border:1px solid rgba(79,210,102,.2);border-radius:8px;font-size:11px; }
.live-safety-banner.is-locked { color:#ffc1c1;background:rgba(239,78,78,.055);border-color:rgba(239,78,78,.24); }
.live-safety-banner strong { flex:0 0 auto; }
.live-overview-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px; }
.live-overview-card { min-height:112px;padding:13px;background:rgba(255,255,255,.018);border:1px solid var(--border);border-radius:8px; }
.live-overview-card>span,.live-overview-card small { display:block;color:var(--text-muted);font-size:10px;line-height:1.7; }
.live-overview-card strong { display:block;margin:8px 0;color:var(--text);font-size:20px;font-variant-numeric:tabular-nums; }
.live-environment-control { display:grid;grid-template-columns:minmax(220px,1fr) auto;align-items:end;gap:10px;margin:14px 0;padding:13px;background:rgba(255,255,255,.015);border:1px solid var(--border);border-radius:8px; }
.live-environment-control .help-text { grid-column:1/-1;margin:0; }
.live-section-heading { align-items:center;margin:20px 0 10px; }
.live-section-heading h3 { font-size:14px; }
.live-gate-matrix { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
.live-gate { min-height:90px;display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:start;gap:9px;padding:11px;background:rgba(255,255,255,.014);border:1px solid var(--border);border-radius:8px; }
.gate-state-icon { width:27px;height:27px;display:grid;place-items:center;border-radius:50%;font-size:13px;font-weight:900; }
.live-gate.is-passed .gate-state-icon { color:#a7f2b4;background:rgba(79,210,102,.12);border:1px solid rgba(79,210,102,.28); }
.live-gate.is-failed .gate-state-icon { color:#ffb2b2;background:rgba(239,78,78,.1);border:1px solid rgba(239,78,78,.28); }
.live-gate strong,.live-gate small,.live-gate p { display:block; }
.live-gate strong { color:var(--text);font-size:11px; }
.live-gate small { margin-top:2px;color:var(--text-muted);font-size:9px;line-height:1.6; }
.live-gate p { margin:5px 0 0;color:#cbd3dc;font-size:9px;line-height:1.6; }
.live-gate time { color:var(--text-muted);font-size:8px;white-space:nowrap;font-variant-numeric:tabular-nums; }
.live-config-details { margin-top:16px;border:1px solid var(--border);border-radius:9px;overflow:hidden; }
.live-config-details>summary { min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;cursor:pointer;color:var(--text);background:rgba(255,255,255,.02);font-size:12px;font-weight:700; }
.live-config-details>summary small { color:var(--text-muted);font-size:9px;font-weight:400; }
.live-config-details>form { padding:14px; }
.live-config-details fieldset { min-width:0;margin:0;padding:13px;border:1px solid var(--border);border-radius:8px; }
.live-config-details legend { padding:0 7px;color:var(--gold-soft);font-size:11px;font-weight:700; }
.live-form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.field-span-2 { grid-column:span 2; }
.settings-section input[type="time"] { width:100%;min-height:44px;padding:8px 10px;color:var(--text);background:#06101b;border:1px solid #26394d;border-radius:6px;font-size:13px;color-scheme:dark; }
.live-choice-group { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:11px; }
.live-choice-group>span { width:100%;color:#c8d0d8;font-size:11px; }
.choice-chip { display:inline-flex!important;flex-direction:row!important;align-items:center;min-height:44px;padding:7px 10px;border:1px solid var(--border);border-radius:7px;background:rgba(255,255,255,.018);direction:ltr; }
.choice-chip input { width:18px;height:18px;accent-color:var(--gold); }
.live-hard-lock { border-color:rgba(245,183,0,.26); }
.live-config-actions { align-items:center; }
.live-primary-actions { position:sticky;bottom:10px;z-index:8;display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:16px;padding:11px;background:rgba(7,17,29,.94);border:1px solid var(--border-gold);border-radius:10px;backdrop-filter:blur(16px);box-shadow:0 16px 38px rgba(0,0,0,.25); }
.live-primary-actions small { color:var(--text-muted);font-size:10px; }
.settings-section .danger-button { color:#fff;background:linear-gradient(180deg,#c63e3e,#8e2323);border-color:#e66363; }
.live-wizard { margin-top:16px;padding:15px;background:rgba(5,12,21,.72);border:1px solid var(--border-gold);border-radius:10px;scroll-margin-top:78px; }
.live-stepper { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:15px 0;padding:0;list-style:none; }
.live-stepper li { min-width:0;display:flex;align-items:center;gap:7px;padding:8px;color:var(--text-muted);border-bottom:2px solid var(--border); }
.live-stepper li>span { width:25px;height:25px;flex:0 0 auto;display:grid;place-items:center;border:1px solid currentColor;border-radius:50%;font-size:10px;font-variant-numeric:tabular-nums; }
.live-stepper li small { overflow:hidden;font-size:9px;text-overflow:ellipsis;white-space:nowrap; }
.live-stepper li[aria-current="step"] { color:var(--gold-soft);border-color:var(--gold); }
.live-stepper li.is-complete { color:#8be59b;border-color:var(--green); }
.live-wizard-step { max-width:780px;margin:auto;padding:12px 0; }
.live-wizard-step[hidden],.live-wizard[hidden] { display:none; }
.live-review-list { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:12px 0; }
.live-review-list div { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;background:rgba(255,255,255,.018);border:1px solid var(--border);border-radius:6px; }
.live-review-list dt { color:var(--text-muted);font-size:10px; }
.live-review-list dd { margin:0;color:var(--text);font-size:11px;font-weight:700;direction:ltr;unicode-bidi:isolate; }
.live-wizard-nav { display:flex;justify-content:space-between;gap:9px;margin-top:12px; }
.telegram-wait-state { min-height:96px;display:flex;align-items:center;justify-content:center;gap:10px;padding:12px;background:rgba(255,255,255,.015);border:1px solid var(--border);border-radius:8px; }
.telegram-wait-state time { color:var(--gold-soft);font-variant-numeric:tabular-nums; }
.live-dialog { width:min(520px,calc(100vw - 24px));padding:0;color:var(--text);background:#091522;border:1px solid var(--border-gold);border-radius:12px;box-shadow:0 28px 80px rgba(0,0,0,.55); }
.live-dialog::backdrop { background:rgba(1,5,10,.72);backdrop-filter:blur(6px); }
.live-dialog form { padding:18px; }
.live-dialog-actions { display:flex;justify-content:flex-end;gap:8px; }

html[data-theme="light"] .live-overview-card,html[data-theme="light"] .live-environment-control,html[data-theme="light"] .live-gate,html[data-theme="light"] .live-config-details>summary,html[data-theme="light"] .choice-chip,html[data-theme="light"] .live-review-list div,html[data-theme="light"] .telegram-wait-state { background:#f8fafc; }
html[data-theme="light"] .live-primary-actions { background:rgba(255,255,255,.96);box-shadow:0 15px 35px rgba(15,23,42,.14); }
html[data-theme="light"] .live-wizard { background:#f8fafc; }
html[data-theme="light"] .live-dialog { color:#0f172a;background:#fff; }
html[data-theme="light"] .settings-section input[type="time"] { color:#0f172a;background:#fff;border-color:#94a3b8;color-scheme:light; }
html[data-theme="light"] .live-gate p { color:#334155; }

/* Upgrade */
.upgrade-workspace { display: grid; place-items: center; min-height: calc(100vh - var(--topbar-height)); }
.upgrade-card { width: min(620px, 100%); padding: 24px; }
.upgrade-card h2 { margin: 0; font-size: 22px; }
.upgrade-card form { margin-top: 15px; }
.version-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 16px 0; }
.version-grid div { padding: 12px; text-align: center; background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 6px; }
.version-grid dt { color: var(--text-muted); font-size: 9px; }
.version-grid dd { margin: 3px 0 0; color: var(--gold); font-size: 22px; font-weight: 700; }

/* Authentication */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 25% 20%, rgba(245,183,0,.07), transparent 30rem), linear-gradient(135deg, #050b14, #071321 60%, #040912); }
.login-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 13px; padding: 28px; background: rgba(7, 17, 29, .96); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 25px 80px rgba(0,0,0,.38); }
.install-box { width: min(500px, 100%); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.auth-brand strong { color: var(--gold-soft); font-size: 20px; }
.auth-brand small { color: var(--text-muted); font-size: 9px; }
.auth-heading { text-align: center; }
.auth-heading .eyebrow { text-align: center; }
.auth-heading h1 { margin: 0; font-size: 20px; }
.auth-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--text-muted); font-size: 10px; }
.login-box button { width: 100%; align-self: stretch; }
.login-box .error { margin: 0; color: var(--red); text-align: center; font-size: 10px; }
.login-box .success { margin: 0; color: var(--green); text-align: center; font-size: 10px; }
.install-intro { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.85; }
.auth-security { margin: 0; color: #607082; text-align: center; font-size: 9px; }
.human-trap { position:absolute !important;inset-inline-start:-10000px !important;width:1px !important;height:1px !important;overflow:hidden !important;opacity:0 !important;pointer-events:none !important; }
.auth-language-toggle { position:fixed;inset-block-start:max(14px,env(safe-area-inset-top));inset-inline-end:max(14px,env(safe-area-inset-right));z-index:3;min-width:48px;justify-content:center; }

button:active, .button-link:active, .side-nav-link:active { filter: brightness(.9); }

/* Market and exchange modules */
.chart-toolbar { display:flex;gap:6px;padding:8px 12px;border-bottom:1px solid var(--border);overflow-x:auto; }
.chart-toolbar button,.quote-filters button { min-height:34px;padding:5px 11px;color:var(--text-muted);background:transparent;border:1px solid var(--border);border-radius:6px;white-space:nowrap; }
.chart-toolbar button.active,.quote-filters button.active { color:#171000;background:var(--gold);border-color:var(--gold); }
.market-browser { overflow:hidden; }
.market-filterbar { display:flex;align-items:center;gap:12px;padding:14px;border-bottom:1px solid var(--border); }
.market-search { flex:1;min-width:220px; }
.market-search input { width:100%;min-height:42px;padding:8px 13px;color:var(--text);background:var(--surface-2);border:1px solid var(--border);border-radius:7px; }
.quote-filters { display:flex;gap:6px;overflow-x:auto; }
.market-table td:first-child strong,.market-table td:first-child small { display:block; }
.market-table td:first-child small { color:var(--text-muted);font-size:10px; }
.market-select-button { min-height:34px;padding:5px 10px;color:#171000;background:var(--gold);border:0;border-radius:6px;white-space:nowrap; }
.load-more-cell { text-align:center; }.load-more-cell .button-link { display:inline-flex; }
.loading-line::before { content:"";width:14px;height:14px;display:inline-block;margin-left:8px;vertical-align:middle;border:2px solid var(--border);border-top-color:var(--gold);border-radius:50%;animation:market-spin .8s linear infinite; }
@keyframes market-spin { to { transform:rotate(360deg); } }
.exchange-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
.exchange-card { padding:18px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow); }
.exchange-card.active { border-color:var(--border-gold);box-shadow:0 0 0 1px rgba(245,183,0,.12); }
.exchange-card-head { display:flex;align-items:center;gap:10px; }
.exchange-card-head h2,.exchange-card-head p { margin:0; }.exchange-card-head p,.exchange-card>p { color:var(--text-muted);font-size:11px; }
.exchange-logo { width:42px;height:42px;display:grid;place-items:center;color:#171000;background:linear-gradient(145deg,var(--gold),#d69200);border-radius:9px;font-weight:800; }
.connection-badge { margin-right:auto;padding:3px 8px;color:var(--text-muted);background:var(--surface-2);border:1px solid var(--border);border-radius:99px;font-size:9px; }
.connection-badge.online { color:var(--green);border-color:rgba(34,197,94,.3); }
.exchange-card dl { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0; }.exchange-card dl div { padding:9px;background:var(--surface-2);border:1px solid var(--border);border-radius:6px; }.exchange-card dt{color:var(--text-muted);font-size:9px}.exchange-card dd{margin:2px 0 0;font-size:11px}.exchange-card button{width:100%;justify-content:center;}
.route-loading #main-content { pointer-events:none; }
.app-view-exit { opacity:.55;transform:translateY(4px);transition:opacity .14s ease-in,transform .14s ease-in; }
.app-view-enter { animation:app-view-enter .28s cubic-bezier(.16,1,.3,1) both; }
@keyframes app-view-enter { from { opacity:0;transform:translateY(10px) scale(.995); } to { opacity:1;transform:none; } }
.app-route-progress { position:fixed;inset:0 0 auto;z-index:92;height:3px;overflow:hidden;pointer-events:none;opacity:0;transition:opacity .15s ease; }
.app-route-progress span { width:42%;height:100%;display:block;background:linear-gradient(90deg,transparent,var(--gold),var(--gold-soft),transparent);transform:translateX(-120%); }
.route-loading .app-route-progress { opacity:1; }
.route-loading .app-route-progress span { animation:route-progress .85s ease-in-out infinite; }
@keyframes route-progress { to { transform:translateX(280%); } }
.app-page-loader { position:fixed;inset:0;z-index:90;display:none;place-content:center;justify-items:center;gap:12px;color:var(--text);background:rgba(3,8,17,.72);backdrop-filter:blur(5px);font-size:12px;pointer-events:none; }
body:not(.app-ready) .app-page-loader,body.full-page-loading .app-page-loader { display:grid; }
.loader-orbit { width:42px;height:42px;border:3px solid rgba(245,183,0,.22);border-top-color:var(--gold);border-radius:50%;animation:market-spin .75s linear infinite; }
.app-update-card { position:fixed;inset:auto 20px 20px auto;z-index:96;width:min(430px,calc(100vw - 32px));display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:10px 12px;padding:14px;color:var(--text);background:rgba(10,21,34,.98);border:1px solid var(--border-gold);border-radius:14px;box-shadow:0 24px 65px rgba(0,0,0,.42);backdrop-filter:blur(18px);animation:update-card-in .26s cubic-bezier(.16,1,.3,1) both; }
html[dir="rtl"] .app-update-card { right:auto;left:20px; }
.app-update-card[hidden] { display:none; }
.app-update-icon { width:44px;height:44px;display:grid;place-items:center;color:#171000;background:linear-gradient(145deg,var(--gold-soft),var(--gold));border-radius:12px; }
.app-update-card strong { display:block;font-size:13px; }
.app-update-card p { margin:2px 0 0;color:var(--text-muted);font-size:10px;line-height:1.7; }
.app-update-actions { grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px; }
.app-update-actions button { min-height:44px;padding:8px 15px;border-radius:9px;font-weight:700; }
#app-update-apply { color:#181100;background:var(--gold);border:1px solid var(--gold-soft); }
#app-update-later { color:var(--text);background:var(--surface-3);border:1px solid var(--border); }
@keyframes update-card-in { from { opacity:0;transform:translateY(16px) scale(.97); } to { opacity:1;transform:none; } }
.notification-button { position:relative; }
.notification-badge { position:absolute;inset-block-start:-6px;inset-inline-end:-6px;min-width:20px;height:20px;padding:0 5px;place-items:center;color:#fff;background:var(--red);border:2px solid var(--bg);border-radius:99px;font-size:9px;font-weight:800; }
.notification-badge:not([hidden]) { display:grid; }
.notification-drawer { position:fixed;inset:0;z-index:80; }
.notification-scrim { position:absolute;inset:0;width:100%;height:100%;background:rgba(1,5,10,.68);border:0;backdrop-filter:blur(3px); }
.notification-panel { position:absolute;inset-block:0;inset-inline-end:0;width:min(420px,100%);overflow-y:auto;color:var(--text);background:var(--surface);border-inline-start:1px solid var(--border);box-shadow:0 0 55px rgba(0,0,0,.4); }
.notification-close { display:grid;margin-inline-start:auto; }
.notification-list { display:flex;flex-direction:column; }
.notification-item { display:grid;grid-template-columns:10px minmax(0,1fr);gap:10px;padding:13px 15px;color:inherit;border-bottom:1px solid var(--border);text-decoration:none; }
.notification-item:hover { background:var(--surface-2); }
.notification-item-dot { width:8px;height:8px;margin-top:7px;background:var(--gold);border-radius:50%;box-shadow:0 0 10px rgba(245,183,0,.45); }
.notification-item.news .notification-item-dot { background:var(--blue); }
.notification-item strong,.notification-item small { display:block; }
.notification-item strong { font-size:12px;line-height:1.8; }
.notification-item small { color:var(--text-muted);font-size:10px;line-height:1.8; }
.trade-opportunity-modal { position:fixed;inset:0;z-index:95;display:grid;place-items:center;padding:18px;background:rgba(1,5,10,.78);backdrop-filter:blur(7px); }
.trade-opportunity-card { width:min(520px,100%);padding:22px;color:var(--text);background:var(--surface);border:1px solid var(--border-gold);border-radius:12px;box-shadow:0 24px 80px rgba(0,0,0,.5); }
.trade-opportunity-card h2 { margin:4px 0;font-size:20px; }
.trade-opportunity-card p { color:var(--text-muted);font-size:11px;line-height:1.9; }
.trade-opportunity-stats { display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0; }
.trade-opportunity-stats div { padding:10px;background:var(--surface-2);border:1px solid var(--border);border-radius:7px; }
.trade-opportunity-stats small,.trade-opportunity-stats strong { display:block; }.trade-opportunity-stats small { color:var(--text-muted);font-size:9px; }.trade-opportunity-stats strong { margin-top:3px;font-size:14px; }
.trade-opportunity-actions { display:flex;gap:8px; }.trade-opportunity-actions button,.trade-opportunity-actions a { min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:8px 18px;border-radius:7px;text-decoration:none;font-weight:700;font-size:11px; }.trade-opportunity-actions .confirm { color:#07130a;background:var(--green);border:1px solid #7ae38e; }.trade-opportunity-actions .dismiss { color:var(--text);background:var(--surface-3);border:1px solid var(--border); }
.auth-link { color:var(--gold);text-align:center;text-decoration:none;font-size:11px; }.auth-link:hover { text-decoration:underline; }

/* Market intelligence, news and operations */
.intelligence-kpis,.news-kpis { grid-template-columns:repeat(4,minmax(0,1fr)); }
.scanner-layout { display:grid;grid-template-columns:minmax(360px,.82fr) minmax(440px,1.18fr);gap:12px;align-items:start;direction:ltr; }
.scanner-layout>* { direction:rtl; }
.opportunity-panel,.analysis-detail,.news-browser { overflow:hidden; }
.opportunity-list,.compact-feed { display:flex;flex-direction:column; }
.panel-loading,.compact-empty { min-height:110px;display:grid;place-items:center;padding:20px;color:var(--text-muted);font-size:11px;text-align:center; }
.opportunity-item { width:100%;min-height:68px;display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 13px;color:var(--text);text-align:right;background:transparent;border:0;border-bottom:1px solid var(--border); }
.opportunity-item:hover,.opportunity-item.active { background:var(--surface-2); }
.opportunity-item.active { box-shadow:inset -3px 0 0 var(--gold); }
.opportunity-rank,.compact-rank { width:28px;height:28px;display:grid;place-items:center;color:var(--gold);background:rgba(245,183,0,.08);border:1px solid var(--border-gold);border-radius:50%;font-size:10px;font-weight:700; }
.opportunity-name,.opportunity-metrics,.compact-title { min-width:0;display:flex;flex-direction:column; }
.opportunity-name strong,.compact-title strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px; }
.opportunity-name small,.opportunity-metrics small,.compact-title small { color:var(--text-muted);font-size:10px;line-height:1.7; }
.opportunity-metrics { align-items:flex-end; }
.opportunity-metrics strong { font-size:13px; }
.analysis-detail { min-height:520px; }
.analysis-header { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border-bottom:1px solid var(--border); }
.analysis-header h2 { margin:0;font-size:20px;direction:ltr;text-align:right; }
.analysis-price { margin:2px 0 0;color:var(--text-muted);font-size:12px; }
.analysis-score { width:72px;height:72px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:50%;border:5px solid var(--border);background:var(--surface-2); }
.analysis-score strong { font-size:20px;line-height:1; }.analysis-score small { margin-top:5px;color:var(--text-muted);font-size:8px; }
.score-positive { border-color:var(--green); }.score-negative { border-color:var(--red); }.score-watch { border-color:var(--gold); }
.recommendation-banner { margin:14px 16px 0;padding:10px 12px;border-radius:6px;font-size:12px;font-weight:700; }
.tone-positive { color:#9cf0ac;background:rgba(79,210,102,.09);border:1px solid rgba(79,210,102,.28); }.tone-negative { color:#ffabab;background:rgba(239,78,78,.08);border:1px solid rgba(239,78,78,.28); }.tone-watch,.tone-neutral { color:#ffe28a;background:rgba(245,183,0,.08);border:1px solid rgba(245,183,0,.25); }
.probability-block,.analysis-levels,.analysis-reasons { padding:12px 16px; }.probability-block h3,.analysis-levels h3,.analysis-reasons h3 { margin:0 0 9px;font-size:12px; }
.probability-row { margin-top:8px; }.probability-head { display:flex;justify-content:space-between;font-size:10px; }.probability-track { height:7px;margin-top:4px;overflow:hidden;background:var(--surface-3);border-radius:99px; }.probability-track span { height:100%;display:block;border-radius:inherit; }.probability-track .bullish { background:var(--green); }.probability-track .neutral { background:var(--gold); }.probability-track .bearish { background:var(--red); }
.analysis-metrics,.level-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0;padding:4px 16px 12px; }
.analysis-metrics div,.level-grid div { padding:9px;background:var(--surface-2);border:1px solid var(--border);border-radius:6px; }.analysis-metrics dt,.level-grid dt { color:var(--text-muted);font-size:9px; }.analysis-metrics dd,.level-grid dd { margin:3px 0 0;font-size:11px;font-weight:700; }
.analysis-reasons ul { margin:0;padding:0 18px 0 0;color:var(--text-muted);font-size:10px;line-height:2; }.analysis-actions { display:flex;gap:8px;padding:0 16px 14px; }.analysis-disclaimer { margin:0;padding:11px 16px;color:var(--text-muted);background:var(--surface-2);border-top:1px solid var(--border);font-size:9px;line-height:1.8; }
.news-list { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--border); }
.news-item { min-width:0;padding:15px;background:var(--surface); }.news-item h3 { margin:8px 0 0;font-size:13px;line-height:1.9; }.news-item h3 a { text-decoration:none; }.news-item h3 a:hover { color:var(--gold); }.news-item p { margin:6px 0 0;color:var(--text-muted);font-size:10px;line-height:1.9; }
.news-meta { display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--text-muted);font-size:9px; }.news-source { color:var(--gold);font-weight:700; }.sentiment-badge,.sentiment-dot { padding:2px 7px;border-radius:99px;font-size:9px;white-space:nowrap; }.sentiment-positive,.sentiment-dot.positive { color:#8dea9e;background:rgba(79,210,102,.1); }.sentiment-negative,.sentiment-dot.negative { color:#ff9e9e;background:rgba(239,78,78,.1); }.sentiment-neutral,.sentiment-dot.neutral { color:#d6dee7;background:var(--surface-3); }
.news-assets { display:flex;gap:5px;margin-top:9px;flex-wrap:wrap;direction:ltr;justify-content:flex-end; }.news-assets span { padding:2px 7px;color:var(--blue);background:rgba(74,168,255,.08);border:1px solid rgba(74,168,255,.2);border-radius:4px;font-size:9px; }
.dashboard-intelligence-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px; }.dashboard-intelligence-grid>section { overflow:hidden; }.panel-link-inline { min-height:32px;display:inline-flex;align-items:center;padding:4px 8px;color:var(--gold);text-decoration:none;font-size:10px; }.compact-opportunity,.compact-news-item { min-height:58px;display:flex;align-items:center;gap:10px;padding:9px 12px;color:var(--text);border-bottom:1px solid var(--border);text-decoration:none; }.compact-opportunity:hover,.compact-news-item:hover { background:var(--surface-2); }.compact-title { flex:1; }.compact-value { margin-right:auto;font-size:12px;font-weight:700; }.dashboard-widget-note { margin:0;padding:8px 12px;color:var(--text-muted);background:var(--surface-2);font-size:9px;line-height:1.7; }
.risk-overview,.system-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch; }.risk-meter,.risk-settings,.system-health-card,.log-panel { overflow:hidden; }.risk-meter { min-height:164px;display:flex;flex-direction:column;justify-content:flex-start;padding:17px; }.risk-meter h2 { margin:2px 0 13px;font-size:16px; }.risk-meter>strong { display:block;margin:auto 0 7px;color:var(--gold-soft);font-size:26px;line-height:1.2;direction:ltr;text-align:right; }.risk-meter>p:last-child { margin:0;color:var(--text-muted);font-size:11px;line-height:1.8; }.risk-settings { margin-top:12px; }.risk-meter .system-list { padding:6px 14px; }.table-actions { display:flex;gap:6px; }.mini-action { min-height:36px;padding:5px 10px;border-radius:5px;font-size:10px; }.mini-action.confirm { color:#07130a;background:var(--green);border:1px solid #80e891; }.mini-action.ignore { color:#fff;background:#a72f2f;border:1px solid #da5555; }.log-panel { grid-column:1/-1; }.log-panel pre { max-height:430px;margin:0;padding:14px;overflow:auto;color:#aab8c6;background:#030811;font:11px/1.8 Consolas,monospace;direction:ltr;text-align:left;white-space:pre-wrap; }
.system-health-card { min-width:0;min-height:230px;padding:17px;display:flex;flex-direction:column; }
.system-health-card h2 { margin:2px 0 10px;font-size:18px;line-height:1.5; }
.system-health-card .system-list { width:100%;margin-top:auto;padding:0; }
.system-health-card .system-list div { display:grid;grid-template-columns:minmax(90px,.8fr) minmax(0,1.2fr); }
.system-health-card .system-list dt { min-width:0; }
.system-health-card .system-list dd { min-width:0;max-width:none;text-align:end;unicode-bidi:plaintext;overflow-wrap:anywhere; }
.telegram-feature-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px; }
.telegram-poll-status { display:flex;flex-wrap:wrap;gap:8px 14px;padding:10px;color:var(--text-muted);background:var(--surface-2);border:1px solid var(--border);border-radius:6px;font-size:10px; }
.telegram-poll-status strong { width:100%;color:var(--red);overflow-wrap:anywhere; }
.pwa-install[hidden] { display:none !important; }

/* Light theme keeps the same hierarchy without dark hard-coded surfaces. */
html[data-theme="light"] .app-sidebar { background:linear-gradient(180deg,#fff,#f8fafc); }
html[data-theme="light"] .app-topbar { background:rgba(255,255,255,.94); }
html[data-theme="light"] .terminal-card,html[data-theme="light"] .kpi-card,html[data-theme="light"] .settings-section,html[data-theme="light"] .report-card,html[data-theme="light"] .upgrade-card { background:#fff; }
html[data-theme="light"] .polling-chip,html[data-theme="light"] .sidebar-control,html[data-theme="light"] .system-list div,html[data-theme="light"] .version-grid div { background:#f8fafc; }
html[data-theme="light"] .app-clock { color:#334155; }
html[data-theme="light"] .login-page { background:radial-gradient(circle at 25% 20%,rgba(245,183,0,.12),transparent 30rem),linear-gradient(135deg,#f8fafc,#eef2f7); }
html[data-theme="light"] .login-box { background:rgba(255,255,255,.97);box-shadow:0 25px 70px rgba(15,23,42,.12); }
html[data-theme="light"] input,html[data-theme="light"] select { color:#0f172a;background:#fff; }
html[data-theme="light"] .banner.warn { color:#7c5800;background:#fff8df; }
html[data-theme="light"] .side-nav-link:hover,html[data-theme="light"] .side-nav-link.active { background:#fff8df; }
html[data-theme="light"] .side-nav-link,html[data-theme="light"] .sidebar-logout,html[data-theme="light"] .polling-chip,html[data-theme="light"] .system-health { color:#475569; }
html[data-theme="light"] .side-nav-link.active { color:#805500;border-color:#e8c45c; }
html[data-theme="light"] .nav-section-label,html[data-theme="light"] .sidebar-brand small { color:#64748b; }
html[data-theme="light"] .kpi-card,html[data-theme="light"] .stat-box { background:linear-gradient(145deg,#fff,#f8fafc); }
html[data-theme="light"] .kpi-heading,html[data-theme="light"] .settings-section label,html[data-theme="light"] .login-box label { color:#334155; }
html[data-theme="light"] .kpi-value,html[data-theme="light"] .system-list dd,html[data-theme="light"] .signal-reason,html[data-theme="light"] .empty-state strong,html[data-theme="light"] .symbol-title strong { color:#0f172a; }
html[data-theme="light"] th { color:#334155;background:#f1f5f9;font-weight:600; }
html[data-theme="light"] td:last-child,html[data-theme="light"] .chart-legend-note,html[data-theme="light"] .disclaimer,html[data-theme="light"] .auth-security { color:#64748b; }
html[data-theme="light"] tbody tr:hover,html[data-theme="light"] .checkbox-label:hover { background:#f8fafc; }
html[data-theme="light"] .settings-section input[type="text"],html[data-theme="light"] .settings-section input[type="password"],html[data-theme="light"] .settings-section input[type="number"],html[data-theme="light"] .settings-section input[type="email"],html[data-theme="light"] .settings-section input[type="url"],html[data-theme="light"] .settings-section select { color:#0f172a;background:#fff;border-color:#94a3b8; }
html[data-theme="light"] .notification-panel,html[data-theme="light"] .trade-opportunity-card { background:#fff; }
html[data-theme="light"] .app-page-loader { color:#0f172a;background:rgba(241,245,249,.76); }
html[data-theme="light"] .app-update-card { color:#0f172a;background:rgba(255,255,255,.98);box-shadow:0 24px 65px rgba(15,23,42,.18); }
html[data-theme="light"] .mobile-tabbar { color:#64748b;background:rgba(255,255,255,.96);box-shadow:0 18px 48px rgba(15,23,42,.18); }
html[data-theme="light"] .mobile-tab-link.active { color:#7c5800;background:rgba(245,183,0,.14); }
html[data-theme="light"] .icon-text-button,html[data-theme="light"] .button-link,html[data-theme="light"] .button-secondary { color:#334155;background:#f8fafc;border-color:#cbd5e1; }
html[data-theme="light"] .system-list div,html[data-theme="light"] th,html[data-theme="light"] td { border-color:#dbe3ec; }
html[data-theme="light"] .history,html[data-theme="light"] .history .section-heading,html[data-theme="light"] .history .table-scroll,html[data-theme="light"] .trades-table,html[data-theme="light"] .trades-table tbody,html[data-theme="light"] .trades-table tbody tr,html[data-theme="light"] .trades-table td { color:#1e293b;background:#fff; }
html[data-theme="light"] .history .section-heading { padding:12px 14px;border-bottom:1px solid #cbd5e1; }
html[data-theme="light"] .trades-table thead,html[data-theme="light"] .trades-table th { color:#0f172a;background:#e8eef5; }
html[data-theme="light"] .trades-table tbody tr:hover,html[data-theme="light"] .trades-table tbody tr:hover td { background:#f8fafc; }
html[data-theme="light"] .trades-table td:last-child,html[data-theme="light"] .trades-table .table-subtext { color:#475569; }
html[data-theme="light"] .tone-positive { color:#166534; }html[data-theme="light"] .tone-negative { color:#991b1b; }html[data-theme="light"] .tone-watch,html[data-theme="light"] .tone-neutral { color:#7c5800; }
html[data-theme="light"] .status-confirmed,html[data-theme="light"] .sentiment-positive,html[data-theme="light"] .sentiment-dot.positive { color:#166534; }html[data-theme="light"] .status-pending { color:#785500; }html[data-theme="light"] .status-expired,html[data-theme="light"] .sentiment-negative,html[data-theme="light"] .sentiment-dot.negative { color:#991b1b; }html[data-theme="light"] .status-ignored,html[data-theme="light"] .sentiment-neutral,html[data-theme="light"] .sentiment-dot.neutral { color:#334155; }
html[data-theme="light"] .live-safety-banner,html[data-theme="light"] .banner.success,html[data-theme="light"] .connection-chip { color:#166534;background:#f0fdf4;border-color:#86efac; }
html[data-theme="light"] .live-safety-banner.is-locked,html[data-theme="light"] .connection-chip.is-error { color:#991b1b;background:#fef2f2;border-color:#fca5a5; }
html[data-theme="light"] .empty-icon { color:#475569;background:#f8fafc;border-color:#94a3b8; }
html[data-theme="light"] .log-panel pre { color:#dbeafe;background:#0f172a; }

@media (max-width: 1450px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .market-layout { grid-template-columns: 1fr; }
  .market-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scanner-layout { grid-template-columns:1fr; }
  .risk-overview,.system-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .live-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 920px) {
  :root { --sidebar-width: 270px; }
  .app-main { margin-inline-start: 0; }
  html[dir="rtl"] .app-main,html[dir="ltr"] .app-main { margin-left:0;margin-right:0; }
  .app-sidebar { width:min(86vw,340px);transition:transform .24s cubic-bezier(.16,1,.3,1);box-shadow:0 18px 55px rgba(0,0,0,.45);will-change:transform; }
  html[dir="rtl"] .app-sidebar { transform:translateX(102%); }
  html[dir="ltr"] .app-sidebar { transform:translateX(-102%); }
  html[dir="rtl"] .app-sidebar.is-open,
  html[dir="ltr"] .app-sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 45; display: block; visibility: hidden; background: rgba(1, 5, 10, .72); opacity: 0; transition: opacity .2s, visibility .2s; }
  .sidebar-overlay.is-visible { visibility: visible; opacity: 1; }
  .menu-button, .sidebar-close { display: grid; }
  .sidebar-close { margin-inline-start: auto; }
  html.nav-open,body.nav-open { overflow: hidden;overscroll-behavior:none; }
  .topbar-tools .polling-chip { display: none; }
  .settings-grid { column-count:1; }
  .settings-wide { column-span:none; }
  .exchange-grid { grid-template-columns:1fr; }
  .dashboard-intelligence-grid,.risk-overview,.system-grid { grid-template-columns:1fr; }
  .log-panel { grid-column:auto; }
}

@media (max-width: 680px) {
  body { font-size:16px; }
  .app-topbar { min-height:calc(60px + env(safe-area-inset-top));gap:6px;padding:calc(7px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 7px max(8px,env(safe-area-inset-left)); }
  .app-sidebar { padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom); }
  .topbar-title-group { min-width:0;flex:1;gap:8px; }
  .topbar-title-group>div { min-width:0; }
  .topbar-title-group h1 { overflow:hidden;font-size:15px;text-overflow:ellipsis;white-space:nowrap; }
  .topbar-title-group p, .user-chip, .app-clock { display: none; }
  .topbar-tools { flex:0 0 auto;gap:4px; }
  .topbar-tools .theme-toggle { width:44px;height:44px;min-height:44px;justify-content:center;padding:0; }
  .topbar-tools .theme-toggle:not(.language-toggle)>span:not(.notification-badge) { display:none; }
  .workspace { padding: 12px max(10px,env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
  .mobile-tabbar { position:fixed;inset:auto max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));z-index:40;min-height:68px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;padding:6px;color:var(--text-muted);background:rgba(7,17,29,.94);border:1px solid var(--border);border-radius:18px;box-shadow:0 18px 48px rgba(0,0,0,.38);backdrop-filter:blur(18px); }
  .mobile-tab-link { min-width:44px;min-height:54px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px 2px;color:inherit;background:transparent;border:0;border-radius:13px;text-decoration:none;font-size:9px;font-weight:600;transition:color .18s ease,background-color .18s ease,transform .18s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent; }
  .mobile-tab-link:active { transform:scale(.96); }
  .mobile-tab-link.active { color:var(--gold-soft);background:rgba(245,183,0,.09); }
  .mobile-tab-icon { width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
  .mobile-tab-link.active .mobile-tab-icon { filter:drop-shadow(0 0 6px rgba(245,183,0,.32)); }
  .mobile-more { font:inherit; }
  .workspace-intro, .page-heading { align-items: flex-start; flex-direction: column; }
  .intro-actions { width: 100%; justify-content: space-between; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-side-column { grid-template-columns: 1fr; }
  .terminal-card-header, .chart-subbar { align-items: flex-start; flex-direction: column; }
  .refresh-tools { width: 100%; justify-content: space-between; }
  .chart-tags { flex-wrap: wrap; }
  .price-chart-wrap { height: 300px; }
  .rsi-chart-wrap { height: 120px; }
  .form-grid, .stats { grid-template-columns: 1fr; }
  .intelligence-kpis,.news-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .news-list { grid-template-columns:1fr; }
  .analysis-metrics,.level-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .telegram-feature-grid { grid-template-columns:1fr; }
  .risk-meter { min-height:140px; }
  .table-scroll { overscroll-behavior-inline:contain;scrollbar-width:thin; }
  .settings-section { padding: 13px; }
  .settings-section input[type="text"],.settings-section input[type="password"],.settings-section input[type="number"],.settings-section input[type="email"],.settings-section input[type="url"],.settings-section select,.market-search input,.login-box input { font-size:16px; }
  .terminal-card,.history,.settings-section,.kpi-card,.stat-box { border-radius:14px; }
  .sidebar-control { bottom:calc(88px + env(safe-area-inset-bottom));max-height:calc(100dvh - 116px); }
  html[dir="rtl"] .sidebar-control { left:max(10px,env(safe-area-inset-left));right:auto; }
  html[dir="ltr"] .sidebar-control { right:max(10px,env(safe-area-inset-right));left:auto; }
  .app-update-card { inset:auto max(10px,env(safe-area-inset-right)) calc(88px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));width:auto; }
  .settings-section button { width: 100%; align-self: stretch; }
  .form-actions { flex-direction: column; }
  .version-grid { grid-template-columns: 1fr; }
  .full-live-control { padding:13px; }
  .live-control-header,.live-section-heading,.live-wizard-heading { flex-direction:column; }
  .live-state-stack { width:100%;justify-content:space-between; }
  .live-safety-banner { align-items:flex-start;flex-direction:column; }
  .live-overview-grid,.live-gate-matrix,.live-form-grid,.live-review-list { grid-template-columns:1fr; }
  .field-span-2 { grid-column:auto; }
  .live-environment-control { grid-template-columns:1fr; }
  .live-environment-control .help-text { grid-column:auto; }
  .live-gate { grid-template-columns:28px minmax(0,1fr); }
  .live-gate time { grid-column:2; }
  .live-config-details>summary { align-items:flex-start;flex-direction:column; }
  .live-primary-actions { bottom:calc(84px + env(safe-area-inset-bottom));align-items:stretch;flex-direction:column; }
  .live-primary-actions small { text-align:center; }
  .live-stepper { gap:2px; }
  .live-stepper li { justify-content:center;padding:6px 2px; }
  .live-stepper li small { display:none; }
  .live-wizard-nav,.live-dialog-actions { flex-direction:column-reverse; }
  .settings-section input[type="time"] { font-size:16px; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 98px; }
  .signal-actions { grid-template-columns: 1fr; }
  .refresh-tools { align-items: stretch; flex-direction: column; }
  .icon-text-button { width: 100%; }
  .market-filterbar { align-items:stretch;flex-direction:column; }.market-search{min-width:0}
  .intelligence-kpis,.news-kpis { grid-template-columns:1fr; }
  .analysis-actions { flex-direction:column; }.analysis-actions .button-link { width:100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* UI stability layer: keeps every operational page aligned in both directions. */
html[lang="en"] body { font-family:Inter,"Segoe UI",Arial,sans-serif; }
.settings-grid { display:block;column-count:2;column-gap:12px; }
.settings-section { display:inline-block;width:100%;min-width:0;margin:0 0 12px;padding:16px;break-inside:avoid; }
.settings-wide { column-span:all; }
.settings-section form,.settings-section fieldset,.settings-section label,.form-grid>* { min-width:0; }
.settings-section select,.settings-section input { max-width:100%; }
.risk-settings { margin-top:12px; }
.stat-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:12px 14px 14px; }
.system-grid + .log-panel,.table-scroll + .table-scroll,.history + .history { margin-top:12px; }
.system-grid { margin-bottom:0; }
.log-panel { min-width:0;margin-top:12px; }
.log-panel pre { min-height:180px;max-height:min(430px,52vh);overflow:auto;scrollbar-gutter:stable; }
.table-scroll { width:100%;max-width:100%;scrollbar-gutter:stable; }
.table-toolbar { display:flex;align-items:end;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border);background:rgba(255,255,255,.012); }
.table-search-form { display:flex;align-items:end;gap:8px;flex:1;min-width:0; }
.table-search-form label { display:flex;flex:1;max-width:440px;flex-direction:column;gap:5px;color:var(--text-muted);font-size:10px; }
.table-search-form input,.table-search-form select { width:100%;min-width:0;min-height:42px;padding:8px 10px;color:var(--text);background:#06101b;border:1px solid #26394d;border-radius:6px;font:inherit; }
.table-search-form button { min-height:42px;padding:8px 14px;color:#171000;background:linear-gradient(180deg,#ffc928,#db9f00);border:1px solid #ffda5d;border-radius:6px;font-weight:700;cursor:pointer; }
.table-pagination { min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 14px;color:var(--text-muted);border-top:1px solid var(--border);font-size:10px; }
.pagination-actions { display:flex;align-items:center;justify-content:center;gap:7px; }
.pagination-button { min-height:38px;display:inline-flex;align-items:center;justify-content:center;padding:6px 11px;color:var(--text);background:var(--surface-2);border:1px solid var(--border);border-radius:6px;text-decoration:none; }
.pagination-button:hover { color:var(--gold-soft);border-color:rgba(245,183,0,.45); }
.pagination-button.is-disabled { opacity:.42;pointer-events:none; }
.pagination-current { color:var(--text);font-variant-numeric:tabular-nums;white-space:nowrap; }
.pagination-size { display:flex;align-items:center;flex-direction:row;gap:7px;white-space:nowrap; }
.pagination-size select { min-width:70px;min-height:38px;padding:5px 8px;color:var(--text);background:#06101b;border:1px solid #26394d;border-radius:6px; }
.loader-brand { position:relative;width:72px;height:72px;display:grid;place-items:center; }
.loader-brand .brand-mark { width:38px;height:46px;filter:drop-shadow(0 0 12px rgba(245,183,0,.28)); }
.loader-ring { position:absolute;inset:0;border:2px solid rgba(245,183,0,.16);border-top-color:var(--gold);border-radius:50%;animation:market-spin .85s linear infinite; }
.app-page-loader>strong { color:var(--gold-soft);font-size:16px;letter-spacing:.03em; }
.app-page-loader>span:last-child { color:var(--text-muted); }
button,.button-link,.icon-text-button,.pagination-button { cursor:pointer;touch-action:manipulation; }
button:disabled,[aria-disabled="true"] { cursor:not-allowed; }
.live-environment-control>* { min-width:0; }
.live-environment-control select { width:100%; }

html[data-theme="light"] .table-toolbar { background:#f8fafc; }
html[data-theme="light"] .table-search-form input,html[data-theme="light"] .table-search-form select,html[data-theme="light"] .pagination-size select { color:#0f172a;background:#fff;border-color:#94a3b8; }
html[data-theme="light"] .pagination-button { color:#334155;background:#f8fafc;border-color:#cbd5e1; }
html[data-theme="light"] .pagination-current { color:#0f172a; }
html[data-theme="light"] .loader-brand .brand-mark { filter:drop-shadow(0 0 10px rgba(185,129,0,.2)); }

@media (max-width:1180px) {
  .settings-grid { column-count:1; }
  .settings-wide { column-span:none; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:680px) {
  .table-toolbar,.table-search-form,.table-pagination { align-items:stretch;flex-direction:column; }
  .table-search-form label { max-width:none; }
  .table-search-form button,.pagination-button { min-height:44px; }
  .pagination-actions { justify-content:space-between; }
  .pagination-size { justify-content:space-between; }
  .log-panel pre { max-height:55vh;font-size:10px; }
  .stat-grid { grid-template-columns:1fr;padding:10px; }
}
