/* ===== Brand font (served by the site itself: same look on every device) ===== */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/fonts/plus-jakarta-sans-latin.woff2?v=a389d97de580') format('woff2');
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

/* ===== Tokens: one dark theme, "obsidian & iris" (2026-11-27; "graphite & champagne" gold before it, blue at first) =====
   Cool deep-violet charcoal surfaces (never pure black), soft off-white text (no glare) and a calm iris-violet
   accent. Text contrast on the surface: ink 14.8:1, ink-2 9.1:1, muted 5.6:1, accent 7.1:1; dark ink on the accent
   7.4:1. The profit / loss bars stay a cool teal against a warm coral (told apart with any color vision). */
:root {
  color-scheme: dark;
  --page: #0c0d14;
  --surface: #141621;
  --surface-2: #1a1d2a;
  --surface-3: #232637;
  --ink: #e7e8f2;
  --ink-2: #b4b7ca;
  --muted: #8b8ea6;
  --grid: #222536;
  --axis: #34384d;
  --border: rgba(186, 192, 255, 0.08);
  --border-strong: rgba(186, 192, 255, 0.16);
  --accent: #a594ff;
  --accent-hover: #b8aaff;
  --accent-deep: #7d6af0;
  --accent-ink: #120e2b;
  --accent-wash: rgba(165, 148, 255, 0.12);
  --accent-glow: rgba(165, 148, 255, 0.26);
  --meter-track: #2b2650;
  --pos: #23a194;
  --neg: #d15c53;
  --good: #53be70;
  --warning: #f4993c;
  --serious: #ec7f4b;
  --critical: #cb4644;
  --good-text: #75d291;
  --critical-text: #f3827a;
  --warning-text: #faaf5f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --brand-font: 'Plus Jakarta Sans', var(--font);
  --mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;
}

