/* NODO Constellation — terminal UI (admin + subscriber). Sprint 01. */

:root {
  --space: #080c14;
  --space-2: #0b111b;
  --panel: #0e1724;
  --panel-2: #121d2c;
  --white: #f6f9fc;
  --muted: #96a5b8;
  --muted-2: #6f8197;
  --line: #20303f;
  --line-2: #2c4053;
  --cyan: #43dfff;      /* demand */
  --amber: #f5a524;     /* supply */
  --danger: #ff6b6b;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --radius: 6px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--space); color: var(--white);
  font-family: var(--display); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
::selection { background: var(--cyan); color: var(--space); }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.c-supply { color: var(--amber); }
.c-demand { color: var(--cyan); }

/* ---------- layout ---------- */
.term { display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }

.term__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--space-2);
}
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: 6px; color: inherit; text-decoration: none; }
.brand__name { font-weight: 700; letter-spacing: .14em; font-size: 14px; }
.brand__sub { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.term__spacer { flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 100px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.badge--sim { color: var(--amber); border-color: rgba(245, 165, 36, .45); }
.badge--admin { color: var(--cyan); border-color: rgba(67, 223, 255, .45); }
.badge--subscriber { color: var(--white); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--live .badge__dot { box-shadow: 0 0 8px currentColor; }
.badge--off { color: var(--muted-2); }

.select, .input {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px;
  padding: 6px 9px; font-family: var(--mono); font-size: 12px;
}
.input { width: 100%; }

.term__main {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 380px; min-height: 0;
}

/* ---------- left: node list ---------- */
.side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.tabs { display: flex; gap: 2px; }
.tab {
  background: none; border: 1px solid transparent; border-radius: 3px; padding: 3px 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.tab.is-active { color: var(--white); border-color: var(--line-2); background: var(--panel); }
.side__list { overflow-y: auto; flex: 1; }

.node-item {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px;
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 14px; transition: background .15s var(--ease);
}
.node-item:hover { background: var(--panel); }
.node-item.is-selected { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--cyan); }
.node-item__dot { width: 9px; height: 9px; border-radius: 50%; }
.node-item--supply .node-item__dot { background: var(--amber); box-shadow: 0 0 8px rgba(245, 165, 36, .6); }
.node-item--demand .node-item__dot { background: var(--cyan); box-shadow: 0 0 8px rgba(67, 223, 255, .6); }
.node-item__time { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.node-item__meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.node-item__chips { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }

/* Members' rows: market and time left, side and price right, status under. */
.node-row { grid-template-columns: 10px 1fr auto; row-gap: 6px; align-items: center; }
.node-row .node-item__dot { align-self: start; margin-top: 7px; }
.node-row__main, .node-row__side { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.node-row__side { align-items: flex-end; text-align: right; }
.node-row__mkt { display: flex; align-items: center; gap: 7px; font: 650 16px/1.1 var(--display); letter-spacing: .01em; color: var(--white); }
.node-row__tf { font: 500 10.5px/1 var(--mono); color: var(--muted); padding: 2px 5px; border: 1px solid var(--line-2); border-radius: 4px; }
.node-row__time { font: 400 12px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.node-row__word { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.node-item--demand .node-row__word { color: var(--cyan); }
.node-item--supply .node-row__word { color: var(--amber); }
.node-row__price { font: 500 14px/1.1 var(--mono); color: var(--white); white-space: nowrap; }
.node-row__tags { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.chip--new { color: var(--space); background: var(--cyan); border-color: var(--cyan); }
.chip--draft { color: var(--amber); border-color: rgba(245, 165, 36, .45); }
.chip--pub { color: var(--cyan); border-color: rgba(67, 223, 255, .45); }

.feed-item { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.feed-item__at { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.feed-item button { background: none; border: 0; color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- center: chart ---------- */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.toolbar__sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tool {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px;
  padding: 5px 10px; font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tool:hover { color: var(--white); border-color: var(--muted-2); }
.tool.is-active { color: var(--space); background: var(--cyan); border-color: var(--cyan); }
.tool:disabled { opacity: .4; cursor: not-allowed; }
.toolbar .input { width: 190px; }

/* drawing tools (admin) */
/* Fibonacci settings dialog */
.fibdlg {
  position: fixed; inset: 0; margin: auto; height: fit-content;
  width: min(400px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0;
  background: #161b24; color: var(--white); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.fibdlg[open] { display: flex; flex-direction: column; }
.fibdlg::backdrop { background: rgba(4, 7, 12, .35); }
.fib__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.fib__head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.fib__x { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.fib__x:hover { color: var(--white); }
.fib__body { overflow-y: auto; padding: 12px 18px; display: grid; gap: 10px; font-size: 13px; }
.fib__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.fib__label { color: var(--muted); }
.fib__controls { display: flex; align-items: center; gap: 6px; }
.fib__check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.fib__check input, .fib__level input[type="checkbox"] { accent-color: var(--cyan); width: 15px; height: 15px; }
.fib__select {
  background: var(--space); color: var(--white); border: 1px solid var(--line-2); border-radius: 5px;
  padding: 5px 8px; font: inherit; font-size: 12.5px;
}
.fib__color {
  width: 30px; height: 26px; padding: 2px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--space); cursor: pointer;
}
.fib__color::-webkit-color-swatch-wrapper { padding: 0; }
.fib__color::-webkit-color-swatch { border: 0; border-radius: 3px; }
.fib__levels { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 6px 0; border-block: 1px solid var(--line); }
.fib__level { display: flex; align-items: center; gap: 6px; }
.fib__num {
  width: 100%; min-width: 0; background: var(--space); color: var(--white); border: 1px solid var(--line-2); border-radius: 5px;
  padding: 5px 7px; font-family: var(--mono); font-size: 12px;
}
.fib__level:has(input[type="checkbox"]:not(:checked)) .fib__num { color: var(--muted-2, #5b6878); }
.fib__range { width: 150px; accent-color: var(--cyan); }
.fib__foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.fib__spacer { flex: 1; }
.toolbar__draw { display: flex; flex-wrap: wrap; gap: 2px; }
.tfseg { display: inline-flex; gap: 2px; }
.tfseg .tool { min-width: 38px; padding-inline: 8px; }
.tool--icon { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; }
.tool--icon svg { display: block; }
.chart-wrap.is-over-drawing, .chart-wrap.is-over-drawing * { cursor: move !important; }
.chart-wrap.is-drawing * { cursor: crosshair !important; }
.drawbar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.drawbar__name { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.drawbar__swatch {
  width: 18px; height: 18px; border-radius: 50%; padding: 0;
  background: var(--sw); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line-2);
}
.drawbar__swatch.is-active { box-shadow: 0 0 0 2px var(--white); }
.drawbar__btn {
  background: none; border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.drawbar__btn:hover { color: var(--white); border-color: var(--muted-2); }
.drawbar__btn--del:hover { color: #FF5D6C; border-color: rgba(255, 93, 108, .5); }
.drawtext {
  position: absolute; z-index: 5; min-width: 180px; padding: 4px 6px;
  background: var(--space); color: var(--white); border: 1px solid var(--cyan); border-radius: 3px;
  font: 13px "JetBrains Mono", ui-monospace, monospace; outline: none;
}

.chart-wrap { position: relative; flex: 1; min-height: 320px; }
.chart { position: absolute; inset: 0; }
.chart-wrap.is-drawing { cursor: crosshair; }
.chart-watermark {
  position: absolute; left: 14px; top: 12px; z-index: 3; pointer-events: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.chart-watermark strong { color: var(--amber); font-weight: 500; }

.hint {
  padding: 7px 12px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted); min-height: 30px;
}
.hint.is-active { color: var(--cyan); }

/* bar under the chart: hint + clock / time zone (like TradingView) */
.chartbar { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.chartbar .hint { flex: 1; min-width: 0; border-top: 0; }
.chartbar__toggle {
  display: flex; align-items: center; gap: 7px; padding: 0 12px; border-left: 1px solid var(--line);
  font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; cursor: pointer;
}
.chartbar__toggle input { accent-color: var(--cyan); margin: 0; }
body[data-role="admin"] .chartbar__toggle { font: 12.5px "IBM Plex Sans", -apple-system, system-ui, sans-serif; }
.tz { position: relative; display: flex; align-items: stretch; border-left: 1px solid var(--line); }
.tz__btn {
  background: none; border: 0; padding: 0 12px; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.tz__btn:hover, .tz__btn[aria-expanded="true"] { color: var(--white); background: rgba(255, 255, 255, .04); }
.tz__menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30;
  width: 270px; max-height: min(70vh, 640px); overflow-y: auto; padding: 4px 0;
  background: #161b24; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.tz__opt {
  position: relative; display: block; width: 100%; text-align: left;
  background: none; border: 0; padding: 7px 14px 7px 34px; font-size: 13px; color: var(--white);
}
.tz__opt:hover { background: rgba(255, 255, 255, .06); }
.tz__opt.is-on::before { content: '✓'; position: absolute; left: 13px; color: var(--cyan); }

/* ---------- right: panel ---------- */
.panel { border-left: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.panel__empty { padding: 28px 22px; color: var(--muted); }
.panel__empty h2 { color: var(--white); font-size: 1.05rem; margin-bottom: 8px; }
.section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section__title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.node-id { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.node-side { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin-top: 12px; font-size: 12.5px; }
.kv dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--muted); padding-top: 2px; }
.kv dd { font-family: var(--mono); }

.ai-box {
  border: 1px dashed rgba(245, 165, 36, .45); border-radius: var(--radius);
  background: rgba(245, 165, 36, .04); padding: 12px; font-size: 13px; color: var(--white);
}
.ai-box__label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }

.textarea {
  width: 100%; min-height: 140px; resize: vertical;
  background: var(--space-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 10px 11px;
  font-size: 13.5px; line-height: 1.55;
}
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.check input { accent-color: var(--cyan); }

.drawing-list { display: grid; gap: 6px; }
.drawing-row {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; background: var(--space-2);
}
.drawing-row__type { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.drawing-row__type:hover, .drawing-row.is-selected .drawing-row__type { color: var(--cyan); }
.drawing-row__val { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.drawing-row .input { padding: 4px 7px; font-size: 11.5px; margin-top: 3px; }
.icon-btn { background: none; border: 1px solid var(--line-2); border-radius: 3px; padding: 3px 7px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 14px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel);
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em;
  transition: background .15s var(--ease), border-color .15s var(--ease), opacity .15s;
}
.btn:hover { border-color: var(--muted-2); }
.btn--primary { background: var(--cyan); border-color: var(--cyan); color: var(--space); font-weight: 600; }
.btn--primary:hover { background: #8eecff; border-color: #8eecff; }
.btn--sim { color: var(--amber); border-color: rgba(245, 165, 36, .5); background: transparent; }
.btn--sim:hover { background: rgba(245, 165, 36, .08); border-color: var(--amber); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.status { margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.status--dirty { color: var(--amber); }
.status--ok { color: var(--cyan); }

.pub { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--space-2); }
.pub__head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 8px; }
.pub__text { white-space: pre-wrap; font-size: 13.5px; }
.pub .ai-box { margin-top: 10px; }
.pub__drawings { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.history { display: grid; gap: 4px; }
.history button {
  display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  background: none; border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.history button.is-active, .history button:hover { color: var(--white); border-color: var(--line-2); background: var(--panel); }
.readonly-note { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); margin-top: 10px; }
.toggle-line { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.toggle-line input { accent-color: var(--cyan); }

/* ---------- footer + toasts ---------- */
.term__foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 7px 16px; border-top: 1px solid var(--line); background: var(--space-2);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted-2);
}
.term__foot a { color: var(--muted); }

.toasts { position: fixed; right: 16px; bottom: 44px; z-index: 50; display: grid; gap: 8px; max-width: 360px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--cyan); border-radius: 4px;
  padding: 10px 12px; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  animation: toast-in .25s var(--ease);
}
.toast--supply { border-left-color: var(--amber); }
.toast__title { color: var(--white); font-weight: 600; margin-bottom: 3px; }
.toast button { margin-top: 6px; background: none; border: 0; color: var(--cyan); font-family: var(--mono); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toast-drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- launcher ---------- */
.launch { max-width: 760px; margin: 0 auto; padding: 64px 24px; }
.launch h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.1; margin: 16px 0 14px; }
.launch p { color: var(--muted); max-width: 60ch; }
.launch__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 30px 0; }
.launch__card {
  display: block; border: 1px solid var(--line-2); border-radius: 8px; padding: 18px; background: var(--panel);
  text-decoration: none; color: var(--white); transition: border-color .2s var(--ease);
}
.launch__card:hover { border-color: var(--cyan); }
.launch__card h2 { font-size: 1.1rem; margin: 10px 0 6px; }
.launch__card p { font-size: 13px; }
.launch ol { margin: 10px 0 0 18px; color: var(--muted); display: grid; gap: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .term__main { grid-template-columns: 220px minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .term { height: auto; min-height: 100dvh; }
  .term__main { display: flex; flex-direction: column; }
  .stage { order: 1; }
  .panel { order: 2; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .side { order: 3; border-right: 0; border-top: 1px solid var(--line); max-height: 420px; }
  .chart-wrap { flex: none; height: 58vh; min-height: 300px; }
  .toolbar .input { width: 100%; order: 10; }
  .launch__cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- accounts: sign-in, set password, user management ---------- */
a.btn { color: inherit; text-decoration: none; }
.btn--ghost { background: transparent; padding: 6px 10px; text-decoration: none; color: var(--muted); }
.btn--ghost:hover { color: var(--white); }
.account { display: flex; align-items: center; gap: 8px; }
.account__who { font-family: var(--mono); font-size: 11px; color: var(--muted); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.auth__card {
  width: min(400px, 100%); border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel);
  padding: 28px 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.auth__brand { display: flex; align-items: baseline; gap: 8px; margin-bottom: 22px; }
.auth h1 { font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 6px; }
.auth__lead { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.auth__foot { margin-top: 18px; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); line-height: 1.6; }
.auth__foot a { color: var(--muted); }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field .input, .field .select { padding: 10px 11px; font-size: 13px; width: 100%; }
.field__hint { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.form .btn { width: 100%; padding: 11px 14px; }
.form-msg { font-family: var(--mono); font-size: 11.5px; padding: 9px 11px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }
.form-msg--error { color: var(--danger); border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .06); }
.form-msg--ok { color: var(--cyan); border-color: rgba(67, 223, 255, .4); background: rgba(67, 223, 255, .05); }

.admin-page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; display: grid; gap: 22px; }
.admin-page h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.admin-page h2 { font-size: 1rem; margin-bottom: 12px; }
.card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 18px; }
.form--inline { grid-template-columns: 2fr 1.4fr 1fr 1fr auto; align-items: end; }
.form--inline .btn { width: auto; }
.link-box { display: grid; gap: 8px; margin-top: 14px; }
.link-box .input { width: 100%; font-size: 11.5px; }
.link-box__row { display: flex; gap: 8px; }
.link-box__row .input { flex: 1; }

.users { width: 100%; border-collapse: collapse; font-size: 13px; }
.users th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; padding: 0 10px 8px; }
.users td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.users td.mono, .users .muted { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.users .select { padding: 4px 6px; font-size: 11px; }
.users .row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.users .row-actions .btn { padding: 5px 9px; font-size: 11px; }
.users tr.is-disabled td { opacity: .5; }
.pill { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 100px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill--ok { color: var(--cyan); border-color: rgba(67, 223, 255, .45); }
.pill--trial { color: var(--amber); border-color: rgba(245, 165, 36, .45); }
.pill--off { color: var(--muted-2); }
.table-wrap { overflow-x: auto; }

@media (max-width: 900px) {
  .form--inline { grid-template-columns: 1fr 1fr; }
  .form--inline .btn { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 520px) {
  .form--inline { grid-template-columns: 1fr; }
  .account__who { display: none; }
}

/* ---------- request access ---------- */
.auth__brand--row { justify-content: space-between; align-items: center; }
.lang-switch { display: inline-flex; gap: 2px; border: 1px solid var(--line-2); border-radius: 4px; padding: 2px; }
.lang-switch button { background: none; border: 0; border-radius: 3px; padding: 4px 9px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--panel-2); color: var(--white); }
textarea.input { resize: vertical; min-height: 72px; font-family: var(--display); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- requests (admin) ---------- */
.requests { display: grid; gap: 10px; }
.request {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: var(--space-2);
}
.request__who { font-size: 14px; }
.request__meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.request__note { margin-top: 6px; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.request__actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.request__actions .input { width: 64px; padding: 6px 7px; }
.request__actions .btn { padding: 7px 10px; font-size: 11px; }
.request--done { opacity: .55; }
.mail-status { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: -4px 0 12px; }
.mail-status b { color: var(--cyan); font-weight: 500; }
.check-line { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); grid-column: 1 / -1; }
.check-line input { accent-color: var(--cyan); }
@media (max-width: 640px) {
  .request { grid-template-columns: 1fr; }
  .request__actions { justify-content: flex-start; }
}

/* ---------- live data ---------- */
.badge--source-live { color: #3ddc97; border-color: rgba(61, 220, 151, .45); }
.badge--source-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chart-watermark strong.is-live { color: #3ddc97; }
.side-note { padding: 14px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.side-note b { color: var(--white); font-weight: 500; }

/* ---------- market bar: drop-downs with search ---------- */
.markets { display: flex; gap: 6px; align-items: center; flex: none; order: 1; }
.term__head > .brand { order: 0; }
.term__head > :not(.brand):not(.markets) { order: 2; }
.mkt { position: relative; }
.mkt__btn {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 5px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap;
}
.mkt__btn:hover, .mkt__btn[aria-expanded="true"] { color: var(--white); border-color: var(--muted-2); }
.mkt__btn.is-active { border-color: rgba(67, 223, 255, .55); color: var(--white); }
.mkt__label { letter-spacing: .1em; text-transform: uppercase; font-size: 10px; }
.mkt__current { color: var(--cyan); font-weight: 600; }
.mkt__caret { font-size: 10px; opacity: .7; }
.mkt__panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: 300px;
  background: #161b24; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  padding: 8px;
}
.mkt__search {
  width: 100%; padding: 7px 10px; margin-bottom: 6px; background: var(--space); color: var(--white);
  border: 1px solid var(--line-2); border-radius: 5px; font: inherit; font-size: 13px; outline: none;
}
.mkt__search:focus { border-color: var(--cyan); }
.mkt__list { display: grid; max-height: 340px; overflow-y: auto; }
.mkt__opt {
  display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 8px; text-align: left;
  padding: 7px 8px; background: none; border: 0; border-radius: 5px; color: var(--white); font-size: 13px;
}
.mkt__opt:hover, .mkt__opt.is-first { background: rgba(255, 255, 255, .06); }
.mkt__opt.is-on .mkt__ticker { color: var(--cyan); }
.mkt__ticker { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.mkt__name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt__group { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.mkt__empty { margin: 6px 8px; color: var(--muted); font-size: 12.5px; }

/* ---------- dispatch, Telegram, trial ---------- */
.badge--trial { color: #3ddc97; border-color: rgba(61, 220, 151, .45); }
.chip--cand { color: var(--muted); border-style: dashed; }
.tg { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line, #20303f); }
.tg__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.tg__text b { color: var(--white); font-weight: 500; font-size: 13px; }
.tg__prefs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.tg__pref { display: inline-flex; align-items: center; gap: 6px; color: var(--white); cursor: pointer; }
.tg__pref input { accent-color: var(--cyan, #43dfff); }
.tg .btn { flex: none; }
.tg--card { border: 1px solid var(--line, #20303f); border-radius: 8px; margin-bottom: 12px; }
.side-pick { display: flex; gap: 8px; margin: 4px 0 10px; }
.side-pick .btn { flex: 1; }
.side-pick .btn.is-active.c-demand { border-color: var(--cyan); color: var(--cyan); }
.side-pick .btn.is-active.c-supply { border-color: var(--amber); color: var(--amber); }
.tool--node { color: var(--cyan); }

/* ---------- community chat ---------- */
.side__chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side__chat[hidden] { display: none; }
.side__chat .chat { flex: 1; min-height: 0; }
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat__log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
}
.section .chat__log { max-height: 380px; min-height: 120px; padding: 4px 0 8px; }
.chat__empty { color: var(--muted); font-size: 13px; padding: 8px 0; margin: auto 0; }
.chat__msg { padding: 7px 9px; border-radius: var(--radius); }
.chat__msg:hover { background: var(--panel); }
.chat__msg.is-mine { background: rgba(67, 223, 255, .05); }
.chat__msg.is-team { box-shadow: inset 2px 0 0 var(--cyan); }
.chat__meta { display: flex; align-items: baseline; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.chat__author { color: var(--white); font-weight: 500; }
.chat__badge {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan);
  border: 1px solid rgba(67, 223, 255, .4); border-radius: 3px; padding: 0 4px;
}
.chat__meta time { margin-left: auto; color: var(--muted-2); }
.chat__body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.5; margin-top: 2px; }
.chat__tools { display: flex; gap: 6px; margin-top: 4px; }
.chat__tool {
  background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2);
  text-decoration: underline; text-underline-offset: 2px;
}
.chat__tool:hover { color: var(--danger); }
.chat__older {
  align-self: center; margin: 4px 0 8px; background: none; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 4px 12px; font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}
.chat__older:hover { color: var(--white); }
.chat__gate {
  position: relative; margin: 0 0 10px; padding: 16px 14px; text-align: center;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.chat__gate::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 48px; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 12, 20, .65), transparent);
}
.chat__gate h3 { font-family: var(--display); font-size: 1rem; color: var(--white); margin-bottom: 6px; }
.chat__gate p { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.chat__foot { border-top: 1px solid var(--line); padding: 10px 12px; }
.section .chat__foot { padding: 10px 0 0; }
.chat__form { display: flex; gap: 8px; align-items: flex-end; }
.chat__input {
  flex: 1; min-width: 0; resize: none; max-height: 140px;
  background: var(--space-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 8px 10px;
  font-size: 16px; line-height: 1.4; /* 16px: no zoom-on-focus on iPhone */
}
.chat__input:focus { outline: none; border-color: var(--cyan); }
.chat__send { padding: 8px 12px; }
.chat__fine { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); margin-top: 8px; line-height: 1.5; }
.chat__join { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.chat__join .chat__fine { margin: 0; }
@media (max-width: 900px) {
  .side:has(.side__chat:not([hidden])) { max-height: 560px; min-height: 460px; }
}

/* ======================================================================
   Phone app layout (subscriber portal, ≤ 760 px)
   A slim header, the market quote over the chart, the NODO in view as a
   card, and a bottom tab bar where each tab is a full screen. System type
   with tabular figures instead of the desktop terminal faces.
   ====================================================================== */
.room-head, .avatar, .quote, .to-now, .chart-full, .nodecard, .tabbar, .list-head, .panel__bar, .node-hero, .switch { display: none; }
.brand__word { display: none; }

@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  body[data-role="subscriber"] {
    --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
    --display: var(--sys);
    --mono: var(--sys);
    --raise: #0f1621;
    --raise-2: #151e2b;
    --hair: rgba(150, 172, 196, .13);
    --text: #edf1f5;
    --quiet: #8b97a7;
    --up: #4fd69c;
    --down: #ff7b6b;
    --tabbar-h: 58px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    overscroll-behavior: none;
  }
  body[data-role="subscriber"] .term {
    height: 100vh; height: 100dvh; min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }
  body[data-role="subscriber"] .term__foot { display: none; }

  /* header: NODO in the middle, account on the right */
  body[data-role="subscriber"] .term__head {
    display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 0;
    padding: env(safe-area-inset-top, 0px) 12px 0; height: calc(50px + env(safe-area-inset-top, 0px));
    background: var(--space); border-bottom: 1px solid var(--hair);
  }
  body[data-role="subscriber"] .term__head > :not(.brand):not(.avatar):not(.help-btn) { display: none !important; }
  body[data-role="subscriber"] .help-btn { grid-column: 1; grid-row: 1; justify-self: start; width: 34px; height: 34px; padding: 0; }
  body[data-role="subscriber"] .brand {
    grid-column: 2; justify-self: center; align-items: center; gap: 8px; margin: 0;
  }
  body[data-role="subscriber"] .brand__word { display: block; height: 19px; width: auto; }
  body[data-role="subscriber"] .brand__name { display: none; }
  body[data-role="subscriber"] .brand__sub { display: none; }
  .avatar {
    grid-column: 3; justify-self: end; display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 50%; padding: 0;
    background: var(--raise-2); border: 1px solid var(--hair); color: var(--text);
    font-size: 14px; font-weight: 600;
  }
  .avatar svg { width: 18px; height: 18px; }

  /* screens: one per tab */
  body[data-role="subscriber"] .term__main { display: block; position: relative; min-height: 0; }
  body[data-role="subscriber"] .stage,
  body[data-role="subscriber"] .side,
  body[data-role="subscriber"] .panel {
    display: none; height: 100%; max-height: none; min-height: 0; border: 0;
  }
  body[data-tab="chart"] .stage { display: flex; }
  body[data-tab="nodos"]:not(.is-detail) .side,
  body[data-tab="community"] .side { display: flex; }
  body[data-tab="nodos"].is-detail .panel { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  body[data-role="subscriber"] .side__head,
  body[data-role="subscriber"] .side > .tg { display: none; }

  /* chart screen */
  .quote {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 12px 16px 10px;
  }
  .quote__pick {
    display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 4px; row-gap: 1px;
    background: none; border: 0; padding: 2px 0; text-align: left; color: var(--text); min-height: 44px;
  }
  .quote__ticker { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
  .quote__caret { width: 14px; height: 14px; color: var(--quiet); }
  .quote__name { grid-column: 1 / -1; font-size: 13px; color: var(--quiet); }
  .quote__px { display: grid; justify-items: end; gap: 1px; padding-top: 2px; }
  .quote__price { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
  .quote__chg { font-size: 13px; color: var(--quiet); }
  .quote__chg[data-dir="up"] { color: var(--up); }
  .quote__chg[data-dir="down"] { color: var(--down); }

  body[data-role="subscriber"] .toolbar,
  body[data-role="subscriber"] .chart-watermark { display: none; }
  body[data-role="subscriber"] .chart-wrap { flex: 1; height: auto; min-height: 0; border-top: 1px solid var(--hair); }
  body[data-role="subscriber"] .hint { display: none; }
  body[data-role="subscriber"] .tz { display: none; }
  body[data-role="subscriber"] .chartbar { border-top: 0; }
  body[data-role="subscriber"] .hint.is-error { display: block; color: var(--down); border-color: var(--hair); font-size: 13px; padding: 10px 16px; }
  /* full-screen chart: button in the empty corner under the price axis */
  .chart-full {
    display: grid; place-items: center; position: absolute; z-index: 6; right: 6px; bottom: 2px;
    width: 34px; height: 26px; padding: 0; border-radius: 6px;
    background: rgba(21, 30, 43, .92); border: 1px solid var(--hair); color: var(--quiet);
  }
  .chart-full svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .chart-full .i-close, body.is-chart-full .chart-full .i-open { display: none; }
  body.is-chart-full .chart-full .i-close { display: inline; }
  body.is-chart-full .chart-wrap {
    position: fixed; inset: 0; z-index: 200; height: auto; min-height: 0; margin: 0;
    background: var(--space);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  body.is-chart-full .chart { inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  body.is-chart-full .chart-full { right: calc(6px + env(safe-area-inset-right)); bottom: calc(4px + env(safe-area-inset-bottom)); color: var(--white); }
  body.is-chart-full .to-now { bottom: calc(40px + env(safe-area-inset-bottom)); }
  /* top bar in full screen: market, live price and timeframes */
  .fullbar { display: none; }
  body.is-chart-full .fullbar {
    display: flex; align-items: center; gap: 12px; position: absolute; z-index: 7;
    top: env(safe-area-inset-top); left: env(safe-area-inset-left); right: env(safe-area-inset-right); height: 48px;
    padding: 0 12px; background: var(--space); border-bottom: 1px solid var(--hair);
  }
  body.is-chart-full .chart { top: calc(48px + env(safe-area-inset-top)); }
  .fullbar__ticker { font-size: 17px; font-weight: 650; }
  .fullbar .quote__px { display: flex; align-items: baseline; gap: 8px; padding: 0; }
  .fullbar .quote__price { font-size: 16px; }
  .fullbar .quote__chg { font-size: 12px; }
  /* timeframes right after the price, the Analysis switch (with its label) at the right edge */
  body[data-role="subscriber"] .fullbar .tfbar { flex: 1; min-width: 0; margin-left: 0; padding: 0; border: 0; gap: 2px; }
  body[data-role="subscriber"] .fullbar .tfbar__btn { padding-inline: 8px; }
  .fullbar .tfbar__show { margin-left: auto; gap: 6px; font-size: 12px; white-space: nowrap; }

  body.is-chart-full { overflow: hidden; }
  .to-now {
    display: grid; place-items: center; position: absolute; z-index: 4; right: 68px; bottom: 36px;
    width: 36px; height: 36px; border-radius: 50%; padding: 0;
    background: rgba(21, 30, 43, .92); border: 1px solid var(--hair); color: var(--quiet);
  }
  .to-now svg { width: 16px; height: 16px; }

  .nodecard {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: stretch;
    margin: 10px 12px 12px; border-radius: 16px; background: var(--raise); border: 1px solid var(--hair);
    min-height: 84px;
  }
  .nodecard[hidden] { display: none !important; }
  .nodecard__note { grid-column: 1 / -1; align-self: center; padding: 16px 18px; font-size: 14px; color: var(--quiet); }
  .nodecard__step {
    display: grid; place-items: center; background: none; border: 0; color: var(--quiet); padding: 0;
  }
  .nodecard__step svg { width: 18px; height: 18px; }
  .nodecard__step:disabled { opacity: .25; cursor: default; }
  .nodecard__main {
    display: grid; gap: 1px; align-content: center; text-align: left;
    background: none; border: 0; padding: 12px 6px; color: var(--text); min-width: 0;
  }
  .nodecard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .nodecard__side { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
  .nodecard__side::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
  .nodecard__main.is-demand .nodecard__side { color: var(--cyan); }
  .nodecard__main.is-supply .nodecard__side { color: var(--amber); }
  .nodecard__pos { font-size: 12px; color: var(--quiet); }
  .nodecard__price { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
  .nodecard__row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  .nodecard__why { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nodecard__meta { font-size: 13px; color: var(--quiet); }

  /* NODOs screen: the list */
  body[data-role="subscriber"] .side { flex-direction: column; }
  body[data-role="subscriber"] .side__list { -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
  .list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 16px 10px; }
  .list-head h2 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
  .list-head span { font-size: 13px; color: var(--quiet); }
  body[data-role="subscriber"] .node-item {
    grid-template-columns: 10px 1fr auto; gap: 14px; padding: 14px 16px; min-height: 66px;
    border-bottom: 1px solid var(--hair);
  }
  body[data-role="subscriber"] .node-item.is-selected { background: var(--raise); box-shadow: none; }
  body[data-role="subscriber"] .node-item__time { font-size: 15px; font-weight: 550; }
  body[data-role="subscriber"] .node-row { row-gap: 8px; padding: 16px 18px; }
  body[data-role="subscriber"] .node-row__mkt { font-size: 20px; }
  body[data-role="subscriber"] .node-row__tf { font-size: 12px; padding: 2px 6px; }
  body[data-role="subscriber"] .node-row__time { font-size: 14px; }
  body[data-role="subscriber"] .node-row__word { font-size: 12px; }
  body[data-role="subscriber"] .node-row__price { font-size: 17px; }
  body[data-role="subscriber"] .node-row .node-item__dot { margin-top: 9px; }
  body[data-role="subscriber"] .node-item__meta { font-size: 13px; }
  body[data-role="subscriber"] .chip { font-size: 11px; letter-spacing: 0; text-transform: none; border-radius: 6px; padding: 1px 7px; }
  body[data-role="subscriber"] .panel__empty { padding: 24px 16px; font-size: 15px; }

  /* NODOs screen: one NODO */
  .panel__bar {
    position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
    padding: 0 8px; height: 48px; background: rgba(8, 12, 20, .9);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--hair);
  }
  .panel__back, .panel__tochart {
    display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px;
    background: none; border: 0; color: var(--cyan); font-size: 16px;
  }
  .panel__back svg { width: 20px; height: 20px; }
  .panel__tochart { font-size: 15px; }
  .node-hero { display: block; padding: 20px 16px 18px; border-bottom: 1px solid var(--hair); }
  .node-hero__side { font-size: 14px; font-weight: 600; }
  .node-hero.is-demand .node-hero__side { color: var(--cyan); }
  .node-hero.is-supply .node-hero__side { color: var(--amber); }
  .node-hero__price { font-size: 36px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; margin-top: 4px; }
  .node-hero__when { font-size: 13px; color: var(--quiet); margin-top: 2px; }
  .node-hero__price + .node-hero__when { margin-top: 6px; }
  body[data-role="subscriber"] .panel .section { padding: 18px 16px; border-bottom: 1px solid var(--hair); }
  body[data-role="subscriber"] .section__title {
    font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--quiet); margin-bottom: 12px;
  }
  body[data-role="subscriber"] .panel .section--head { display: none; } /* the hero says the same, larger */
  body[data-role="subscriber"] .pub { border: 0; background: none; padding: 0; }
  body[data-role="subscriber"] .pub__head { font-size: 12px; }
  body[data-role="subscriber"] .pub__text { font-size: 16px; line-height: 1.6; }
  body[data-role="subscriber"] .ai-box { border: 0; border-left: 2px solid var(--amber); border-radius: 0; background: none; padding: 2px 0 2px 14px; font-size: 16px; line-height: 1.6; }
  body[data-role="subscriber"] .ai-box__label { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; }
  body[data-role="subscriber"] .pub__drawings { font-size: 12px; }
  body[data-role="subscriber"] .readonly-note { display: none; }
  body[data-role="subscriber"] .status { font-size: 14px; }
  body[data-role="subscriber"] .history button { min-height: 44px; align-items: center; font-size: 13px; border-color: var(--hair); }

  .switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--quiet); }
  .switch input {
    appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 12px; margin: 0;
    background: var(--raise-2); border: 1px solid var(--hair); position: relative; transition: background .2s var(--ease);
  }
  .switch input::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--text); transition: transform .2s var(--ease);
  }
  .switch input:checked { background: var(--cyan); border-color: var(--cyan); }
  .switch input:checked::after { transform: translateX(16px); background: var(--space); }
  /* small one above the chart, next to the timeframes */
  .tfbar__show { margin-left: auto; gap: 7px; font-size: 12.5px; }
  .switch--sm input { width: 34px; height: 20px; border-radius: 10px; }
  .switch--sm input::after { width: 14px; height: 14px; }
  .switch--sm input:checked::after { transform: translateX(14px); }

  /* the thread under a NODO grows with the page instead of scrolling inside it */
  body[data-role="subscriber"] .panel .chat__log { max-height: none; overflow: visible; min-height: 0; }

  /* Community screen */
  body[data-role="subscriber"] .side:has(.side__chat:not([hidden])) { max-height: none; min-height: 0; }
  body[data-role="subscriber"] .side__chat { flex: 1; }
  .room-head { display: none; }
  body[data-tab="community"] .room-head { display: flex; border-bottom: 1px solid var(--hair); padding-bottom: 12px; }
  body[data-role="subscriber"] .chat__log { padding: 12px 12px; gap: 4px; }
  body[data-role="subscriber"] .chat__msg { padding: 9px 10px; border-radius: 12px; }
  body[data-role="subscriber"] .chat__meta { font-size: 12px; }
  body[data-role="subscriber"] .chat__body { font-size: 15.5px; }
  body[data-role="subscriber"] .chat__foot { border-color: var(--hair); padding: 10px 12px 8px; }
  body[data-role="subscriber"] .chat__input { border-radius: 20px; padding: 9px 14px; background: var(--raise); border-color: var(--hair); }
  body[data-role="subscriber"] .chat__send { border-radius: 20px; min-height: 40px; padding: 0 16px; }
  body[data-role="subscriber"] .chat__fine { font-size: 11.5px; }
  body[data-role="subscriber"] .chat__gate { border-radius: 16px; border-color: var(--hair); }
  body[data-role="subscriber"] .chat__gate h3 { font-size: 17px; }
  body[data-role="subscriber"] .chat__gate p { font-size: 14px; }
  body[data-role="subscriber"] .chat__join { font-size: 14px; }

  /* tab bar */
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(8, 12, 20, .94); border-top: 1px solid var(--hair);
  }
  .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; color: var(--quiet); font-size: 11px; font-weight: 500;
  }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar button[aria-current="page"] { color: var(--text); }
  /* the active tab gets a small lit node, like a star on the constellation mark */
  .tabbar button[aria-current="page"]::before {
    content: ""; position: absolute; top: 6px; width: 4px; height: 4px; border-radius: 50%;
    background: var(--cyan); box-shadow: 0 0 8px 1px rgba(67, 223, 255, .75);
  }
  .tabbar__dot {
    position: absolute; top: 9px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%;
    background: var(--cyan); border: 2px solid var(--space);
  }

  /* toasts drop in under the header, full width, clear of the NODO card and the tab bar */
  body[data-role="subscriber"] .toasts { left: 12px; right: 12px; top: calc(56px + env(safe-area-inset-top, 0px)); bottom: auto; max-width: none; }
  body[data-role="subscriber"] .toast {
    font-size: 14px; border-radius: 12px; padding: 12px 14px; border-left-width: 3px;
    background: #182231; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); animation-name: toast-drop;
  }
  body[data-role="subscriber"] .toast button { font-size: 14px; min-height: 32px; }
}

/* bottom sheets: markets and account (opened only from the phone layout) */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 86dvh;
  padding: 0 0 env(safe-area-inset-bottom, 0px); border: 0; border-radius: 20px 20px 0 0;
  background: #0f1621; color: #edf1f5; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .28s var(--ease); }
dialog.sheet::backdrop { background: rgba(2, 4, 8, .6); }
@keyframes sheet-up { from { transform: translateY(48px); } to { transform: none; } }
.sheet__grip { width: 36px; height: 5px; border-radius: 3px; background: rgba(150, 172, 196, .3); margin: 8px auto 0; flex: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 18px; flex: none; }
.sheet__head h2 { font-size: 17px; font-weight: 650; }
.sheet__close { background: none; border: 0; border-radius: 999px; color: var(--cyan); font-size: 16px; font-weight: 600; min-height: 36px; margin: 4px 2px; padding: 0 12px; }
.sheet__close:active { background: rgba(67, 223, 255, .1); }
.sheet__close:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px rgba(67, 223, 255, .6); }
dialog.sheet:focus { outline: none; }
.sheet__body { overflow-y: auto; padding: 4px 0 16px; }

.mgroup h3 { font-size: 13px; font-weight: 600; color: #8b97a7; padding: 14px 18px 6px; }
.mlist { display: grid; }
.mlist__row {
  display: grid; grid-template-columns: 118px 1fr auto; align-items: center; gap: 8px;
  min-height: 54px; padding: 0 18px; background: none; border: 0; border-top: 1px solid rgba(150, 172, 196, .1);
  text-align: left; color: #edf1f5;
}
.mlist__row:last-child { border-bottom: 1px solid rgba(150, 172, 196, .1); }
.mlist__row.is-on { background: #151e2b; }
.mlist__ticker { font-size: 16px; font-weight: 650; }
.mlist__name { font-size: 15px; color: #8b97a7; }
.mlist__on { font-size: 12px; font-weight: 600; color: var(--cyan); }

.who { padding: 4px 18px 16px; }
.who__name { font-size: 21px; font-weight: 650; letter-spacing: -.01em; overflow-wrap: anywhere; }
.who__status { font-size: 14px; color: #8b97a7; margin-top: 2px; }
.sheet__cta {
  display: flex; align-items: center; justify-content: center; margin: 0 18px 16px; min-height: 50px; border-radius: 14px;
  background: var(--cyan); color: var(--space); font-size: 16px; font-weight: 650; text-decoration: none;
}
.sheet__body .tg {
  margin: 0 18px 16px; padding: 14px; border: 1px solid rgba(150, 172, 196, .13); border-radius: 14px; background: #151e2b;
  flex-wrap: wrap;
}
.sheet__body .tg__text { font-size: 14px; }
.sheet__body .tg__text b { font-size: 15px; }
.sheet__body .tg .btn { min-height: 40px; border-radius: 10px; font-family: inherit; font-size: 14px; }
.sheet__links { display: grid; border-top: 1px solid rgba(150, 172, 196, .1); }
.sheet__links a, .sheet__links button {
  display: flex; align-items: center; min-height: 52px; padding: 0 18px; background: none; border: 0;
  border-bottom: 1px solid rgba(150, 172, 196, .1); color: #edf1f5; font-size: 16px; text-decoration: none; text-align: left;
}
.sheet__fine { padding: 14px 18px 0; font-size: 12px; color: #8b97a7; }

/* ======================================================================
   Intro: the first screen of an entry link. The constellation from the NODO
   logo draws itself star by star, the three nodes ignite, the wordmark comes
   up, then "Enter NODO" opens the terminal.
   ====================================================================== */
.intro { display: none; }
html.is-entry body { overflow: hidden; }
html.is-entry .intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: 1fr auto; justify-items: center;
  padding: env(safe-area-inset-top, 0px) 24px calc(28px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(60% 40% at 50% 42%, rgba(67, 223, 255, .07), transparent 70%),
    #080c14;
  color: #edf1f5;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}
.intro__logo {
  position: relative; align-self: center;
  width: min(78vw, 360px); aspect-ratio: 955 / 555;
  margin-top: 6vh;
}
.intro__sky { position: absolute; left: 28.27%; top: 0; width: 43.46%; overflow: visible; }
.intro__word { position: absolute; left: 0; top: 42.34%; width: 100%; height: auto; }
.intro__lines path { stroke: #5db0ca; stroke-dasharray: 1; stroke-dashoffset: 1; animation: intro-draw .22s linear var(--d) forwards; }
.intro__stars circle { fill: #f7f9fc; opacity: 0; transform-box: fill-box; transform-origin: center; animation: intro-star .4s cubic-bezier(.22, 1, .36, 1) var(--d) forwards; }
.intro__stars .is-node { fill: #75dcfb; }
.intro__halos circle { fill: #43dfff; opacity: 0; transform-box: fill-box; transform-origin: center; filter: blur(5px); animation: intro-ignite 1.1s ease-out calc(var(--d) + .7s) forwards, intro-breathe 3.2s ease-in-out calc(var(--d) + 1.8s) infinite; }
.intro__word { opacity: 0; animation: intro-word .9s cubic-bezier(.22, 1, .36, 1) 1.45s forwards; }
.intro__act { display: grid; justify-items: center; gap: 12px; width: 100%; opacity: 0; animation: intro-up .6s cubic-bezier(.22, 1, .36, 1) 2.1s forwards; }
.intro__go {
  width: min(100%, 320px); height: 54px; border-radius: 14px;
  border: 1px solid rgba(67, 223, 255, .55); background: rgba(67, 223, 255, .08); color: #fff;
  font-family: inherit; font-size: 17px; font-weight: 600; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 0 0 0 rgba(67, 223, 255, 0), inset 0 0 24px rgba(67, 223, 255, .08);
  transition: background .2s, box-shadow .2s, transform .12s;
}
.intro__go:hover { background: rgba(67, 223, 255, .14); box-shadow: 0 0 28px rgba(67, 223, 255, .18), inset 0 0 24px rgba(67, 223, 255, .1); }
.intro__go:active { transform: scale(.98); }
.intro__go:focus-visible { outline: 2px solid #43dfff; outline-offset: 3px; }
.intro__go[aria-busy="true"] { color: #8b97a7; cursor: progress; }
.intro__fine { margin: 0; font-size: 13px; color: #8b97a7; }
.intro__fine.is-error { color: #ff7b6b; }
.intro.is-leaving { animation: intro-leave .45s cubic-bezier(.4, 0, .2, 1) forwards; pointer-events: none; }
.intro.is-leaving .intro__logo { animation: intro-zoom .45s cubic-bezier(.4, 0, .2, 1) forwards; }

@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-star { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes intro-ignite { 0% { opacity: 0; transform: scale(.4); } 35% { opacity: .95; transform: scale(1.25); } 100% { opacity: .55; transform: scale(1); } }
@keyframes intro-breathe { 0%, 100% { opacity: .55; } 50% { opacity: .85; } }
@keyframes intro-word { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes intro-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes intro-leave { to { opacity: 0; } }
@keyframes intro-zoom { to { transform: scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
  .intro *, .intro { animation: none !important; }
  .intro__lines path { stroke-dashoffset: 0; }
  .intro__stars circle, .intro__word, .intro__act { opacity: 1; }
  .intro__halos circle { opacity: .55; }
}

.hint__retry {
  margin-left: 10px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid currentColor; background: none; color: inherit; font: inherit; cursor: pointer;
}

/* Timeframe switch (5m · 1H · 1D). A small count marks timeframes with NODOs. */
.tfbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tfbar[hidden] { display: none; }
.tfbar__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel);
  font-family: var(--mono); font-size: 12px; color: var(--muted); cursor: pointer;
}
.tfbar__btn[aria-pressed="true"] { color: var(--white); border-color: var(--cyan); }
.tfbar__n { font-size: 10.5px; color: var(--cyan); }
.chip--tf { color: var(--muted); border-color: var(--line-2); }
.nodecard__link { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  body[data-role="subscriber"] .tfbar { padding: 0 16px 10px; border: 0; gap: 4px; }
  body[data-role="subscriber"] .tfbar__btn {
    min-height: 32px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent;
    font-family: var(--sys); font-size: 14px; font-weight: 600; color: var(--quiet);
  }
  body[data-role="subscriber"] .tfbar__btn[aria-pressed="true"] { background: var(--raise-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair); }
  body[data-role="subscriber"] .tfbar__n {
    min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center;
    background: rgba(67, 223, 255, .14); color: var(--cyan); font-size: 11px; font-weight: 600;
  }
}

/* Watchlist: button next to the market, and its sheet */
.quote__watch { display: none; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .quote { display: grid; grid-template-columns: auto auto 1fr; align-items: start; }
  .quote__px { justify-self: end; }
  .quote__watch {
    display: inline-flex; align-items: center; gap: 6px; align-self: start; margin-top: 7px;
    height: 32px; padding: 0 12px 0 10px; border-radius: 16px;
    background: var(--raise-2); border: 1px solid var(--hair); color: var(--text);
    font-family: var(--sys); font-size: 13.5px; font-weight: 600;
  }
  .quote__watch svg { width: 15px; height: 15px; color: var(--cyan); }
}
dialog.sheet--tall[open] { height: 86dvh; }
.wsearch {
  display: flex; align-items: center; gap: 8px; flex: none;
  margin: 2px 16px 6px; padding: 0 12px; height: 42px; border-radius: 12px;
  background: #151e2b; border: 1px solid rgba(150, 172, 196, .13); color: #8b97a7;
}
.wsearch:focus-within { border-color: rgba(67, 223, 255, .55); }
.wsearch svg { width: 16px; height: 16px; flex: none; }
.wsearch input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; padding: 0;
  color: #edf1f5; font-family: inherit; font-size: 16px; /* 16px: iOS does not zoom in */
}
.wsearch input::placeholder { color: #8b97a7; }
.wsearch input::-webkit-search-cancel-button { filter: invert(.6); }
.wnote { padding: 6px 18px 10px; font-size: 14px; color: #8b97a7; }
.wrow {
  display: grid; grid-template-columns: 1fr 52px; align-items: center;
  border-top: 1px solid rgba(150, 172, 196, .1);
}
.mlist > .wrow:last-child { border-bottom: 1px solid rgba(150, 172, 196, .1); }
.wrow.is-on { background: #151e2b; }
.wrow__main, .wrow--add {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 0 0 18px; background: none; border: 0; text-align: left; color: #edf1f5; font: inherit;
}
.wrow--add { grid-template-columns: 96px 1fr 52px; padding-right: 0; width: 100%; border-top: 1px solid rgba(150, 172, 196, .1); }
.wrow--add:disabled { cursor: default; opacity: 1; }
.wrow__ticker { font-size: 16px; font-weight: 650; }
.wrow__name { font-size: 15px; color: #8b97a7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrow__px { display: grid; justify-items: end; gap: 1px; }
.wrow__price { font-size: 15px; font-weight: 600; }
.wrow__chg { font-size: 12.5px; color: #8b97a7; }
.wrow__chg[data-dir="up"] { color: #4fd69c; }
.wrow__chg[data-dir="down"] { color: #ff7b6b; }
.wrow__x, .wrow__plus { display: grid; place-items: center; width: 52px; height: 56px; color: #8b97a7; }
.wrow__x { background: none; border: 0; padding: 0; }
.wrow__x svg, .wrow__plus svg { width: 16px; height: 16px; }
.wrow__plus { color: var(--cyan); }
.wrow--add.is-added .wrow__plus { color: #4fd69c; }

/* full-screen top bar on narrow phones: drop the 24h change to fit the timeframes */
@media (max-width: 430px) {
  .fullbar .quote__chg { display: none; }
  .fullbar { gap: 8px; }
}

/* =====================================================================
   Admin terminal type system (admin + accounts pages)
   IBM Plex Sans for the whole interface, tabular figures so prices and
   times line up; IBM Plex Mono only for codes (NODO ids). No tiny
   letter-spaced capitals: labels are sentence case at a readable size.
   ===================================================================== */
body[data-role="admin"] {
  --ui: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --code: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --display: var(--ui);
  --mono: var(--ui);
  --muted: #a7b4c4;
  --muted-2: #7f90a5;
  font-size: 13.5px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
body[data-role="admin"] :is(.side__head, .section__title, .kv dt, .drawing-row__type, .drawbar__name, .ai-box__label,
  .chip, .users th, .pill, .field > span, .mkt__label, .mkt__group, .node-side, .brand__sub, .badge, .chat__badge) {
  text-transform: none; letter-spacing: 0;
}

/* brand: the real wordmark + where you are */
body[data-role="admin"] .brand { align-items: center; gap: 10px; }
body[data-role="admin"] .brand__word--admin { display: block; height: 20px; width: auto; }
body[data-role="admin"] .brand__sub { font-size: 12.5px; font-weight: 500; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); }

/* controls */
body[data-role="admin"] :is(.tool, .btn, .select, .input, .market, .mkt__btn, .icon-btn, .tz__btn, .toggle-line, .check-line) { font-size: 13px; }
body[data-role="admin"] .tool { font-weight: 500; }
body[data-role="admin"] .btn { font-weight: 500; letter-spacing: 0; }
body[data-role="admin"] .mkt__btn { height: 32px; gap: 8px; }
body[data-role="admin"] .mkt__label { font-size: 13px; font-weight: 500; }
body[data-role="admin"] .mkt__current { font-weight: 600; }
body[data-role="admin"] .mkt__ticker { font-size: 13.5px; }
body[data-role="admin"] .mkt__group { font-size: 11.5px; }
body[data-role="admin"] .account__who { font-size: 13px; }

/* left list */
body[data-role="admin"] .side__head { font-size: 13px; font-weight: 600; color: var(--white); }
body[data-role="admin"] .side__head > :last-child { color: var(--muted); font-weight: 500; }
body[data-role="admin"] .node-item__time { font-size: 14px; font-weight: 500; }
body[data-role="admin"] .node-item__meta { font-size: 12.5px; }
body[data-role="admin"] .chip { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 10px; }

/* right panel */
body[data-role="admin"] .panel__empty h2 { font-size: 17px; font-weight: 600; }
body[data-role="admin"] .panel__empty p { font-size: 13.5px; line-height: 1.55; }
body[data-role="admin"] .section__title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
body[data-role="admin"] .node-id { font-family: var(--code); font-size: 12.5px; color: var(--muted); }
body[data-role="admin"] .node-side { font-size: 14px; font-weight: 600; margin-top: 2px; }
body[data-role="admin"] .kv { row-gap: 5px; }
body[data-role="admin"] .kv dt { font-size: 12.5px; padding-top: 0; }
body[data-role="admin"] .kv dd { font-size: 13px; }
body[data-role="admin"] .ai-box { font-size: 13.5px; line-height: 1.55; }
body[data-role="admin"] .ai-box__label { font-size: 11.5px; font-weight: 600; }
body[data-role="admin"] .textarea { font-family: var(--ui); font-size: 14px; line-height: 1.55; }
body[data-role="admin"] :is(.status, .readonly-note, .pub__head, .pub__drawings, .feed-item__at, .history button) { font-size: 12.5px; }
body[data-role="admin"] .drawing-row { grid-template-columns: 118px 1fr auto; }
body[data-role="admin"] .drawing-row__type { font-size: 12px; font-weight: 600; line-height: 1.3; }
body[data-role="admin"] .drawing-row__val { font-size: 12.5px; }
body[data-role="admin"] .drawing-row .input { font-size: 12.5px; }

/* chart area */
body[data-role="admin"] .chart-watermark { font-size: 12px; letter-spacing: .02em; text-transform: none; }
body[data-role="admin"] .hint { font-size: 12.5px; }
body[data-role="admin"] .drawbar__name { font-size: 12.5px; font-weight: 600; }
body[data-role="admin"] .drawbar__btn { font-family: var(--ui); font-size: 12.5px; }
body[data-role="admin"] .drawtext { font-family: var(--ui); }
body[data-role="admin"] .term__foot { font-size: 12px; }
body[data-role="admin"] .toast { font-size: 13.5px; }
body[data-role="admin"] .toast button { font-size: 13px; }

/* accounts page */
body[data-role="admin"] .users th { font-size: 12px; font-weight: 600; }
body[data-role="admin"] :is(.users td.mono, .users .muted, .users .select, .users .row-actions .btn, .request__meta, .request__actions .btn, .mail-status, .form-msg, .field__hint, .auth__foot) { font-size: 12.5px; }
body[data-role="admin"] .field > span { font-size: 12.5px; font-weight: 500; }
body[data-role="admin"] .pill { font-size: 11px; font-weight: 500; }

/* admin toolbar fits on one line: slightly tighter icon buttons */
body[data-role="admin"] .toolbar { gap: 4px; padding-inline: 10px; }
body[data-role="admin"] .tool--icon { width: 28px; height: 28px; }
body[data-role="admin"] .toolbar__sep { margin: 0 2px; }

/* market of each NODO in the all-markets list */
.chip--mkt { color: var(--white); border-color: rgba(246, 249, 252, .28); font-weight: 600; }

/* ---------- "Keep your free trial" (guests) ---------- */
dialog.gate {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 440px; max-height: 92dvh; overflow-y: auto;
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 22px 22px 0 0;
  background: #0f1621; color: #edf1f5;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}
dialog.gate[open] { display: flex; flex-direction: column; gap: 12px; animation: sheet-up .3s var(--ease); }
dialog.gate::backdrop { background: rgba(2, 4, 8, .72); backdrop-filter: blur(3px); }
@media (min-width: 761px) {
  dialog.gate { inset: 0; margin: auto; height: fit-content; border-radius: 16px; padding: 26px 28px; border: 1px solid #233244; }
  .gate__grip { display: none; }
}
.gate__grip { width: 38px; height: 5px; border-radius: 3px; background: #2a3646; align-self: center; margin-bottom: 6px; }
.gate__title { font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
.gate__sub { font-size: 15px; line-height: 1.45; color: #9aa7b6; }
.gate__tg {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border-radius: 14px; border: 0;
  background: #2aabee; color: #fff; font-size: 16px; font-weight: 600;
}
.gate__tg-icon { font-size: 18px; transform: rotate(-20deg); }
.gate__or { display: flex; align-items: center; gap: 10px; color: #6f7d8d; font-size: 13px; }
.gate__or::before, .gate__or::after { content: ""; flex: 1; height: 1px; background: #223042; }
.gate__form { display: grid; gap: 10px; }
.gate__input {
  min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid #2a3646; background: #0a1019; color: #edf1f5;
  font-size: 16px; outline: none;
}
.gate__input:focus { border-color: var(--cyan); }
.gate__primary { min-height: 52px; border-radius: 14px; border: 0; background: var(--cyan); color: #04121a; font-size: 16px; font-weight: 650; }
.gate__primary:disabled { opacity: .6; }
.gate__msg { min-height: 0; font-size: 13.5px; color: #ff8a80; }
.gate__msg:empty { display: none; }
.gate__fine { font-size: 13.5px; color: #8593a3; text-align: center; }
.gate__fine:empty { display: none; }
.gate__link { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.gate__later { align-self: center; background: none; border: 0; color: #9aa7b6; font-size: 15px; padding: 8px 16px; }


/* language choice on the entry screen, and in the account sheet */
.intro__langs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 320px); animation: intro-up .35s cubic-bezier(.22, 1, .36, 1) both; }
.intro__lang {
  height: 54px; border-radius: 14px; border: 1px solid rgba(67, 223, 255, .55); background: rgba(67, 223, 255, .08);
  color: #fff; font-family: inherit; font-size: 17px; font-weight: 600; cursor: pointer;
  transition: background .2s, transform .12s;
}
.intro__lang:hover { background: rgba(67, 223, 255, .16); }
.intro__lang:active { transform: scale(.98); }
.intro__lang:focus-visible { outline: 2px solid #43dfff; outline-offset: 3px; }
.langpick { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 4px; }
.langpick__label { font-size: 15px; color: #9aa7b6; }
.langpick__seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #0a1019; border: 1px solid #2a3646; }
.langpick__opt { border: 0; background: none; color: #9aa7b6; font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 8px; }
.langpick__opt.is-on { background: #1c2a3b; color: #fff; }
.gate__alt { align-self: center; font-size: 15px; padding: 6px 0; }
/* admin: Spanish version of the analysis */
.es-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 8px; }
.es-head .section__title { margin: 0; }
.textarea--es { min-height: 110px; }
.aliaspick { display: inline-flex; align-items: center; gap: 10px; }
.chat__alias { flex: 1; }

/* ⓘ above every chat: AI agents take part */
.ai-info { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.ai-info__btn {
  width: 16px; height: 16px; border-radius: 50%; padding: 0; display: inline-grid; place-items: center;
  border: 1px solid currentColor; background: none; color: inherit; opacity: .7;
  font: italic 600 10px/1 Georgia, 'Times New Roman', serif; cursor: pointer;
}
.ai-info__btn:hover, .ai-info__btn[aria-expanded="true"] { opacity: 1; color: var(--cyan); }
.ai-info__note {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: max-content; max-width: 230px;
  padding: 8px 10px; border-radius: 8px; background: #1a2433; border: 1px solid #2a3646; color: #dfe6ee;
  font-size: 12.5px; font-weight: 400; font-style: normal; letter-spacing: 0; text-transform: none; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.room-head__sub { display: inline-flex; align-items: center; gap: 6px; }
.chat__author--agent { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
/* drawing thickness picker */
.drawbar__widths { display: inline-flex; gap: 2px; padding: 0 4px; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.drawbar__width { width: 26px; height: 22px; display: grid; place-items: center; background: none; border: 1px solid transparent; border-radius: 4px; padding: 0; }
.drawbar__width i { display: block; width: 16px; background: var(--muted); border-radius: 1px; }
.drawbar__width:hover i, .drawbar__width.is-active i { background: var(--white); }
.drawbar__width.is-active { border-color: var(--line-2); background: rgba(255, 255, 255, .05); }

/* admin → Agents */
.agents-lead { max-width: 70ch; margin-top: -10px; }
.agents-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.agents-row__label { width: 70px; color: var(--muted); font-weight: 500; }
.agents-row__hint { font-size: 12.5px; }
.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--space); border: 1px solid var(--line-2); }
.seg__opt { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 6px; }
.seg__opt.is-on { background: #1c2a3b; color: var(--white); }
.agents-table td { vertical-align: middle; }
.agents-table .input, .agents-table .select { width: 100%; min-width: 0; }
.agents-table td:first-child { min-width: 130px; }
.agents-table .agents-note { min-width: 220px; }
.agents-table tr.is-paused td { opacity: .6; }
.agents-sub { font-size: 14px; margin: 18px 0 10px; }
.form .agents-note { grid-column: span 2; }
.agents-recent { display: grid; gap: 8px; max-height: 520px; overflow-y: auto; }
.agents-msg { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--space-2); }
.agents-msg__head { font-size: 13px; }
.agents-msg__body { grid-column: 1; font-size: 13.5px; line-height: 1.45; }
.agents-msg .icon-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* ---------- help button + first-visit guide ---------- */
.help-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line-2); color: var(--muted);
  font-size: 15px; font-weight: 600; line-height: 1;
}
.help-btn:hover, .help-btn:focus-visible { color: var(--white); border-color: var(--cyan); }
body[data-role="admin"] .help-btn { display: none; }

.tour { position: fixed; inset: 0; z-index: 90; }
.tour__spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(67, 223, 255, .85), 0 0 0 200vmax rgba(3, 6, 11, .74);
  transition: left .35s var(--ease), top .35s var(--ease), width .35s var(--ease), height .35s var(--ease);
}
.tour.is-center { background: rgba(3, 6, 11, .74); }
.tour.is-center .tour__spot { display: none; }
.tour__card {
  position: fixed; width: min(340px, calc(100vw - 32px));
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 18px 18px 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
  transition: left .35s var(--ease), top .35s var(--ease);
}
.tour.is-center .tour__card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); transition: none; }
.tour__card.is-in { animation: tour-in .32s var(--ease); }
.tour.is-center .tour__card.is-in { animation: none; }
@keyframes tour-in { from { opacity: 0; translate: 0 6px; } }
.tour__count { font-size: 12px; color: var(--muted-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tour__title { font-size: 17px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.tour__body { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.tour__acts { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; }
.tour__skip { background: none; border: 0; color: var(--muted-2); padding: 10px 8px; font-size: 14px; margin-right: auto; }
.tour__next {
  background: var(--cyan); color: #04111a; border: 0; border-radius: 10px;
  padding: 10px 18px; font-size: 14.5px; font-weight: 600;
}
.tour__next:focus-visible, .tour__skip:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .tour__spot, .tour__card { transition: none; }
}

/* ---------- admin: TradingView alerts ---------- */
.alerts-btn { display: inline-flex; align-items: center; gap: 7px; }
.alerts-btn__n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--amber); color: var(--space); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.alerts-btn__n[hidden] { display: none; }
.tva {
  margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(460px, 100vw);
  background: var(--space-2); color: var(--white); border: 0; border-left: 1px solid var(--line-2);
  padding: 18px 18px 24px; overflow-y: auto;
}
.tva::backdrop { background: rgba(3, 6, 11, .55); }
.tva__head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tva__head h2 { font-size: 16px; font-weight: 600; margin-right: auto; }
.tva__list { list-style: none; display: grid; gap: 8px; }
.tva__item { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.tva__item.is-done { opacity: .55; background: transparent; }
.tva__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tva__side { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tva__side.is-demand { color: var(--cyan); }
.tva__side.is-supply { color: var(--amber); }
.tva__market { font-weight: 600; }
.tva__tf, .tva__when { color: var(--muted); font-size: 12px; }
.tva__price { font-family: var(--mono); font-size: 12.5px; }
.tva__when { margin-left: auto; }
.tva__msg { margin-top: 6px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.tva__warn { margin-top: 6px; color: var(--amber); font-size: 12.5px; }
.tva__acts { display: flex; gap: 6px; margin-top: 8px; }
.tva__acts:empty { display: none; }
.tva__empty { padding: 18px 0; }
.tva__setup { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.tva__setup summary { cursor: pointer; font-weight: 600; }
.tva__steps { margin: 12px 0 0 18px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.tva__steps b { color: var(--white); font-weight: 600; }
.tva__copyrow { display: flex; gap: 6px; align-items: flex-start; margin-left: -18px; }
.tva__url, .tva__tpl { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px; }
.tva__tpl { resize: none; }
.tva__fine { margin-top: 12px; font-size: 12.5px; }

/* New NODO form: move the NODO one bar at a time */
.bar-step { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.bar-step .mono { flex: 1; text-align: center; font-size: 13px; }
.bar-step .btn { min-width: 44px; }

/* Analysis replay (members): the analysis builds itself on the chart */
.chart-actions { position: absolute; z-index: 4; top: 10px; right: 72px; display: flex; gap: 6px; }
.chart-replay {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid rgba(67, 223, 255, .45); border-radius: 999px; background: rgba(8, 12, 20, .82);
  color: var(--cyan); font: 600 12px var(--display); cursor: pointer;
}
.chart-replay:hover { background: rgba(67, 223, 255, .12); }
.chart-replay__icon { font-size: 9px; }
.replay { position: absolute; inset: 0; z-index: 5; pointer-events: none; transition: opacity .3s ease; }
.replay.is-out { opacity: 0; pointer-events: none; }
/* The sketch told as a story (subscriber.js runStory): below the chart buttons. */
.story .replay__cap { top: 54px; }
.story .replay__skip { bottom: 52px; }
.replay__fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.replay__cap {
  position: absolute; left: 0; right: 64px; top: 16px; padding: 0 16px; text-align: center; pointer-events: none;
  opacity: 0; transform: translateY(6px);
}
.replay__cap.is-in { animation: replay-cap .45s var(--ease) forwards; }
@keyframes replay-cap { to { opacity: 1; transform: none; } }
.replay__eye { margin: 0 0 4px; font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.replay__title {
  margin: 0; font: 700 22px/1.15 var(--display); letter-spacing: .02em; text-transform: uppercase; color: var(--white);
  text-shadow: 0 2px 14px rgba(8, 12, 20, .95), 0 0 2px rgba(8, 12, 20, .9);
}
.replay__skip {
  pointer-events: auto;
  position: absolute; left: 12px; bottom: 40px; min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(8, 12, 20, .82); color: var(--muted); font: 500 12px var(--display); cursor: pointer;
}
@media (max-width: 767px) {
  .chart-actions { top: 8px; right: 62px; }
  .replay__title { font-size: 19px; }
}

/* NODO plan: target and invalidation */
.node-plan { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.node-plan__item { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.node-plan__item small { font-size: 11px; color: var(--muted); }
.node-plan__item b { font: 600 14px var(--mono); }
.node-plan__item.is-target { border-color: rgba(67, 223, 255, .5); }
.node-plan__item.is-target b { color: var(--cyan); }
.node-plan__item.is-invalid b { color: #FF6B6B; }

/* Market replay: fast-forward from the NODO to the target */
.mreplay { position: absolute; inset: 0; z-index: 5; pointer-events: none; transition: opacity .3s ease; }
.mreplay.is-out { opacity: 0; pointer-events: none; }
.mreplay__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mreplay__hud { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 90px); pointer-events: none; }
.mreplay__eye { margin: 0; font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mreplay__big {
  margin: 2px 0 0; font: 700 30px/1.1 var(--display); color: var(--cyan); letter-spacing: -.01em;
  text-shadow: 0 2px 14px rgba(8, 12, 20, .95);
}
.mreplay__big.is-down { color: var(--white); }
.mreplay__sub { margin: 2px 0 8px; font: 500 12px var(--display); color: var(--white); text-shadow: 0 1px 8px rgba(8, 12, 20, .95); }
.mreplay__meter { width: 180px; height: 4px; border-radius: 2px; background: rgba(150, 165, 184, .25); overflow: hidden; }
.mreplay__fill { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); transition: width .15s linear; }
.mreplay.is-landed .mreplay__big { text-transform: uppercase; font-size: 26px; }
.mreplay.is-target .mreplay__big { color: var(--cyan); text-shadow: 0 0 12px rgba(67, 223, 255, .9), 0 0 32px rgba(67, 223, 255, .6); animation: mr-glow 1.2s ease-in-out 2; }
.mreplay.is-invalid .mreplay__big { color: #FF6B6B; }
.mreplay__flash { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(67, 223, 255, .32), rgba(67, 223, 255, .06) 55%, transparent 75%);
  box-shadow: inset 0 0 60px rgba(67, 223, 255, .55); }
.mreplay.is-target .mreplay__flash { animation: mr-flash 1.4s ease-out forwards; }
@keyframes mr-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mr-glow { 50% { text-shadow: 0 0 18px rgba(67, 223, 255, 1), 0 0 48px rgba(67, 223, 255, .8); } }
@media (prefers-reduced-motion: reduce) {
  .mreplay.is-target .mreplay__flash, .mreplay.is-target .mreplay__big { animation: none; }
  .mreplay.is-target .mreplay__flash { opacity: .6; }
}

/* Admin: the NODO's plan */
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.plan-field .input.is-invalid { border-color: #FF6B6B; }

/* Admin: correcting a NODO placed by hand */
.node-edit { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.node-edit__snap { width: 100%; margin-top: 8px; }

/* NODO status against its plan */
.chip--status.is-open { color: var(--muted); border-color: var(--line); }
.chip--status.is-late { color: var(--muted); border-color: var(--line); border-style: dashed; }
.chip--status.is-target { color: var(--space); background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px rgba(67, 223, 255, .55); }
.chip--status.is-invalid { color: #FF6B6B; border-color: rgba(255, 107, 107, .5); }
.node-hero__side .chip--status { margin-left: 8px; vertical-align: middle; }
.nodecard__meta { display: flex; align-items: center; flex-wrap: wrap; row-gap: 4px; }
.btn--danger { color: #FF6B6B; border-color: rgba(255, 107, 107, .45); }
.btn--danger:hover { color: #FF6B6B; border-color: #FF6B6B; }

/* Phones: the NODO card plays the analysis; "Read" opens its text */
.nodecard { position: relative; }
.nodecard__read {
  position: absolute; right: 40px; bottom: 10px; min-height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(8, 12, 20, .6); color: var(--cyan); font: 600 12px var(--display); cursor: pointer;
}

/* Phones: a compact NODO card and quote, so the chart gets the room */
@media (max-width: 767px) {
  .quote__chg { white-space: nowrap; font-size: 12px; }
  .nodecard { min-height: 0; margin: 6px 10px 8px; border-radius: 12px; grid-template-columns: 30px minmax(0, 1fr) 30px; }
  .nodecard__main { padding: 8px 2px; gap: 2px; }
  .nodecard__top { justify-content: flex-start; }
  .nodecard__top .chip--status { font-size: 10px; padding: 1px 6px; }
  .nodecard__pos { margin-left: auto; font-size: 11px; }
  .nodecard__side { font-size: 12px; }
  .nodecard__row { padding-right: 60px; }
  .nodecard__price { font-size: 16px; }
  .nodecard__why { font-size: 12px; }
  .nodecard__meta { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nodecard__read { right: 36px; top: auto; bottom: 8px; min-height: 28px; padding: 0 12px; }
  .chart-replay { min-height: 28px; padding: 0 10px; font-size: 11px; }
}

/* Phones: the replay buttons sit top-left, clear of the levels' labels on the right */
@media (max-width: 767px) {
  .chart-actions { left: 10px; right: auto; top: 8px; }
}

/* Members: key levels base layer — the drifting constellation and the status line */
.ambient { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.chart-status {
  position: absolute; z-index: 4; left: 10px; bottom: 42px; max-width: calc(100% - 140px);
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px;
  background: rgba(8, 12, 20, .78); border: 1px solid var(--line); color: var(--muted);
  font: 500 11px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.chart-status[hidden] { display: none; }
.chart-status__dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: status-pulse 2.2s ease-in-out infinite; }
.chart-status.is-near { color: var(--white); border-color: rgba(67, 223, 255, .55); }
@keyframes status-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .chart-status__dot { animation: none; } }

/* Admin: key levels dialog */
.lvl__list { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lvl__row { display: grid; grid-template-columns: 120px 120px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .lvl__row { grid-template-columns: 1fr 1fr; } }
.lvl__read { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 6px 0 14px; padding-top: 12px; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.lvl__read > p, .lvl__read > .lvl__check, .lvl__read > .lvl__field:nth-of-type(3) { grid-column: 1 / -1; }
.lvl__field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted, #8a97a8); }
.lvl__check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
@media (max-width: 640px) { .lvl__read { grid-template-columns: 1fr; } }

/* Install as an app (PWA) */
.install__steps { margin: 0; padding: 10px 18px 14px; font-size: 13px; color: #b8c3d1; border-bottom: 1px solid rgba(150, 172, 196, .1); }
.install__steps[hidden], .install-card__steps[hidden] { display: none; }
.install-card {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 12px 12px 14px; border-radius: 14px; background: #0c121d;
  border: 1px solid rgba(67, 223, 255, .28); box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  animation: install-in .35s ease-out;
}
.install-card__icon { border-radius: 10px; }
.install-card__text { display: grid; gap: 2px; font-size: 13px; color: #b8c3d1; }
.install-card__text strong { color: var(--white); font: 600 14px var(--display); }
.install-card__steps { margin: 4px 0 0; color: var(--cyan); }
.install-card__actions { display: flex; align-items: center; gap: 4px; }
.install-card__actions .btn { min-height: 36px; padding: 0 14px; }
.install-card__close { width: 36px; height: 36px; background: none; border: 0; color: #8b97a7; font-size: 14px; }
@keyframes install-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .install-card { animation: none; } }
/* nudges (install / Telegram / email) share the install card */
.nudge__icon { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.nudge__icon--tg, .nudge__icon--mail {
  display: grid; place-items: center; font-size: 18px; font-weight: 700; color: var(--space);
  background: var(--cyan);
}
.nudge__icon--tg { background: #2AABEE; color: #fff; }
.sheet__links .install button { width: 100%; }
.sheet__body .langpick { padding-left: 18px; padding-right: 18px; }
.langpick__seg--sm { padding: 2px; border-radius: 8px; }
.langpick__seg--sm .langpick__opt { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
/* iPhone install guide: an arrow at the browser's Share button */
.install-guide { position: fixed; inset: 0; z-index: 80; background: rgba(4, 7, 12, .72); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.install-guide__arrow { position: absolute; color: var(--cyan); filter: drop-shadow(0 0 10px rgba(67, 223, 255, .7)); }
.install-guide.is-top .install-guide__arrow { top: calc(8px + env(safe-area-inset-top, 0px)); right: 74px; animation: guide-up 1.2s ease-in-out infinite; }
.install-guide.is-bottom .install-guide__arrow { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: 50%; margin-left: -28px; transform: rotate(135deg); animation: guide-down 1.2s ease-in-out infinite; }
.install-guide__box {
  position: absolute; left: 16px; right: 16px; display: grid; gap: 12px; justify-items: start;
  padding: 16px 18px; border-radius: 16px; background: #0c121d; border: 1px solid rgba(67, 223, 255, .35);
  color: var(--white); font-size: 15px; box-shadow: 0 16px 48px rgba(0, 0, 0, .6);
}
.install-guide.is-top .install-guide__box { top: calc(84px + env(safe-area-inset-top, 0px)); }
.install-guide.is-bottom .install-guide__box { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.install-guide__box img { border-radius: 11px; }
.install-guide__head { display: flex; align-items: center; gap: 12px; }
.install-guide__head div { display: grid; gap: 2px; }
.install-guide__head span { color: #b8c3d1; font-size: 14px; }
.install-guide__seg { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: rgba(150, 172, 196, .12); justify-self: stretch; }
.install-guide__opt { flex: 1; min-height: 38px; border: 0; border-radius: 8px; background: none; color: #b8c3d1; font: 600 15px var(--display, inherit); }
.install-guide__opt[aria-pressed="true"] { background: var(--cyan); color: #06121c; }
.install-guide:not([class*="is-"]) .install-guide__box { top: 50%; transform: translateY(-50%); }
.install-guide.is-menu .install-guide__arrow { top: calc(4px + env(safe-area-inset-top, 0px)); right: 4px; animation: guide-up 1.2s ease-in-out infinite; }
.install-guide.is-menu .install-guide__box { top: calc(84px + env(safe-area-inset-top, 0px)); }
.install-guide__box ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.35; }
.install-guide__box .btn { justify-self: stretch; min-height: 42px; }
@keyframes guide-up { 50% { transform: translate(4px, -6px); } }
@keyframes guide-down { 0%, 100% { transform: rotate(135deg) translate(0, 0); } 50% { transform: rotate(135deg) translate(-6px, 0); } }
@media (prefers-reduced-motion: reduce) { .install-guide__arrow { animation: none !important; } }

/* Pending analysis: TradingView alerts waiting for key levels or a NODO. */
.queue { border-bottom: 1px solid var(--line); max-height: 42vh; overflow-y: auto; }
.queue__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.queue__n {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  color: var(--space); background: var(--amber); font-size: 10px; letter-spacing: 0;
}
.queue__list { list-style: none; margin: 0; padding: 0 0 6px; }
.queue__item { border-top: 1px solid var(--line); }
.queue__item.is-on { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--cyan); }
.queue__main {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; column-gap: 10px; row-gap: 3px;
  width: 100%; text-align: left; background: none; border: 0; padding: 10px 14px 6px; color: inherit;
}
.queue__main:hover { background: var(--panel); }
.queue__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.queue__dot.is-demand { background: var(--cyan); box-shadow: 0 0 8px rgba(67, 223, 255, .6); }
.queue__dot.is-supply { background: var(--amber); box-shadow: 0 0 8px rgba(245, 165, 36, .6); }
.queue__market { font-size: 13px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue__status {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
}
.queue__status.is-new { color: var(--space); background: var(--amber); border-color: var(--amber); }
.queue__status.is-analyzing { color: var(--cyan); border-color: rgba(67, 223, 255, .45); }
.queue__meta { grid-column: 2 / -1; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.queue__acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px 34px; }
.queue__acts .btn { min-height: 28px; padding: 3px 9px; font-size: 11px; }
.queue__acts .queue__x { color: var(--muted); }
.queue__n.is-zero { color: var(--muted); background: var(--panel-2); }
.queue__empty { margin: 0; padding: 0 14px 12px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.queue__empty .gate__link { font-size: 12px; }

/* Members' sidebar: the Telegram card stacks (text above, a compact button below). */
.side > .tg { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
.side > .tg .tg__text { font-size: 12px; }
.side > .tg .btn { width: 100%; min-height: 34px; padding: 6px 12px; font-size: 12px; }

/* ── Open community: $ markets, filter, translations, NODOs in the chat ── */
.chat__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.chat__hint { color: var(--muted-2); flex: 1; min-width: 0; }
.chat__filter { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: rgba(67, 223, 255, .1); border: 1px solid rgba(67, 223, 255, .35); }
.chat__filter-tag { color: var(--cyan); font-weight: 600; font-family: var(--code, var(--mono)); }
.chat__filter-name { color: var(--muted); }
.chat__filter-x { width: 20px; height: 20px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.chat__filter-x:hover { color: var(--white); background: rgba(255, 255, 255, .06); }
.chat__chart, .chat__lang { border: 1px solid var(--line-2); background: none; color: var(--muted); border-radius: 999px; padding: 4px 10px; font: inherit; cursor: pointer; }
.chat__chart:hover, .chat__lang:hover { color: var(--white); border-color: var(--muted-2); }
.chat__lang { margin-left: auto; }
.chat__tag { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--cyan); cursor: pointer; }
.chat__tag:hover { text-decoration: underline; }
.chat__tr { display: block; margin-top: 3px; border: 0; background: none; padding: 0; font-size: 11px; color: var(--muted-2); cursor: pointer; }
.chat__tr:hover { color: var(--muted); }
.chat__compose { position: relative; }
.chat__suggest {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; list-style: none; margin: 0; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}
.chat__suggest[hidden] { display: none; }
.chat__opt { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.chat__opt strong { color: var(--cyan); min-width: 78px; }
.chat__opt span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__opt.is-on, .chat__opt:hover { background: rgba(67, 223, 255, .08); }
.chat__event {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 6px 0; padding: 9px 12px; text-align: left;
  border: 1px solid rgba(67, 223, 255, .3); border-radius: 10px; background: rgba(67, 223, 255, .05); color: var(--white); font: inherit; font-size: 12.5px; cursor: pointer;
}
.chat__event--supply { border-color: rgba(245, 165, 36, .35); background: rgba(245, 165, 36, .05); }
.chat__event-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); flex: none; }
.chat__event--supply .chat__event-dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.chat__event-text { flex: 1; min-width: 0; color: var(--muted); }
.chat__event-text strong { color: var(--white); font-weight: 600; }
.chat__event-go { color: var(--cyan); font-size: 12px; }
.chat__event--supply .chat__event-go { color: var(--amber); }

/* Markets set aside lately: one tap brings them back to pending analysis. */
.queue__aside { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px 12px; border-top: 1px solid var(--line); }
.queue__aside-label { font-size: 11px; color: var(--muted-2); margin-right: 2px; }
.queue__restore { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.queue__restore:hover { color: var(--white); border-color: var(--muted-2); }
.queue__restore-ic { color: var(--cyan); }

/* Shown by entry-flag.js when the page has not opened after 15 s. */
.stuck {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 24px; background: #080c14; color: #e8edf5; text-align: center;
  font: 16px/1.4 system-ui, -apple-system, sans-serif;
}

/* ----- admin: the sketch (the Sketch button stays lit while it is open) ----- */
#levelsBtn[aria-pressed="true"] { border-color: rgb(67, 223, 255); color: rgb(67, 223, 255); }

.agents-desk__market { margin: 14px 0 4px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #8aa); }

/* The price chart fills .chart__price; a pane the page adds can take the bottom. */
.chart { --pane-h: 0px; }
.chart__price { position: absolute; inset: 0 0 var(--pane-h) 0; }
