/* Forex Live — plain CSS (no build step). Dark trading theme. */
:root {
  --bg: oklch(0.09 0.025 264.695);
  --fg: oklch(0.984 0.003 247.858);
  --card: oklch(0.155 0.03 265.755);
  --popover: oklch(0.208 0.042 265.755);
  --primary: oklch(0.929 0.013 255.508);
  --primary-fg: oklch(0.208 0.042 265.755);
  --muted: oklch(0.279 0.041 260.031);
  --muted-fg: oklch(0.704 0.04 256.788);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.551 0.027 264.364);
  --destructive: oklch(0.704 0.191 22.216);
  --emerald: #10b981; --emerald-l: #34d399;
  --rose: #f43f5e; --rose-l: #fb7185;
  --amber: #f59e0b; --amber-l: #fbbf24;
  --sky: #0ea5e9; --sky-l: #38bdf8;
  --indigo: #6366f1; --indigo-l: #818cf8;
  --violet: #8b5cf6;
  --radius: 0.625rem;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: color-mix(in oklch, var(--indigo) 45%, transparent); }

/* ---------- Layout ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .5rem; padding: .75rem 1rem;
  border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--bg) 95%, transparent);
  backdrop-filter: blur(8px);
}
.app-header h1 { font-size: 1.125rem; font-weight: 600; }
.page { padding: 1rem; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.page > *, .tab-panel, .desk-main > * { min-width: 0; }
.container { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1rem; }
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.stack > * + * { margin-top: .75rem; }
.stack-sm > * + * { margin-top: .5rem; }
.stack-lg > * + * { margin-top: 1rem; }
.row { display: flex; align-items: center; gap: .5rem; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.between { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.grid { display: grid; gap: 1rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.desk-main { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .sm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .md-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .desk-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}
.max-w-sm { max-width: 24rem; } .max-w-md { max-width: 28rem; width: 100%; } .max-w-2xl { max-width: 42rem; } .max-w-3xl { max-width: 48rem; }
.w-full { width: 100%; } .flex-1 { flex: 1 1 0%; min-width: 0; } .shrink-0 { flex-shrink: 0; } .ml-auto { margin-left: auto; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; }
.p-0 { padding: 0 !important; } .p-2 { padding: .5rem; } .p-3 { padding: .75rem; } .px-2 { padding-left: .5rem; padding-right: .5rem; } .py-1 { padding-top: .25rem; padding-bottom: .25rem; } .py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.overflow-x { overflow-x: auto; -webkit-overflow-scrolling: touch; } .overflow-y { overflow-y: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide-sm { display: none; } @media (min-width: 768px) { .hide-sm { display: inline; } }

/* ---------- Text ---------- */
.muted { color: var(--muted-fg); } .text-xs { font-size: .75rem; line-height: 1rem; } .text-2xs { font-size: 11px; line-height: 1rem; } .text-3xs { font-size: 10px; line-height: .9rem; }
.text-sm { font-size: .875rem; } .text-base { font-size: 1rem; } .text-lg { font-size: 1.125rem; } .text-xl { font-size: 1.25rem; } .text-2xl { font-size: 1.5rem; } .text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.mono, .tabular { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.uppercase { text-transform: uppercase; letter-spacing: .04em; } .text-center { text-align: center; } .text-right { text-align: right; }
.up, .text-emerald { color: var(--emerald-l); } .down, .text-rose { color: var(--rose-l); } .text-amber { color: var(--amber-l); } .text-sky { color: var(--sky-l); } .text-indigo { color: var(--indigo-l); }
.leading-relaxed { line-height: 1.65; } .whitespace-pre { white-space: pre-wrap; } .break { word-break: break-word; }

/* ---------- Card ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: 0 1px 2px rgb(0 0 0 / .25); min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; }
.card-t { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.card-d { color: var(--muted-fg); font-size: .875rem; }
.card-b { padding: 0 1rem 1rem; }
.card-b.flush { padding: 0; }
.card.highlight { border-color: var(--primary); box-shadow: 0 10px 30px rgb(0 0 0 / .35); }
.divider { border-top: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; white-space: nowrap;
  height: 2.25rem; padding: 0 1rem; border-radius: calc(var(--radius) - 2px); font-size: .875rem; font-weight: 500;
  background: var(--primary); color: var(--primary-fg); cursor: pointer; transition: background .15s, opacity .15s, border-color .15s;
  border: 1px solid transparent; text-decoration: none; user-select: none;
}
.btn:hover { opacity: .9; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .tab:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--input); }
.btn-outline:hover { background: var(--muted); opacity: 1; }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--muted); opacity: 1; }
.btn-secondary { background: var(--muted); color: var(--fg); }
.btn-danger { background: var(--destructive); color: #fff; }
.btn-success { background: var(--emerald); color: #fff; }
.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .8125rem; }
.btn-xs { height: 1.6rem; padding: 0 .5rem; font-size: .75rem; }
.btn-icon { width: 2.25rem; padding: 0; } .btn-sm.btn-icon { width: 2rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; font-size: .875rem; }
.icon { width: 1rem; height: 1rem; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: .75rem; height: .75rem; }

/* ---------- Forms ---------- */
.label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; }
.input, .select, .textarea {
  width: 100%; height: 2.25rem; padding: 0 .75rem; border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input); background: transparent; font-size: .875rem; min-width: 0;
}
.textarea { height: auto; min-height: 5rem; padding: .5rem .75rem; resize: vertical; }
.select { appearance: none; padding-right: 2rem; cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .65rem center; }
.select option, .select optgroup { background: var(--popover); color: var(--fg); }
.input-sm, .select-sm { height: 2rem; font-size: .8125rem; }
.input::placeholder, .textarea::placeholder { color: var(--muted-fg); }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .875rem; }
.check input { width: 1rem; height: 1rem; accent-color: var(--indigo); }
.switch { position: relative; display: inline-block; width: 2.25rem; height: 1.25rem; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--input); transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 1rem; height: 1rem; left: .125rem; top: .125rem; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--emerald); }
.switch input:checked + span::before { transform: translateX(1rem); }
input[type=range] { width: 100%; accent-color: var(--indigo); }
.field-hint { font-size: .75rem; color: var(--muted-fg); margin-top: .25rem; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; max-width: 100%; overflow-x: auto; gap: .25rem; padding: .25rem; border-radius: var(--radius); background: var(--muted); }
.tab { flex-shrink: 0; height: 2rem; padding: 0 .85rem; border-radius: calc(var(--radius) - 4px); background: transparent; color: var(--muted-fg); font-size: .875rem; font-weight: 500; cursor: pointer; border: 0; white-space: nowrap; }
.tab:hover { color: var(--fg); }
.tab.active { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .3); }
@media (max-width: 640px) { #desk-tabs { flex-wrap: wrap; } } /* all three desks visible on phones (no hidden scroll) */
.tabs.full { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.tab-panel { margin-top: 1rem; }

/* ---------- Badges, pills, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: .3rem; padding: .1rem .5rem; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.b-muted { background: var(--muted); color: var(--muted-fg); }
.b-primary { background: color-mix(in oklch, var(--primary) 20%, transparent); color: var(--primary); }
.b-emerald { background: rgb(16 185 129 / .18); color: var(--emerald-l); }
.b-rose { background: rgb(244 63 94 / .18); color: var(--rose-l); }
.b-amber { background: rgb(245 158 11 / .18); color: var(--amber-l); }
.b-sky { background: rgb(14 165 233 / .18); color: var(--sky-l); }
.b-indigo { background: rgb(99 102 241 / .2); color: var(--indigo-l); }
button.badge { border: 0; cursor: pointer; }
.pill { display: inline-flex; align-items: center; border-radius: .3rem; padding: .1rem .4rem; font-size: .75rem; font-weight: 500; white-space: nowrap; }
.pill.up { background: rgb(16 185 129 / .15); color: var(--emerald-l); }
.pill.down { background: rgb(244 63 94 / .15); color: var(--rose-l); }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--border);
  padding: .5rem .75rem; font-size: .875rem; background: transparent; cursor: pointer; transition: background .15s, border-color .15s;
}
.chip:hover { background: var(--muted); }
.chip.active { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 10%, transparent); }
.chip .x { opacity: 0; transition: opacity .15s; display: inline-flex; padding: 2px; border-radius: 4px; }
.chip:hover .x, .chip:focus-within .x { opacity: 1; }
@media (hover: none) { .chip .x { opacity: .6; } }
.toggle-chip { border-radius: 999px; border: 1px solid var(--border); padding: .15rem .6rem; font-size: .75rem; background: transparent; cursor: pointer; color: var(--muted-fg); }
.toggle-chip.on { background: color-mix(in oklch, var(--primary) 15%, transparent); color: var(--fg); border-color: color-mix(in oklch, var(--primary) 40%, transparent); }

/* ---------- Bars, tables ---------- */
.bar { display: flex; height: .5rem; width: 100%; overflow: hidden; border-radius: .25rem; background: var(--muted); }
.bar.lg { height: .625rem; }
.bar > i { display: block; height: 100%; }
.bg-emerald { background: var(--emerald); } .bg-rose { background: var(--rose); } .bg-neutral { background: color-mix(in oklch, var(--muted-fg) 40%, transparent); } .bg-amber { background: var(--amber); } .bg-sky { background: var(--sky); }
.table { width: 100%; font-size: .875rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted-fg); font-size: .75rem; padding: .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: .35rem .5rem; }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 1.5rem; text-align: center; color: var(--muted-fg); font-size: .875rem; border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- Price flashes ---------- */
@keyframes flash-up { 0% { color: rgb(52 211 153); } 100% { color: inherit; } }
@keyframes flash-down { 0% { color: rgb(251 113 133); } 100% { color: inherit; } }
.flash-up { animation: flash-up .5s ease-out; }
.flash-down { animation: flash-down .5s ease-out; }
@keyframes pulse { 50% { opacity: .5; } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 999px; background: currentColor; }

/* ---------- Charts ---------- */
.chart-frame { width: 100%; height: 60vh; min-height: 360px; border: 0; border-radius: 0 0 calc(var(--radius) + 4px) calc(var(--radius) + 4px); background: #020617; }
@media (min-width: 640px) { .chart-frame { height: 520px; } }
.mini-frame { width: 100%; height: 220px; border: 0; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; width: min(360px, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; box-shadow: 0 10px 30px rgb(0 0 0 / .45); font-size: .875rem; animation: toast-in .2s ease-out; display: flex; gap: .6rem; align-items: flex-start; }
.toast .t-title { font-weight: 600; } .toast .t-desc { color: var(--muted-fg); font-size: .8125rem; margin-top: .1rem; }
.toast.success { border-left: 3px solid var(--emerald); } .toast.error { border-left: 3px solid var(--rose); } .toast.warning { border-left: 3px solid var(--amber); } .toast.info { border-left: 3px solid var(--sky); }
.toast .t-actions { display: flex; gap: .4rem; margin-top: .5rem; }
.toast .t-close { margin-left: auto; background: none; border: 0; color: var(--muted-fg); cursor: pointer; padding: 0 .1rem; font-size: 1rem; line-height: 1; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Dialog ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / .6); display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fade .15s; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); width: 100%; max-width: 32rem; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgb(0 0 0 / .5); }
.modal.lg { max-width: 48rem; } .modal.xl { max-width: 64rem; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1rem .5rem; }
.modal-t { font-size: 1.05rem; font-weight: 600; }
.modal-b { padding: .5rem 1rem 1rem; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 640px) { .modal-backdrop { align-items: flex-end; padding: 0; } .modal { max-height: 92vh; border-radius: 1rem 1rem 0 0; } }

/* ---------- Misc ---------- */
.notice { border-radius: var(--radius); padding: .65rem .8rem; font-size: .8125rem; border: 1px solid var(--border); background: rgb(255 255 255 / .03); }
.notice.warn { border-color: rgb(245 158 11 / .35); background: rgb(245 158 11 / .08); color: #fde68a; }
.notice.err { border-color: rgb(244 63 94 / .35); background: rgb(244 63 94 / .08); color: #fecdd3; }
.notice.ok { border-color: rgb(16 185 129 / .35); background: rgb(16 185 129 / .08); color: #a7f3d0; }
.kbd { font-family: var(--mono); font-size: .75rem; background: var(--muted); border-radius: .25rem; padding: .05rem .35rem; }
.code { font-family: var(--mono); font-size: .75rem; background: rgb(0 0 0 / .35); border: 1px solid var(--border); border-radius: .4rem; padding: .5rem .65rem; overflow-x: auto; white-space: pre; display: block; }
.skeleton { background: linear-gradient(90deg, var(--muted) 0%, color-mix(in oklch, var(--muted) 60%, var(--card)) 50%, var(--muted) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: .35rem; min-height: 1rem; }
@keyframes shimmer { to { background-position: -200% 0; } }
.md h1, .md h2, .md h3 { font-weight: 600; margin: .9rem 0 .35rem; } .md h1 { font-size: 1.15rem; } .md h2 { font-size: 1.05rem; } .md h3 { font-size: .95rem; }
.md p { margin: .4rem 0; } .md ul, .md ol { margin: .35rem 0; padding-left: 1.25rem; } .md li { margin: .15rem 0; }
.md code { font-family: var(--mono); font-size: .8em; background: rgb(0 0 0 / .35); border-radius: .25rem; padding: .05rem .3rem; }
.md table { width: 100%; font-size: .8125rem; margin: .5rem 0; } .md th, .md td { border: 1px solid var(--border); padding: .3rem .45rem; text-align: left; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: .75rem 0; }
.md blockquote { margin: .5rem 0; padding-left: .75rem; border-left: 3px solid var(--border); color: var(--muted-fg); }
.scroll-box { max-height: 26rem; overflow-y: auto; }
.list > * + * { border-top: 1px solid var(--border); }
.hero-price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; }