/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--page);
  scrollbar-color: var(--surface-3) transparent;
}
html,
body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  overflow-x: hidden;
  /* a faint iris glow at the top of every page and a teal one on the right: depth, never a distraction */
  background:
    radial-gradient(1100px 540px at 10% -10%, rgba(165, 148, 255, 0.09), transparent 62%),
    radial-gradient(900px 480px at 100% 0%, rgba(35, 161, 148, 0.05), transparent 60%),
    var(--page);
  background-repeat: no-repeat;
}
::selection {
  background: rgba(165, 148, 255, 0.32);
  color: var(--ink);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 28px;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 15px;
}
p {
  margin: 0;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.muted {
  color: var(--muted);
}
.ink2 {
  color: var(--ink-2);
}
.small {
  font-size: 13px;
}
.tiny {
  font-size: 12px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.hidden {
  display: none !important;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack.lg {
  gap: 20px;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.sep {
  height: 1px;
  background: var(--grid);
  margin: 4px 0;
}

/* ===== Layout ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
/* an iris hairline under the top bar, fading out at both ends */
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165, 148, 255, 0.5) 28%, rgba(165, 148, 255, 0.5) 72%, transparent);
  pointer-events: none;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
/* logo: vector mark (assets/logo.svg) + name in the brand font + role tag */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: block;
  flex: none;
}
.brand-name {
  font-family: var(--brand-font);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1;
}
.brand-role {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--accent);
  background: var(--accent-wash);
  border-radius: 6px;
  padding: 4px 6px 3px;
}
.topbar .spacer {
  flex: 1;
}
.account-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  min-width: 0;
}
.account-chip b {
  font-size: 14px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip span {
  font-size: 12px;
  color: var(--muted);
}
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(200, 205, 255, 0.05), var(--shadow); /* a lit top edge */
  padding: 18px;
  min-width: 0;
}
.card.flat {
  box-shadow: inset 0 1px 0 rgba(200, 205, 255, 0.05);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2,
.card-head h3 {
  margin-bottom: 2px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 14px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ===== Status (always icon + label) ===== */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status.good::before {
  background: var(--good);
}
.status.warning::before {
  background: var(--warning);
}
.status.serious::before {
  background: var(--serious);
}
.status.critical::before {
  background: var(--critical);
}
.status.good {
  color: var(--good-text);
}
.status.critical {
  color: var(--critical-text);
}
.status.warning {
  color: var(--warning-text);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.accent {
  background: var(--accent-wash);
  color: var(--accent);
  border-color: transparent;
}
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
}
.banner .icon {
  font-size: 18px;
  line-height: 1.2;
}
.banner.critical {
  border-color: color-mix(in srgb, var(--critical) 45%, transparent);
  background: color-mix(in srgb, var(--critical) 8%, var(--surface));
}
.banner.warning {
  border-color: color-mix(in srgb, var(--warning) 55%, transparent);
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
}
.banner.info {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-wash);
}

/* ===== Buttons & inputs ===== */
button,
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
  text-decoration: none;
}
button:hover,
.btn:hover {
  background: var(--surface-2);
  text-decoration: none;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button.primary,
.btn.primary {
  background: linear-gradient(180deg, var(--accent-hover), var(--accent) 55%, var(--accent-deep));
  border-color: var(--accent-deep);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(0, 0, 0, 0.4);
}
button.primary:hover,
.btn.primary:hover {
  background: linear-gradient(180deg, #cdc4ff, var(--accent-hover) 55%, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 16px var(--accent-glow);
}
button.danger {
  color: var(--critical-text);
  border-color: color-mix(in srgb, var(--critical) 40%, transparent);
}
button.danger:hover {
  background: color-mix(in srgb, var(--critical) 9%, var(--surface));
}
button.ghost {
  border-color: transparent;
  background: transparent;
}
button.ghost:hover {
  background: var(--surface-2);
}
button.sm,
.btn.sm {
  padding: 5px 10px;
  font-size: 13px;
}
button.lg,
.btn.lg {
  padding: 11px 18px;
  font-size: 15px;
}
button.block {
  width: 100%;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
label.field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
input,
select,
textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  width: 100%;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}
input[type='number'] {
  font-variant-numeric: tabular-nums;
}
.inline-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

/* switch */
.switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 0.15s;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f3efe7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .track {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input:checked + .track::after {
  transform: translateX(18px);
  background: var(--accent-ink); /* a dark knob on the violet track (a light one would hardly show) */
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 0;
}
.toggle-row .text b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.toggle-row .text .hint {
  margin-top: 1px;
}
/* login: the first question of every visit (already registered / new user) */
.choice {
  display: grid;
  gap: 12px;
}
button.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  height: auto;
  text-align: left;
  white-space: normal;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}
button.choice-btn:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}
button.choice-btn b {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
}
button.choice-btn span {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
}
/* Telegram API ID (a few digits) beside the API hash (32 characters) */
.api-inputs {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 12px;
}

/* no-trading windows: what happens to open trades and pending orders */
.window-opt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.window-opt > span:first-child {
  min-width: 130px;
}

/* admin: a keyword category with its on/off switch right after its name */
div.field.kw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.kw-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kw-head > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.kw-field.off input {
  opacity: 0.5;
}

/* a switch placed right after its text */
.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.toggle-inline b {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* segmented control */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
  max-width: 100%;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 7px;
  color: var(--ink-2);
}
.seg button:hover {
  background: var(--surface-3);
}
.seg button.on {
  background: var(--surface-3); /* raised above the track, never darker than it */
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent), 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* tabs */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover {
  color: var(--ink);
  background: transparent;
}
.tabs button.on {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.subtabs button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border-color: transparent;
  color: var(--ink-2);
}
.subtabs button.on {
  background: var(--accent-wash);
  color: var(--accent);
}

/* tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--grid);
  vertical-align: middle;
}
th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
td.r,
th.r {
  text-align: right;
}
td.num,
.table-num td {
  font-variant-numeric: tabular-nums;
}

/* list items */
.list {
  display: flex;
  flex-direction: column;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--grid);
  min-width: 0;
}
.list-item:last-child {
  border-bottom: 0;
}

/* channel list */
.channels {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .channels {
    grid-template-columns: 1fr;
  }
}
.channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  min-width: 0;
}
.channel-item:hover {
  background: var(--surface-2);
}
.channel-item.on {
  background: var(--accent-wash);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.channel-item .title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}

