/* ============================================================================
   Voxed — calm, minimal trading dashboard.
   Inspiration: fomo.family / Linear / Apple. Matte surfaces, 20px cards,
   1px hairlines, generous whitespace. No neon, no gradients, no noise.
   ========================================================================== */

:root,
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-soft: #0e1118;
  --panel: #11141b;
  --panel-2: #151922;
  --panel-hover: #181d27;
  --input: #0e1118;
  --seg-track: rgba(255, 255, 255, 0.04);
  --seg-active: rgba(255, 255, 255, 0.1);
  --topbar: rgba(11, 13, 18, 0.82);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f3f5f9;
  --text-dim: #a8afbd;
  --text-faint: #6f7787;
  --green: #3fbf7f;
  --green-soft: rgba(63, 191, 127, 0.12);
  --red: #f0616d;
  --red-soft: rgba(240, 97, 109, 0.12);
  --accent: #8a93ff;
  --accent-soft: rgba(138, 147, 255, 0.12);
  --amber: #d8a44e;
  --amber-soft: rgba(216, 164, 78, 0.12);
  --slate-soft: rgba(148, 163, 184, 0.1);
  --chart-grid: rgba(255, 255, 255, 0.045);
  --chart-baseline: rgba(255, 255, 255, 0.22);
  --tooltip: #171b23;
  --scrollbar: rgba(255, 255, 255, 0.14);
  --selection: rgba(138, 147, 255, 0.28);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.55);
  --ring: rgba(138, 147, 255, 0.4);
  --candle-up: #3fbf7f;
  --candle-down: #f0616d;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-soft: #f1f3f6;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --panel-hover: #f4f6f9;
  --input: #ffffff;
  --seg-track: rgba(13, 17, 23, 0.05);
  --seg-active: #ffffff;
  --topbar: rgba(246, 247, 249, 0.86);
  --border: rgba(13, 17, 23, 0.07);
  --border-strong: rgba(13, 17, 23, 0.14);
  --text: #0d1117;
  --text-dim: #5b6472;
  --text-faint: #8a93a1;
  --green: #12855a;
  --green-soft: rgba(18, 133, 90, 0.08);
  --red: #c6414e;
  --red-soft: rgba(198, 65, 78, 0.08);
  --accent: #4e56c8;
  --accent-soft: rgba(78, 86, 200, 0.08);
  --amber: #8a5a12;
  --amber-soft: rgba(138, 90, 18, 0.08);
  --slate-soft: rgba(13, 17, 23, 0.05);
  --chart-grid: rgba(13, 17, 23, 0.05);
  --chart-baseline: rgba(13, 17, 23, 0.2);
  --tooltip: #ffffff;
  --scrollbar: rgba(13, 17, 23, 0.18);
  --selection: rgba(78, 86, 200, 0.16);
  --shadow-pop: 0 24px 60px rgba(13, 17, 23, 0.14);
  --ring: rgba(78, 86, 200, 0.28);
  --candle-up: #0f9d6a;
  --candle-down: #d9414f;
}

html[data-mode='chill'] {
  --accent: #4e8fc4;
}
html[data-mode='balanced'] {
  --accent: #7c86f8;
}
html[data-mode='rush'] {
  --accent: #cf7a45;
}
html[data-mode='brutal'] {
  --accent: #d95f4c;
}

:root {
  --radius-card: 20px;
  --radius-tile: 18px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(13, 17, 23, 0.04);
  --shadow-soft: 0 8px 24px rgba(13, 17, 23, 0.06);
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
}

body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.sheet-open {
  overflow: hidden;
}

::selection {
  background: var(--selection);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

code,
.mono {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 0.92em;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

.flat {
  color: var(--text-dim);
}

.faint {
  color: var(--text-faint);
}

.warn {
  color: var(--amber);
}

/* ---------- shell ---------- */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 32px;
}

body[data-auth='locked'] .app {
  filter: blur(10px) saturate(0.6);
  pointer-events: none;
  user-select: none;
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  width: min(100% - 48px, 1232px);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--text-dim);
}

.demo-banner b {
  color: var(--text);
  font-weight: 600;
}

.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.demo-banner-copy {
  flex: 1;
  min-width: 0;
}

.demo-login {
  padding: 6px 12px;
  font-size: 12px;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  width: min(100% - 48px, 1232px);
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Logo sits flush: no background, border or padding around the SVG — the icon
   paints its own rounded tile, so the wrapper only reserves the box. */
.brand-mark {
  display: block;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  line-height: 0;
  overflow: visible;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.feed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.2s ease;
}

.feed-dot[data-state='live'] {
  background: var(--green);
}
.feed-dot[data-state='polling'] {
  background: var(--amber);
}
.feed-dot[data-state='offline'] {
  background: var(--red);
}
.feed-dot[data-state='static'] {
  background: var(--text-dim);
}

/* segmented controls (modes, chart, filters) */

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--seg-track);
  border: 1px solid var(--border);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented button:hover:not(.active):not(:disabled) {
  color: var(--text);
}

