/* Analytic: the target planner for the MT5 app. Always dark. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: #0b0d12; color: #e8eaee; font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
a { color: #6aa5ff; }
.icon { display: block; flex: none; }
:root { --line: #222733; --card: #141821; --muted: #8b919c; --blue: #2f7bf5; --gold: #f2c94c; --up: #4bc27a; --down: #ef5f55; }

.an-tile { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(160deg, #16365e, #0a1426); box-shadow: inset 0 0 0 1px rgb(255 216 77 / .28); }
.an-tile svg { width: 24px; height: 24px; }
.an-tile.has-logo { overflow: hidden; }
.an-tile > img { width: 100%; height: 100%; object-fit: cover; }

.an, .an-login { max-width: 720px; margin: 0 auto; padding: 14px 16px 40px; }
.an-head { display: flex; align-items: center; justify-content: space-between; }
.an-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; }
.an-out { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.an-head form { margin: 0; }
.an-desk { margin-left: auto; margin-right: 8px; color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); text-decoration: none; font-weight: 600; }
.an-sim { margin: 12px 0; padding: 8px 12px; border-radius: 10px; background: #2a2208; color: var(--gold); font-size: 12.5px; }

.an-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.an-accounts a { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: inherit; text-decoration: none; }
.an-accounts a span { font-weight: 600; }
.an-accounts a b { color: var(--muted); font-weight: 400; font-size: 13px; }
.an-accounts a[aria-current="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }

.an-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.an-card + .an-card, .an-result { margin-top: 14px; }
.an-card h2 { margin: 0 0 10px; font-size: 18px; }
.an-card h3 { margin: 18px 0 8px; font-size: 15px; }
.an-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.an-facts dt { color: var(--muted); font-size: 12px; }
.an-facts dd { margin: 2px 0 0; font-weight: 700; }

.an-form { display: grid; gap: 14px; }
.an-form label, .an-field { display: grid; gap: 6px; }
.an-form label > span, .an-field > span { color: var(--muted); font-size: 12.5px; }
.an-money { display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #0b0d12; }
.an-money input { flex: 1; min-width: 0; height: 56px; border: 0; background: none; color: #fff; font: inherit; font-size: 28px; font-weight: 700; outline: none; }
.an-money b { color: var(--muted); }
.an-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.an-form select { height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #0b0d12; color: #fff; font: inherit; }
.an-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.an-chips button { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #0b0d12; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.an-chips button[aria-pressed="true"] { border-color: var(--blue); color: #fff; background: #0f1b31; }
.an-hint { margin: 0; color: var(--muted); font-size: 12.5px; }
.an-go { height: 52px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; }
.an-go:disabled { opacity: .6; }
.an-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #3a1414; color: #ff9b94; font-size: 13.5px; }
.an-error[hidden], .an-result[hidden], .an-toast[hidden] { display: none; }
.an-warn { border-color: #5a4310; }
.an-note { margin: -4px 0 10px; color: var(--gold); font-size: 13px; }
.an-link { display: inline-block; margin-top: 8px; }

.an-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.an-summary div { padding: 10px; border-radius: 10px; background: #0b0d12; }
.an-summary dt { color: var(--muted); font-size: 12px; }
.an-summary dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; }
.an-table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.an-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.an-table th { padding: 6px 8px; color: var(--muted); font-weight: 500; font-size: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.an-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.an-table small { display: block; color: var(--muted); font-size: 11.5px; }
.an-buy { color: var(--blue); }
.an-up { color: var(--up); font-weight: 600; }
.an-down { color: var(--down); }
.an-price { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.an-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.an-done { padding: 12px; border: 1px solid #1d4a2f; border-radius: 12px; background: #0f2418; }
.an-done h3 { margin: 0 0 6px; color: var(--up); }
.an-done ul { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; }

.an-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; background: #e8eaee; color: #000; font-size: 14px; }

/* Sign in */
.an-login { display: grid; gap: 18px; padding-top: 56px; max-width: 440px; }
.an-login-brand { display: grid; justify-items: center; gap: 6px; text-align: center; }
.an-login-tile { width: 72px; height: 72px; border-radius: 20px; }
.an-login-tile svg { width: 44px; height: 44px; }
.an-login-brand h1 { margin: 6px 0 0; font-size: 26px; }
.an-login-brand p { margin: 0; color: var(--muted); }
.an-login-form { display: grid; gap: 14px; }
.an-login-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.an-login-form input { height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #141821; color: #fff; font: inherit; font-size: 16px; outline: none; }
.an-login-form input:focus { border-color: var(--blue); }
.an-login-form .an-hint { text-align: center; font-size: 14px; }

@media (max-width: 480px) {
  .an-summary { grid-template-columns: repeat(2, 1fr); }
}

/* keep everything inside the phone's width */
.an-card, .an-form, .an-form > *, .an-row > *, .an-field > * { min-width: 0; }
.an-form select, .an-money { width: 100%; }
.an-chips button { min-width: 0; padding: 0 6px; }
.an-target > *, .an-form label > * { min-width: 0; } .an-money input { width: 100%; }

/* The analysis report: signal, indicator pills, the chart, legend and the reasoning */
.an-report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.an-report-head h2 { margin: 2px 0 0; }
.an-kicker { color: var(--muted); font-size: 12px; }
.an-signal { padding: 6px 14px; border-radius: 8px; font-weight: 700; letter-spacing: .08em; }
.an-signal.is-buy { background: #0f2a4f; color: #6aa5ff; }
.an-signal.is-sell { background: #3a1414; color: #ff8a80; }
.an-sell { color: var(--down); }
.an-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.an-pills span { display: grid; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #0b0d12; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.an-pills i { color: var(--muted); font-style: normal; font-weight: 400; font-size: 11px; }
.an-chart { display: block; width: 100%; height: 340px; margin: 4px 0 8px; border-radius: 10px; background: #0d1017; }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 11.5px; }
.an-legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.k-ema9::before { background: #ffd84d; } .k-ema21::before { background: #ff8c42; } .k-bb::before { background: rgba(140,160,220,.6); }
.k-trend::before { background: #9aa7ff; } .k-sr::before { background: linear-gradient(90deg, #3fa7d6 50%, #c77dff 50%); }
.k-tp::before { background: #4bc27a; } .k-sl::before { background: #ef5f55; } .k-path::before { background: repeating-linear-gradient(90deg, #4bc27a 0 3px, transparent 3px 6px); }
.an-why { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; font-size: 14px; }
.an-why b { color: #fff; }
@media (max-width: 480px) { .an-chart { height: 300px; } }

/* Scanner (shown for a few seconds after Analyse) */
.an-scan { position: relative; overflow: hidden; border-color: #1f3a66; background: radial-gradient(120% 80% at 50% 0%, #0f1d36 0%, #121722 60%); }
.an-scan::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 3px); }
.an-scan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; }
.an-scan-head span:last-child { margin-left: auto; color: #6aa5ff; font-variant-numeric: tabular-nums; font-weight: 700; }
.an-scan-dot { width: 10px; height: 10px; border-radius: 50%; background: #4bc27a; box-shadow: 0 0 0 0 rgba(75,194,122,.6); animation: an-pulse 1.2s infinite; }
@keyframes an-pulse { 70% { box-shadow: 0 0 0 10px rgba(75,194,122,0); } 100% { box-shadow: 0 0 0 0 rgba(75,194,122,0); } }
.an-scan-chart { display: block; width: 100%; height: 150px; border-radius: 10px; background: #0b111d; }
.an-scan-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-top: 12px; }
.an-formulas p { margin: 0 0 6px; font-family: "Cambria Math", Georgia, serif; font-size: 13.5px; color: #cfe0ff; }
.an-formulas em { display: block; color: #6f8fc4; font-family: "IBM Plex Sans", sans-serif; font-style: normal; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.an-matrix-wrap { display: grid; align-content: start; gap: 6px; }
.an-matrix-label { color: #6f8fc4; font-family: "Cambria Math", Georgia, serif; font-size: 12.5px; }
.an-matrix { border-collapse: separate; border-spacing: 3px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: #9fd0ff; }
.an-matrix td { padding: 4px 5px; border-radius: 4px; background: rgba(47,123,245,.12); text-align: right; font-variant-numeric: tabular-nums; }
.an-scan-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 12px 0 8px; padding: 0; list-style: none; font-size: 12.5px; color: #59627a; }
.an-scan-steps li::before { content: "○ "; }
.an-scan-steps li.is-now { color: #6aa5ff; }
.an-scan-steps li.is-now::before { content: "◉ "; }
.an-scan-steps li.is-done { color: #4bc27a; }
.an-scan-steps li.is-done::before { content: "✓ "; }
@media (max-width: 480px) { .an-scan-grid { grid-template-columns: 1fr; } .an-scan-steps { grid-template-columns: 1fr; } }

/* Signal strength and the event feed */
.an-strength { display: flex; align-items: center; gap: 12px; margin: 12px 0 2px; padding: 10px 12px; border: 1px solid #1f3a66; border-radius: 12px; background: #0d1626; }
.an-strength svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.an-ring-track { fill: none; stroke: #1b2740; stroke-width: 5; }
.an-ring { fill: none; stroke: #4bc27a; stroke-width: 5; stroke-linecap: round; }
.an-strength div { display: grid; }
.an-strength b { font-size: 22px; color: #fff; font-variant-numeric: tabular-nums; }
.an-strength span { color: var(--muted); font-size: 12.5px; }
.an-card h3 small { color: var(--gold); font-weight: 400; font-size: 11.5px; margin-left: 6px; }
.an-events { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 6px; }
.an-events li { display: grid; grid-template-columns: auto 74px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #0b0d12; font-size: 13px; }
.an-events b { color: var(--muted); font-weight: 500; font-size: 12px; }
.an-impact { display: inline-flex; gap: 2px; }
.an-impact i { width: 5px; height: 12px; border-radius: 2px; background: #2a3142; }
.an-impact.is-low i:nth-child(-n+1), .an-impact.is-medium i:nth-child(-n+2), .an-impact.is-high i { background: currentColor; }
.an-impact.is-high { color: #ef5f55; } .an-impact.is-medium { color: #f2c94c; } .an-impact.is-low { color: #4bc27a; }
/* Auto-trading switch (planner and Desk share it) */
.an-auto { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.an-auto[data-on="1"] { border-color: color-mix(in srgb, var(--up) 55%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 35%, transparent); }
.an-auto-switch { position: relative; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: #3a3f4b; cursor: pointer; transition: background .2s; }
.an-auto-switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.an-auto-switch[aria-checked="true"] { background: var(--up); }
.an-auto-switch[aria-checked="true"] i { transform: translateX(20px); }
.an-auto b { display: block; font-size: 14px; }
.an-auto em { font-style: normal; color: var(--muted); }
.an-auto[data-on="1"] em { color: var(--up); }
.an-auto small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.an-auto-lots { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }
.an-auto-lots input { width: 72px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #0d1017; color: #fff; font: inherit; font-size: 13px; }
@media (max-width: 480px) { .an-auto { grid-template-columns: auto 1fr; } .an-auto-lots { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; } }
/* the picked target and wait, in one line (positions chosen) */
.an-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; background: #0b0d12; color: var(--muted); font-size: 14px; }
.an-pick b { color: #fff; font-size: 16px; }
.an-pick[hidden], [data-an-manual][hidden] { display: none !important; }
/* the MT5 Algo Trading connection under the auto-trading switch */
.an-link { display: block; margin-top: 4px; color: #3ddc84 !important; font-weight: 600; }
.an-link::before { content: "● "; }
.an-link.is-off { color: #ff6b6b !important; }
/* Entry timing on the plan: waiting (amber), ENTER NOW (green, pulsing), missed (grey) */
.an-entry { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin: 4px 0 12px; padding: 12px 14px; border: 1px solid #3a3e47; border-radius: 12px; background: #11141a; }
.an-entry b { display: block; font-size: 15.5px; } .an-entry small { display: block; margin-top: 2px; color: #9aa1ad; font-size: 12.5px; }
.an-entry strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.an-entry-dot { width: 12px; height: 12px; border-radius: 50%; background: #f2c94c; animation: an-blink 1s steps(1) infinite; }
.an-entry.is-wait { border-color: #6b5a1e; } .an-entry.is-wait b, .an-entry.is-wait strong { color: #f2c94c; }
.an-entry.is-go { border-color: #2fbf71; background: #0b2016; animation: an-go-pulse 1s ease-in-out infinite; }
.an-entry.is-go b, .an-entry.is-go strong { color: #3ddc84; } .an-entry.is-go .an-entry-dot { background: #3ddc84; animation-duration: .5s; }
.an-entry.is-missed b { color: #c9cdd4; } .an-entry.is-missed .an-entry-dot { background: #6b7280; animation: none; }
.an-entry-again { padding: 9px 12px; border: 1px solid #3a3e47; border-radius: 10px; background: none; color: #e8eaee; font: inherit; font-size: 13px; cursor: pointer; }
@keyframes an-blink { 50% { opacity: .25; } }
@keyframes an-go-pulse { 50% { box-shadow: 0 0 0 4px rgb(47 191 113 / .25); } }
.an-go.is-now { background: #22c55e; color: #03130a; font-weight: 700; letter-spacing: .04em; box-shadow: 0 0 18px rgb(34 197 94 / .45); }
.an-early { display: block; margin: 8px auto 0; padding: 6px 10px; border: 0; background: none; color: #9aa1ad; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.an-early[hidden] { display: none; }
/* auto-place good analyses (under Analyse) */
.an-autogood { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin-top: 12px; padding: 12px 14px; border: 1px solid #262a33; border-radius: 12px; background: #0e1116; }
.an-autogood b { display: block; font-size: 14.5px; } .an-autogood small { display: block; margin-top: 3px; color: #9aa1ad; font-size: 12.5px; line-height: 1.7; }
.an-autogood select { padding: 1px 4px; border: 1px solid #3a3e47; border-radius: 6px; background: #161a22; color: #e8eaee; font: inherit; font-size: 12.5px; }
.an-entry small.an-entry-auto { margin-top: 4px; color: #ff9b8a; } .an-entry small.an-entry-auto.is-ok { color: #3ddc84; }

/* No scrollbars anywhere in the app (it still scrolls, like a phone app) */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* market buttons: only open markets can be chosen */
.an-markets { display: grid; gap: 8px; margin: 10px 0; }
.an-markets-label { font-size: 13px; color: var(--muted, #9aa0a6); }
.an-markets-label small { opacity: .8; }
.an-mkt-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.an-chip { display: grid; gap: 2px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.04); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.an-chip b { font-size: 14px; }
.an-chip small { font-size: 11.5px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-chip.is-on { border-color: #2f6fe0; background: rgba(47,111,224,.18); }
.an-chip:disabled { opacity: .38; cursor: not-allowed; }
.an-chip:disabled small { color: #f0b90b; opacity: 1; }