/* stat tiles */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 0;
}
.tile .label {
  font-size: 13px;
  color: var(--muted);
}
.tile .value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.tile .sub {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
}
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--meter-track);
  margin-top: 10px;
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.hero {
  font-size: 48px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* chart */
.chart {
  position: relative;
  width: 100%;
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  min-width: 150px;
  z-index: 5;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}
.chart .tip b {
  display: block;
  margin-bottom: 2px;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-2);
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

/* activity feed */
.feed {
  display: flex;
  flex-direction: column;
}
.feed-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--grid);
  align-items: start;
}
.feed-item:last-child {
  border-bottom: 0;
}
.feed-item .time {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.feed-item .what {
  font-size: 14px;
  min-width: 0;
}
.feed-item .what .msg {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 9px;
  max-height: 120px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.feed-item .right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
@media (max-width: 640px) {
  .feed-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .feed-item .right {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* modal */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: min(560px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
}
.modal-head {
  padding: 16px 18px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-body {
  padding: 4px 18px 14px;
  overflow: auto;
}
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* toast */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--ink);
  color: var(--page);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow);
  max-width: 420px;
}
.toast.error {
  background: var(--critical);
  color: #fff;
}

/* tags input */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.tags .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 4px 2px 8px;
  font-size: 13px;
  font-weight: 600;
}
.tags .tag button {
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.tags input {
  flex: 1 1 120px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  box-shadow: none;
}

/* sticky save bar */
.savebar {
  position: sticky;
  bottom: 0;
  margin: 18px -18px -18px;
  padding: 12px 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* auth & landing */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card {
  width: min(560px, 100%);
}
.landing-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 16px 24px;
  text-align: center;
}
.landing-hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.03em;
}
.landing-hero p {
  color: var(--ink-2);
  font-size: 17px;
  max-width: 640px;
  margin: 14px auto 0;
}
.role-cards {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 760px) {
  .role-cards {
    grid-template-columns: 1fr;
  }
}
.role-card ul {
  margin: 12px 0 18px;
  padding-left: 18px;
  color: var(--ink-2);
}
.role-card li {
  margin: 4px 0;
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.step .ico {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--ink-2);
}
.step.ok .ico {
  background: var(--good);
  color: #0c1a10;
}
.step.err .ico {
  background: var(--critical);
  color: #fff;
}
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
  font-size: 14px;
}
.preview {
  white-space: pre-wrap;
  font-size: 13px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.level-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.window-row {
  display: grid;
  grid-template-columns: 110px 110px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
@media (max-width: 640px) {
  .window-row {
    grid-template-columns: 1fr 1fr;
  }
}
.days {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.days button {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}
.days button.on {
  background: var(--accent-wash);
  color: var(--accent);
  border-color: transparent;
}
.map-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
@media (max-width: 560px) {
  .topbar .account-chip {
    display: none;
  }
}

/* the main page: a single card, centred */
.role-cards.single {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

/* channel editor: sections listed on the left of the settings (right of the channels list) */
.editor-body {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.section-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 72px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}
.section-nav .group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 10px 4px;
}
.section-nav .group:first-child {
  padding-top: 0;
}
.section-nav button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 8px 10px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  text-align: left;
  white-space: normal;
}
.section-nav button:hover {
  background: var(--surface-2);
}
.section-nav button.on {
  background: var(--accent-wash);
  color: var(--accent);
}
.section-nav button .dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
@media (max-width: 1100px) {
  .editor-body {
    grid-template-columns: 1fr;
  }
  .section-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 10px;
  }
  .section-nav .group {
    display: none;
  }
}

/* settings saved and locked: shown greyed until Edit */
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
fieldset.locked input,
fieldset.locked select,
fieldset.locked textarea,
input.masked,
input:disabled,
textarea:disabled,
select:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
}
fieldset.locked .switch,
fieldset.locked .seg,
fieldset.locked .days,
fieldset.locked .tags,
fieldset.locked button,
.switch input:disabled + .track {
  opacity: 0.5;
}
fieldset.locked .switch input,
.switch input:disabled {
  cursor: not-allowed;
}
input.masked {
  letter-spacing: 0.2em;
}
.lock-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* the execution mode in use, next to the Entry title: saved as soon as it is picked */
select.mode-select {
  width: auto;
  padding: 6px 10px;
  font-weight: 600;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  cursor: pointer;
}
select.mode-select option {
  background: var(--surface);
  color: var(--ink);
}
select.mode-select:disabled {
  border-color: var(--border-strong);
  background: var(--surface-3);
  cursor: not-allowed;
}