.segmented button.active {
  background: var(--seg-active);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

[data-theme='dark'] .segmented button.active {
  background: rgba(255, 255, 255, 0.12);
}

.mode-switch button.active {
  color: var(--text);
}

html[data-mode='chill'] .mode-switch [data-trading-mode='CHILL'],
html[data-mode='balanced'] .mode-switch [data-trading-mode='BALANCED'],
html[data-mode='rush'] .mode-switch [data-trading-mode='RUSH'],
html[data-mode='brutal'] .mode-switch [data-trading-mode='BRUTAL'] {
  color: var(--text);
  background: var(--seg-active);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding-right: 6px;
}

.balance-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.balance-delta {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--slate-soft);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.balance-delta.pos {
  background: var(--green-soft);
  color: var(--green);
}

.balance-delta.neg {
  background: var(--red-soft);
  color: var(--red);
}

.settle-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  transform: translateY(-1px);
}

.settle-badge[data-mode='LIVE'] {
  color: var(--red);
  border-color: var(--red);
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--border-strong);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--text);
  opacity: 0.88;
}

.btn-danger {
  color: var(--red);
  border-color: var(--border);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--red);
}

.btn-mini {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-start {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn-start:hover:not(:disabled) {
  background: var(--text);
  opacity: 0.88;
}

.bot-toggle {
  display: flex;
}

.bot-toggle .btn {
  border-radius: 0;
}

.bot-toggle .btn:first-child {
  border-radius: var(--radius-btn) 0 0 var(--radius-btn);
}

.bot-toggle .btn:last-child {
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
  border-left: 0;
}

.bot-toggle[data-running='true'] #btn-start {
  display: none;
}

.bot-toggle[data-running='false'] #btn-stop {
  display: none;
}

.bot-toggle[data-running='true'] .btn,
.bot-toggle[data-running='false'] .btn {
  border-radius: var(--radius-btn);
}

.bot-toggle[data-paused='true'] #btn-stop {
  color: var(--amber);
  border-color: var(--amber);
}

.bot-toggle[data-paused='true'] #btn-stop svg {
  fill: var(--amber);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  transition: color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--panel-hover);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:disabled {
  opacity: 0.35;
}

#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
  display: none;
}

[data-theme='light'] #theme-toggle .icon-moon {
  display: block;
}

[data-theme='dark'] #theme-toggle .icon-sun {
  display: block;
}

.link-btn {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 4px 2px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.link-btn:hover {
  color: var(--text);
}

/* account */

.account {
  position: relative;
}

.avatar-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
}

.avatar {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--slate-soft);
  color: var(--text-dim);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar svg {
  width: 58%;
  height: 58%;
}

.avatar--preset-1 {
  background: rgba(138, 147, 255, 0.18);
  color: #aab1ff;
}
.avatar--preset-2 {
  background: rgba(63, 191, 127, 0.18);
  color: #74d3a3;
}
.avatar--preset-3 {
  background: rgba(216, 164, 78, 0.18);
  color: #e3bb7a;
}
.avatar--preset-4 {
  background: rgba(240, 97, 109, 0.18);
  color: #f4919a;
}
.avatar--preset-5 {
  background: rgba(96, 165, 250, 0.18);
  color: #93c2fb;
}
.avatar--preset-6 {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b0fc;
}
.avatar--preset-7 {
  background: rgba(45, 212, 191, 0.18);
  color: #7ce4d8;
}
.avatar--preset-8 {
  background: rgba(148, 163, 184, 0.18);
  color: #b6c1d2;
}

html[data-theme='light'] .avatar--preset-1 {
  background: #e6e8ff;
  color: #3f46a8;
}
html[data-theme='light'] .avatar--preset-2 {
  background: #e2f6ec;
  color: #126340;
}
html[data-theme='light'] .avatar--preset-3 {
  background: #fbf0dc;
  color: #8a5a12;
}
html[data-theme='light'] .avatar--preset-4 {
  background: #fde7e9;
  color: #a32c38;
}
html[data-theme='light'] .avatar--preset-5 {
  background: #e5f0fe;
  color: #1f5fa8;
}
html[data-theme='light'] .avatar--preset-6 {
  background: #efe9fe;
  color: #5b3fae;
}
html[data-theme='light'] .avatar--preset-7 {
  background: #def8f4;
  color: #0f6b62;
}
html[data-theme='light'] .avatar--preset-8 {
  background: #eef1f5;
  color: #4a5262;
}

.avatar--sm {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 16px;
  border-radius: 16px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-pop);
  z-index: 60;
}

.account-menu-head {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.account-menu-head b {
  font-size: 13px;
  font-weight: 600;
}

.account-menu-head span {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.menu-item:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.menu-item.active {
  color: var(--text);
}

/* ---------- agent pills ---------- */

.agent-strip {
  width: min(100% - 48px, 1232px);
  margin: 14px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12px;
  color: var(--text-dim);
}

.agent-name {
  font-weight: 500;
  color: var(--text-dim);
}

.agent-result {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: 0 0 auto;
}

.agent-pill[data-phase='working'] .agent-dot {
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.agent-pill[data-phase='ok'] .agent-dot {
  background: var(--green);
}

.agent-pill[data-phase='error'] .agent-dot {
  background: var(--red);
}

.agent-pill[data-phase='rate_limited'] .agent-dot {
  background: var(--amber);
}

.agent-pill[data-tone='pos'] .agent-result {
  color: var(--green);
}

.agent-pill[data-tone='neg'] .agent-result {
  color: var(--red);
}

.agent-pill[data-tone='warn'] .agent-result {
  color: var(--amber);
}

.agent-pill[data-phase='working'] .agent-result {
  color: var(--text-dim);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ---------- layout ---------- */

main {
  width: min(100% - 48px, 1232px);
  margin: 18px auto 0;
  flex: 1;
}

.card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.card + .card {
  margin-top: 14px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.card-head-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.card-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.card-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.card-meta {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-head-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 14px;
  align-items: start;
}

.dash-main,
.dash-side {
  min-width: 0;
}

.dash-side .card + .card,
.dash-main .card + .card {
  margin-top: 14px;
}

/* chart */

.chart-card .card-head {
  margin-bottom: 6px;
}

.chart-body {
  position: relative;
  height: 300px;
  margin: 8px -6px 2px;
}

.chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-faint);
}

.chart-range {
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.metric-label {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.metric-value {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.card-foot-note {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* positions tiles */

.positions-card .card-head {
  margin-bottom: 12px;
}

.position-tiles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile-empty {
  padding: 22px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-tile);
}

.position-tile {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  background: var(--panel-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.position-tile:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

.tile-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.tile-symbol {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tile-name {
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-pnl {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.tile-pnl b {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tile-pnl span {
  font-size: 12.5px;
  font-weight: 500;
}

.tile-entry {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.tile-entry b {
  color: var(--text-dim);
  font-weight: 500;
}

.tile-actions {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.tile-btn {
  flex: 1;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tile-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--panel);
}

.tile-btn--sell:hover {
  color: var(--red);
  border-color: var(--red);
}

/* view bars (secondary tabs) */

.viewbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.viewbar-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.viewbar-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.segmented--quiet button {
  padding: 5px 11px;
  font-size: 12px;
}

.access-link--telegram .access-link-icon {
  background: rgba(96, 165, 250, 0.16);
  color: #6aa8f0;
}

.access-link--discord .access-link-icon {
  background: rgba(138, 147, 255, 0.16);
  color: #9aa2ff;
}

.footer-dot {
  color: var(--border-strong);
}

.profile-meta-sep {
  color: var(--text-faint);
}

.risk-col {
  min-width: 140px;
}

.age-col,
.conf-col,
.ms-col,
.vol-col {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .mint-col,
  .ms-col,
  .conf-col,
  .vol-col {
    display: none;
  }
}

/* ---------- tables ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0 -4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th.num {
  text-align: right;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: var(--panel-hover);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .reason {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.empty-row td {
  padding: 24px 10px;
  text-align: center;
  color: var(--text-faint);
}

.act {
  width: 40px;
  text-align: right;
}

.btn-sell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11.5px;
}

.btn-sell svg {
  width: 13px;
  height: 13px;
}

.btn-sell:hover:not(:disabled) {
  color: var(--red);
  border-color: var(--red);
}

/* token cell / tags / pills */

.token-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.token-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--slate-soft);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  flex: 0 0 auto;
}

.av-0 {
  background: rgba(138, 147, 255, 0.14);
}
.av-1 {
  background: rgba(63, 191, 127, 0.14);
}
.av-2 {
  background: rgba(216, 164, 78, 0.14);
}
.av-3 {
  background: rgba(240, 97, 109, 0.14);
}
.av-4 {
  background: rgba(96, 165, 250, 0.14);
}
.av-5 {
  background: rgba(167, 139, 250, 0.14);
}

.token-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.token-symbol {
  font-weight: 500;
}

.token-name {
  font-size: 11px;
  color: var(--text-faint);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--slate-soft);
  color: var(--text-dim);
  white-space: nowrap;
}

.tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.tag-buy {
  background: var(--green-soft);
  color: var(--green);
}

.tag-skip {
  background: var(--slate-soft);
  color: var(--text-dim);
}

.tag-reject {
  background: var(--red-soft);
  color: var(--red);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill-arrow {
  font-size: 8px;
}

.pill-up {
  color: var(--green);
  background: var(--green-soft);
}

.pill-down {
  color: var(--red);
  background: var(--red-soft);
}

.pill-neutral {
  color: var(--text-dim);
  background: var(--slate-soft);
}

.score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-max {
  font-size: 10px;
  color: var(--text-faint);
}

/* risk meter */

.risk-cell {
  min-width: 130px;
}

.risk-bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--slate-soft);
  margin: 6px 0 5px;
}

.risk-entry {
  position: absolute;
  top: -2px;
  width: 1px;
  height: 8px;
  background: var(--text-faint);
}

.risk-fill {
  position: absolute;
  top: 0;
  height: 4px;
  border-radius: 2px;
}

.risk-fill.pos {
  background: var(--green);
}

.risk-fill.neg {
  background: var(--red);
}

.risk-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 8px;
  border-radius: 1px;
  transform: translateX(-1px);
}

.risk-marker.pos {
  background: var(--green);
}

.risk-marker.neg {
  background: var(--red);
}

.risk-labels {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.risk-labels .armed {
  color: var(--green);
}

.trail-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
}

/* logs */

.log-card .card-head {
  margin-bottom: 8px;
}

.log {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  padding-right: 4px;
}

.log-line {
  display: grid;
  grid-template-columns: 58px 46px 64px minmax(0, 1fr);
  gap: 8px;
  padding: 2px 4px;
  border-radius: 6px;
}

.log-line:hover {
  background: var(--panel-hover);
}

.log-time {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.log-level {
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 1px;
}

.log-level.trade {
  color: var(--accent);
}

.log-level.warn {
  color: var(--amber);
}

.log-level.error {
  color: var(--red);
}

.log-scope {
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-msg {
  color: var(--text-dim);
  word-break: break-word;
}

.log-line[data-level='trade'] .log-msg {
  color: var(--text);
}

/* ---------- config / forms ---------- */

.config-grid {
  display: grid;
  gap: 14px;
}

.card + .config-grid,
.config-grid + .card,
.config-grid + .config-grid {
  margin-top: 14px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field > span em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 400;
}

.field > span code {
  font-size: 10px;
  color: var(--text-faint);
  background: var(--slate-soft);
  padding: 1px 5px;
  border-radius: 5px;
}

.field input,
.field select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--border-strong);
}

.field input::placeholder {
  color: var(--text-faint);
}

.field input[type='range'] {
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--text);
}

.field-inline {
  max-width: 280px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.form-note {
  font-size: 11.5px;
  color: var(--text-faint);
}

.form-note[data-state='custom'] {
  color: var(--amber);
}

.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}

.field-note {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.65;
}

.panel-actions {
  margin-top: 12px;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1;
}

.pin-input {
  letter-spacing: 0.35em;
}

.pin-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pin-block-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pin-block-head b {
  font-size: 13px;
  font-weight: 600;
}

.pin-block-head span {
  font-size: 11.5px;
  color: var(--text-faint);
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--text);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.profile-identity b {
  font-size: 16px;
  font-weight: 600;
}

.profile-identity > span {
  font-size: 12px;
  color: var(--text-dim);
}

.profile-meta-line {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
}

.profile-pin-notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-option {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--panel-2);
  padding: 0;
}

.avatar-option.active {
  border-color: var(--text);
}

.avatar-option .avatar {
  border-radius: 0;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.wallet-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  min-width: 0;
}

.wallet-stat span {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.wallet-stat b {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-reason {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}

.wallet-status {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--slate-soft);
  color: var(--text-dim);
}

.wallet-status[data-state='live'] {
  background: var(--red-soft);
  color: var(--red);
}

.wallet-status[data-state='ready'] {
  background: var(--green-soft);
  color: var(--green);
}

.config-save-card {
  padding: 18px 22px;
}

.config-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.config-save-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.config-save-copy b {
  font-size: 14px;
  font-weight: 600;
}

.config-save-copy span {
  font-size: 12px;
  color: var(--text-faint);
}

.kv {
  display: grid;
  gap: 0;
}

.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row > span,
.kv-key {
  color: var(--text-faint);
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kv-row > b,
.kv-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
}

/* modes table */

.modes-table .mode-col {
  text-align: left;
}

.modes-table .mode-col.active {
  background: var(--panel-2);
}

.mode-col-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.mode-col-name.active {
  color: var(--text);
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}

html[data-mode='chill'] .mode-col-name[data-mode='CHILL'] .mode-dot,
html[data-mode='balanced'] .mode-col-name[data-mode='BALANCED'] .mode-dot,
html[data-mode='rush'] .mode-col-name[data-mode='RUSH'] .mode-dot,
html[data-mode='brutal'] .mode-col-name[data-mode='BRUTAL'] .mode-dot {
  background: var(--accent);
}

.mode-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* admin */

.admin-create {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-2);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-create-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.admin-create-head b {
  font-size: 13px;
  font-weight: 600;
}

.admin-create-head span {
  font-size: 11.5px;
  color: var(--text-faint);
}

.admin-creds {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  margin-bottom: 16px;
  background: var(--panel-2);
}

.admin-creds-warn {
  font-size: 12px;
  color: var(--amber);
}

.admin-creds-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.admin-creds-row > span {
  width: 64px;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-creds-row code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.admin-user-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.admin-user-copy b {
  font-weight: 500;
}

.admin-user-copy span {
  font-size: 11px;
  color: var(--text-faint);
}

.admin-expiry {
  font-size: 12px;
}

.admin-expiry b {
  display: block;
  font-weight: 500;
}

.admin-expiry span {
  font-size: 10.5px;
  color: var(--text-faint);
}

.role-pill,
.status-pill,
.run-pill,
.wallet-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--slate-soft);
  color: var(--text-dim);
  white-space: nowrap;
}

.role-pill[data-role='admin'] {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill[data-status='active'] {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill[data-status='suspended'] {
  background: var(--red-soft);
  color: var(--red);
}

.run-pill[data-running='true'] {
  background: var(--green-soft);
  color: var(--green);
}

.wallet-pill[data-wallet='live'] {
  background: var(--red-soft);
  color: var(--red);
}

.wallet-pill[data-wallet='paper'] {
  background: var(--slate-soft);
  color: var(--text-dim);
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.admin-actions button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.admin-actions button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.modal-summary-row {
  font-size: 12px;
  color: var(--text-dim);
}

.avatar--img img,
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.admin-table .row-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.admin-table .row-actions button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11px;
  color: var(--text-dim);
}

.admin-table .row-actions button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.admin-table .row-actions button[data-admin-action='suspend'],
.admin-table .row-actions button[data-admin-action='delete'] {
  color: var(--red);
}

/* ---------- footer ---------- */

.footer {
  width: min(100% - 48px, 1232px);
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.footer-spacer {
  flex: 1;
}

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.55);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(100%, 440px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-pop);
}

.modal-card--onboarding {
  width: min(100%, 520px);
}

.modal-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-lead {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 6px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.modal-summary {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.modal-error {
  min-height: 16px;
  font-size: 12px;
  color: var(--red);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.modal-form .field {
  margin-bottom: 0;
}

.risk-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
}

.risk-check input {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: var(--red);
}

/* ---------- position drawer ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  justify-content: flex-end;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.45);
  backdrop-filter: blur(3px);
}

.sheet-card {
  position: relative;
  width: min(100%, 430px);
  height: 100%;
  overflow-y: auto;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 22px;
  animation: sheet-in 0.22s cubic-bezier(0.22, 0.8, 0.3, 1);
}

@keyframes sheet-in {
  from {
    transform: translateX(24px);
    opacity: 0.4;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.sheet-head-copy {
  min-width: 0;
}

.sheet-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.sheet-sub {
  font-size: 12px;
  color: var(--text-faint);
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-2);
}

.detail-pnl {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.detail-pnl b {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.detail-pnl span {
  font-size: 13px;
  font-weight: 500;
}

.detail-hero-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
}

.detail-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

.detail-block h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--text-faint);
}

.detail-row b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.detail-quote {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.detail-quote span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.detail-quote p {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
}

.detail-muted {
  font-size: 12.5px;
  color: var(--text-faint);
}

.detail-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.detail-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  min-width: 0;
}

.detail-time {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.detail-reason {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-actions {
  display: flex;
  gap: 9px;
  padding-top: 4px;
}

.detail-actions .btn {
  flex: 1;
}

/* ---------- toasts ---------- */

.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.18s ease;
}

.toast.warn {
  background: var(--amber);
  color: #fff;
}

.toast.bad {
  background: var(--red);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- lock screen ---------- */

body[data-auth='locked'] {
  overflow: hidden;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  overflow-y: auto;
  background: var(--bg);
}

body[data-auth='locked'] .lock-screen {
  display: flex;
}

.lock-glow {
  display: none;
}

.lock-card {
  width: min(100%, 400px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-pop);
}

.lock-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}

.lock-brand .brand-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.lock-brand .brand-mark svg {
  width: 48px;
  height: 48px;
}

.lock-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.lock-name {
  font-size: 14px;
  font-weight: 600;
}

.lock-eyebrow {
  font-size: 11px;
  color: var(--text-faint);
}

.lock-title {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lock-lead {
  margin-top: 7px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.lock-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  position: relative;
}

.lock-field > span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  display: flex;
  gap: 6px;
  align-items: center;
}

.lock-field > span em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 400;
}

.lock-field input {
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.lock-field input:focus {
  border-color: var(--border-strong);
}

.lock-pin {
  letter-spacing: 0.4em;
  padding-right: 82px !important;
}

.lock-pin-dots {
  position: absolute;
  right: 14px;
  bottom: 20px;
  display: flex;
  gap: 4px;
}

.lock-pin-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.lock-pin-dots i.on {
  background: var(--text);
}

.lock-error {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--red);
}

.lock-submit {
  width: 100%;
  height: 44px;
  margin-top: 4px;
}

.lock-submit[data-busy='true'] .lock-submit-label {
  opacity: 0.6;
}

.lock-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.lock-submit[data-busy='true'] .lock-spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.lock-meta {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.55;
  text-align: center;
}

.lock-access {
  margin-top: 20px;
}

.lock-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-faint);
}

.lock-divider::before,
.lock-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.lock-access-lead {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

.lock-access-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lock-access-btn,
.lock-demo-btn {
  width: 100%;
  height: 40px;
}

.lock-access-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.55;
}

/* access modal (Telegram / Discord) */

.access-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.access-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.5);
  backdrop-filter: blur(4px);
}

.access-dialog {
  position: relative;
  width: min(100%, 420px);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-pop);
}

.access-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
}

.access-close:hover {
  color: var(--text);
  background: var(--panel-hover);
}

.access-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.access-title {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.access-lead {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.access-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
}

.access-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  transition: border-color 0.15s ease;
}

.access-link:hover {
  border-color: var(--border-strong);
}

.access-link-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--slate-soft);
  color: var(--text-dim);
}