/* a typed value with a list next to it */
.combo {
  display: flex;
  min-width: 0;
}
.combo input {
  flex: 1 1 auto;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.combo select {
  flex: none;
  width: 104px; /* the label only: the open list is as wide as its symbols */
  max-width: 45%;
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 9px 6px 9px 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 560px) {
  /* phones: the list under the typed value */
  .combo {
    flex-direction: column;
  }
  .combo input {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
  .combo select {
    width: 100%;
    max-width: none;
    border-left: 1px solid var(--border-strong);
    border-top: 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 6px 8px;
  }
}

/* Market Watch symbol picker */
.sym-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.sym-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
}
.sym-item .mono {
  overflow-wrap: anywhere;
}

/* full paths, never cut: C:\...\terminal64.exe */
.path {
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
  word-break: break-all;
}
textarea.path-input {
  min-height: 0;
  height: auto;
  resize: none;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}

/* terms of use dialog (login) */
.terms {
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 4px 14px 4px 2px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.terms section {
  padding: 10px 0;
}
.terms h3 {
  font-size: 14px;
}
.terms p {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.terms-agree {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.terms-agree input {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

/* risk disclaimer under the login pages */
.disclaimer {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.disclaimer b {
  color: var(--ink-2);
}

.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
td.nowrap,
.nowrap {
  white-space: nowrap;
}

/* the Android app download, next to the login button (never shown inside the app itself) */
.app-download {
  margin-left: 14px;
  font-weight: 600;
}
.app-download::before {
  content: '';
  display: inline-block;
  width: 0.62em;
  height: 1em;
  margin-right: 6px;
  vertical-align: -0.12em;
  border: 2px solid currentColor;
  border-radius: 3px;
}
.in-app .app-download {
  display: none;
}
/* inside the apps, pressing and holding a link opens no preview: the iPhone's preview shows the link's address */
.in-app a,
.in-app img {
  -webkit-touch-callout: none;
}

/* /app/<id>: how to install the phone app (iPhone: a profile or Add to Home Screen; Android: the app file) */
.app-install {
  max-width: 560px;
  margin: 0 auto;
}
.app-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-top: 12px;
}
.app-head img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
}
.app-head h1 {
  margin: 0;
}
.app-install ol {
  margin: 4px 0;
  padding-left: 20px;
}
.app-install ol li {
  margin: 4px 0;
}
.app-install .btn {
  align-self: flex-start;
}

/* the apps' passcode (app.js pinScreen): over the whole page until unlocked */
.pin-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--page);
}
.pin-box {
  width: 100%;
  max-width: 340px;
  align-items: center;
  text-align: center;
}
.pin-box .brand-mark {
  width: 44px;
  height: 44px;
}
.pin-input {
  width: 100%;
  font-size: 28px;
  letter-spacing: 0.45em;
  text-align: center;
}
.pin-error {
  min-height: 1.3em;
  color: var(--critical-text);
  font-size: 14px;
}

/* ===== Finish (2026-11-27): the look only, never the layout =====
   The user: "change the overall ui cosmetics (not the placements)". Softer depth on cards, a calm lift and press on
   actions, a gentle focus glow, pill badges, quieter tables, a glassier top bar and thin dark scrollbars. No size, gap
   or position below differs from the rules above (a transform or a shadow never moves anything around it). */
.topbar {
  background: color-mix(in srgb, var(--page) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.35);
}
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 86%, #2a2d48), var(--surface) 160px);
  box-shadow: inset 0 1px 0 rgba(200, 205, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -14px rgba(0, 0, 0, 0.6);
}
.card.flat {
  background: var(--surface);
}
button,
.btn {
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s, opacity 0.15s;
}
button:hover,
.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border-strong));
}
button:active:not(:disabled),
.btn:active {
  transform: translateY(1px);
}
button.primary:hover,
.btn.primary:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 22px var(--accent-glow);
}
button.ghost:hover {
  border-color: transparent;
}
input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border-strong));
}
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px var(--accent-wash), 0 0 20px -6px var(--accent-glow);
}
input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}
:focus-visible {
  outline-color: color-mix(in srgb, var(--accent) 85%, transparent);
}
.badge {
  border-radius: 999px;
}
.seg button.on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 15%, var(--surface-3)), var(--surface-3));
}
.tabs button.on {
  text-shadow: 0 0 18px var(--accent-glow);
}
th {
  letter-spacing: 0.02em;
}
tbody tr {
  transition: background 0.12s;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
a {
  text-underline-offset: 3px;
  transition: color 0.15s;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 2px solid var(--page);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-3));
}

/* ===== MT5 accounts: the switcher above the dashboard ===== */
.acct-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.acct-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.acct-pill:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.acct-pill.on {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.acct-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.acct-dot.good {
  background: var(--good);
}
.acct-dot.warning {
  background: var(--warning);
}
.acct-dot.critical {
  background: var(--critical);
}
/* a ticked choice among a few (the MT5 accounts a chat is copied to) */
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
}
.check-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
}
/* numbered how-to steps */
.howto {
  margin: 0;
  padding-left: 20px;
}
.howto li {
  margin: 4px 0;
}