.access-link-icon svg {
  width: 18px;
  height: 18px;
}

.access-link-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.access-link-copy b {
  font-size: 13px;
  font-weight: 600;
}

.access-link-copy span {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-link-arrow {
  margin-left: auto;
  color: var(--text-faint);
}

.access-note {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.55;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .dash-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 10px 0;
  }

  .mode-switch {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mode-switch::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .balance-value {
    font-size: 18px;
  }

  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-body {
    height: 230px;
  }

  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-value {
    font-size: 14.5px;
  }
}

@media (max-width: 620px) {
  .topbar-inner,
  .agent-strip,
  main,
  .footer,
  .demo-banner {
    width: calc(100% - 32px);
  }

  .brand-name {
    font-size: 14px;
  }

  .balance-delta {
    display: none;
  }

  .settle-badge {
    display: none;
  }

  .card {
    padding: 17px;
    border-radius: 18px;
  }

  .card-value {
    font-size: 25px;
  }

  .metric-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .metric {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .metric-label {
    font-size: 12px;
  }

  .metric-sub {
    display: none;
  }

  .chart-body {
    height: 200px;
  }

  .toast-stack {
    bottom: 14px;
    width: calc(100% - 32px);
  }

  .sheet-card {
    width: 100%;
    border-left: 0;
  }

  .detail-hero {
    flex-wrap: wrap;
  }

  .detail-hero-meta {
    margin-left: 0;
  }

  .lock-card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* ==========================================================================
   Legal surfaces — Regulamin / Risk Disclaimer / Polityka Prywatności.
   Deliberately hard-coded dark minimal palette (#0a0b0d / #111318 / #1f242d /
   #10b981) so the acceptance gate keeps the same look in both UI themes.
   ========================================================================== */

.modal-card--legal,
.rules-page {
  --legal-bg: #0a0b0d;
  --legal-card: #111318;
  --legal-border: #1f242d;
  --legal-text: #f3f4f6;
  --legal-dim: #9ca3af;
  --legal-faint: #6b7280;
  --legal-accent: #10b981;
}

.modal-card--legal {
  width: min(100%, 760px);
  max-height: calc(100vh - 36px);
  padding: 24px 26px;
  border-radius: 18px;
  border-color: var(--legal-border);
  background: var(--legal-card);
  color: var(--legal-text);
}

.modal-card--legal .modal-eyebrow {
  color: var(--legal-faint);
}

.modal-card--legal .modal-title {
  color: var(--legal-text);
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.modal-card--legal .modal-lead {
  color: var(--legal-dim);
  font-size: 12.5px;
}

.legal-scroll {
  margin-top: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--legal-border);
  border-radius: 12px;
  background: var(--legal-bg);
  color: var(--legal-dim);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #2a313d transparent;
}

.legal-scroll:focus-visible {
  outline: 1px solid rgba(16, 185, 129, 0.5);
  outline-offset: 1px;
}

.legal-scroll::-webkit-scrollbar {
  width: 8px;
}

.legal-scroll::-webkit-scrollbar-thumb {
  background: #2a313d;
  border-radius: 999px;
}

.legal-section + .legal-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--legal-border);
}

.legal-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.legal-section-number {
  flex: none;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--legal-accent);
}

.legal-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--legal-text);
}

.legal-paragraph {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--legal-dim);
}

.legal-intro {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--legal-border);
}

.legal-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--legal-dim);
}

.legal-list li {
  margin-bottom: 5px;
}

.legal-list li::marker {
  color: var(--legal-accent);
}

.legal-subtitle {
  margin: 12px 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--legal-text);
}

.legal-scroll-end {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px dashed var(--legal-border);
  border-radius: 8px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--legal-faint);
}

.legal-end {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--legal-border);
  font-size: 11px;
  line-height: 1.65;
  color: var(--legal-faint);
}

.legal-scroll-hint {
  margin: 9px 0 2px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--legal-dim);
}

.legal-scroll-hint[data-ready='true'] {
  color: var(--legal-accent);
}

.legal-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--legal-border);
  border-radius: 10px;
  background: var(--legal-bg);
  color: #d1d5db;
  font-size: 12.5px;
  line-height: 1.55;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.legal-check:hover {
  border-color: #2a313d;
}

.legal-check:has(input:checked) {
  border-color: rgba(16, 185, 129, 0.45);
}

.legal-check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--legal-accent);
}

.btn-legal-accept {
  background: var(--legal-accent);
  border-color: var(--legal-accent);
  color: #04110c;
  font-weight: 600;
}

.btn-legal-accept:hover:not(:disabled) {
  background: #0ea371;
  border-color: #0ea371;
  opacity: 1;
}

.btn-legal-accept:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-legal-link {
  background: var(--legal-card);
  border-color: var(--legal-border);
  color: var(--legal-text);
  text-decoration: none;
}

.btn-legal-link:hover {
  background: #161a21;
  border-color: #2a313d;
}

.legal-meta {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--legal-faint);
}

.lock-legal {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
}

.lock-legal a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lock-legal a:hover {
  color: var(--accent);
}

.footer-link {
  color: var(--text-faint);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- public /rules page ---------- */

body.rules-page {
  min-height: 100vh;
  margin: 0;
  background: var(--legal-bg);
  color: var(--legal-text);
}

.rules-shell {
  width: min(100% - 40px, 900px);
  margin: 0 auto;
  padding: 26px 0 44px;
}

.rules-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--legal-border);
}

.rules-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--legal-text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.rules-brand-mark {
  display: block;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  line-height: 0;
  overflow: visible;
}

.rules-brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.rules-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rules-brand-copy small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--legal-faint);
}

.rules-back {
  background: var(--legal-card);
  border-color: var(--legal-border);
  color: var(--legal-text);
  text-decoration: none;
}

.rules-back:hover {
  background: #161a21;
  border-color: #2a313d;
}

.rules-main {
  margin-top: 30px;
  padding: 30px;
  border: 1px solid var(--legal-border);
  border-radius: 18px;
  background: var(--legal-card);
}

.rules-eyebrow {
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--legal-accent);
}

.rules-title {
  margin: 10px 0 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--legal-text);
}

.rules-lead {
  max-width: 72ch;
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--legal-dim);
}

.rules-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--legal-faint);
}

.rules-meta strong {
  color: var(--legal-dim);
  font-weight: 500;
}

.legal-document {
  margin-top: 28px;
}

.legal-document .legal-paragraph {
  font-size: 13.5px;
  line-height: 1.75;
}

.legal-document .legal-list {
  font-size: 13.5px;
  line-height: 1.75;
}

.legal-document .legal-section + .legal-section {
  margin-top: 24px;
  padding-top: 24px;
}

.legal-document .legal-section-title {
  font-size: 17px;
}

.legal-document .legal-section-number {
  font-size: 12px;
}

.rules-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--legal-border);
}

.rules-actions .btn {
  text-decoration: none;
}

.rules-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 20px;
  font-size: 11px;
  color: var(--legal-faint);
}

@media (max-width: 620px) {
  .modal-card--legal {
    padding: 18px;
    border-radius: 16px;
  }

  .legal-scroll {
    max-height: 360px;
    padding: 13px;
  }

  .rules-shell {
    width: min(100% - 24px, 900px);
    padding-top: 18px;
  }

  .rules-main {
    padding: 18px;
    border-radius: 15px;
  }

  .footer {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   i18n · language switcher
   ========================================================================== */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--seg-track);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(13, 17, 23, 0.16);
}

.lang-switch-slot {
  display: flex;
  align-items: center;
}

.lang-field {
  max-width: 260px;
}

.lock-lang {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 320;
}

body[data-auth='unlocked'] .lock-lang,
body[data-auth='demo'] .lock-lang {
  display: none;
}

.demo-lang {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.rules-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--seg-track);
}

.rules-lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.rules-lang button.active,
.rules-lang button[aria-pressed='true'] {
  background: var(--panel);
  color: var(--text);
}

/* ==========================================================================
   System banner (admin announcement)
   ========================================================================== */

.system-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: center;
}

.system-banner-text {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.system-banner-meta {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.system-banner-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.system-banner[data-level='warning'] {
  background: var(--amber-soft);
}
.system-banner[data-level='warning'] .system-banner-dot {
  background: var(--amber);
}
.system-banner[data-level='urgent'] {
  background: var(--red-soft);
}
.system-banner[data-level='urgent'] .system-banner-dot {
  background: var(--red);
  animation: banner-pulse 1.6s ease-out infinite;
}
.system-banner[data-level='success'] {
  background: var(--green-soft);
}
.system-banner[data-level='success'] .system-banner-dot {
  background: var(--green);
}

@keyframes banner-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 97, 109, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(240, 97, 109, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(240, 97, 109, 0);
  }
}

/* ==========================================================================
   Public demo: scanner badge + last AI decisions
   ========================================================================== */

.demo-preview-card {
  padding-bottom: 14px;
}

.demo-scanner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.demo-scanner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.demo-scanner[data-state='on'] {
  color: var(--green);
}

.demo-scanner[data-state='on'] .demo-scanner-dot {
  animation: scanner-pulse 1.8s ease-out infinite;
}

@keyframes scanner-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 191, 127, 0.45);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(63, 191, 127, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(63, 191, 127, 0);
  }
}

.demo-decisions {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.demo-decision {
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.demo-decision:first-child {
  border-top: 0;
  padding-top: 0;
}

.demo-decision-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.demo-decision-head b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.demo-decision[data-outcome='buy'] .demo-decision-head b {
  color: var(--green);
}

.demo-decision-time {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  color: var(--text-faint);
}

.demo-decision-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0 4px;
}

.demo-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--seg-track);
  color: var(--text-dim);
  font-size: 10.5px;
}

.demo-chip i {
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.demo-decision-reason {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.demo-preview-empty {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-faint);
}

.demo-preview-cta {
  display: flex;
  margin-top: 14px;
}

.demo-preview-cta .btn {
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   Demo sign-up invite
   ========================================================================== */

.modal-card--nudge {
  width: min(100%, 430px);
}

.nudge-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 4px;
}

.nudge-point {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  text-align: center;
}

.nudge-point b {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nudge-point span {
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--text-faint);
}

/* ==========================================================================
   Users tab: banner builder + public demo account
   ========================================================================== */

.admin-system-card {
  margin-bottom: 18px;
}

.banner-builder {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.banner-builder .banner-text-field {
  grid-column: span 1;
}

.banner-builder .banner-actions {
  grid-column: 1 / -1;
}

#banner-count {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: var(--text-faint);
}

#banner-text[data-state='over'] {
  border-color: var(--red);
}

#banner-text[data-state='ok'] + #banner-count,
#banner-count[data-state='ok'] {
  color: var(--green);
}

#banner-status[data-state='info'] {
  color: var(--accent);
}
#banner-status[data-state='warning'] {
  color: var(--amber);
}
#banner-status[data-state='urgent'] {
  color: var(--red);
}
#banner-status[data-state='success'] {
  color: var(--green);
}

.admin-demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
}

.form-note[data-state='error'] {
  color: var(--red);
}

.form-note[data-state='ok'] {
  color: var(--green);
}

.form-note[data-state='busy'] {
  color: var(--text-faint);
}

@media (max-width: 720px) {
  .banner-builder {
    grid-template-columns: 1fr;
  }

  .lang-field {
    max-width: none;
  }

  .nudge-points {
    grid-template-columns: 1fr;
  }

  .nudge-point {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
  }
}