:root {
  /* Quiet terminal — ink + champagne gold (restrained) */
  --bg0: #05070c;
  --bg1: #0a0e14;
  --card: #0e141c;
  --line: rgba(186, 162, 118, 0.22);
  --line-cool: rgba(120, 155, 190, 0.12);
  --text: #eef1f5;
  --muted: #8b94a3;
  --accent: #c4ae7a;
  --accent-2: #e2d4b4;
  --accent-soft: rgba(186, 162, 118, 0.1);
  --gold-shine: linear-gradient(135deg, #efe4cc 0%, #d0ba88 45%, #a88c55 100%);
  --ok: #1fd98a;
  --bad: #ff2f42;
  --warn: #c9a85a;
  --radius: 0.35rem;
  --radius-lg: 0.45rem;
  --glass: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.035) 0%,
    rgba(10, 14, 20, 0.92) 50%,
    rgba(6, 9, 14, 0.97) 100%
  );
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 55% 40% at 0% 0%, rgba(45, 85, 130, 0.22), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 0%, rgba(186, 162, 118, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(140, 180, 220, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 180, 220, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 15%, transparent 72%);
}

.page {
  position: relative;
  z-index: 1;
  width: min(100% - 1.1rem, 72rem);
  margin: 0 auto;
  padding: 1rem 0.45rem 2.5rem;
}

@media (min-width: 900px) {
  .page { padding: 1.5rem 1.25rem 3rem; }
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
  padding: 0.95rem 1.1rem 1.05rem 1rem;
  border-radius: 0;
  /* clip-path clipped the market dropdown into a "ghost" under the header */
  clip-path: none;
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, #121925, #0a0f16);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.28);
  backdrop-filter: none;
  position: relative;
  overflow: visible;
  /* Must sit above hero/metrics — dropdown paints outside the header box */
  z-index: 400;
  isolation: auto;
}

.top::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(
    120deg,
    rgba(232, 210, 160, 0.5),
    rgba(196, 174, 122, 0.18) 40%,
    rgba(100, 130, 170, 0.12) 75%,
    rgba(255, 255, 255, 0.06)
  );
  padding: 1px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.top::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 8%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(196, 174, 122, 0.75),
    rgba(100, 140, 180, 0.25) 55%,
    transparent
  );
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-plate {
  flex-shrink: 0;
  padding: 3px;
  clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%);
  background: linear-gradient(
    135deg,
    rgba(232, 210, 160, 0.75),
    rgba(196, 174, 122, 0.25) 45%,
    rgba(90, 120, 160, 0.35)
  );
}

.logo {
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 0;
  clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%);
  border: 0;
  object-fit: cover;
  background: #05070c;
}

.brand-mark {
  min-width: 0;
}

.brand {
  margin: 0 0 0.12rem;
  font-family: "Orbitron", "Avenir Next", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
  color: #d4bc88;
  background: var(--gold-shine);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}

.brand-sub {
  margin: 0.28rem 0 0;
  font-size: 0.68rem;
  color: #7a7568;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3.8vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: none;
  line-height: 1.1;
}

h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: #eef1f5;
}

.brand-block {
  min-width: 0;
  flex: 1 1 auto;
}

.top-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
  padding-top: 0.15rem;
  position: relative;
  z-index: 401;
  overflow: visible;
}

.top-actions form {
  margin: 0;
  flex-shrink: 0;
}

/* FUT + Kilépés: same slant as control buttons + hero edge */
.top-actions .pill,
.top-actions .ghost.sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.42rem 1.25rem;
  margin: 0;
  border: 0;
  border-radius: 0;
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  white-space: nowrap;
}

.top-actions .pill,
.top-actions .ghost.sm {
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.12), transparent 50%),
    rgba(14, 18, 26, 0.95);
}

.top-actions .pill::before,
.top-actions .ghost.sm::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(135deg, rgba(232, 210, 160, 0.55), rgba(255,255,255,0.1));
  padding: 1px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.top-actions .pill { box-shadow: none; color: #d5dae2; }

.top-actions .pill.on {
  color: #9ff0d0;
  background:
    linear-gradient(125deg, rgba(31, 217, 138, 0.18), transparent 50%),
    rgba(10, 22, 18, 0.95);
}
.top-actions .pill.on::before {
  background: linear-gradient(135deg, rgba(110, 240, 180, 0.7), rgba(31, 217, 138, 0.25));
}
.top-actions .pill.off {
  color: #ffb0b8;
  background:
    linear-gradient(125deg, rgba(255, 47, 66, 0.16), transparent 50%),
    rgba(22, 12, 14, 0.95);
}
.top-actions .pill.off::before {
  background: linear-gradient(135deg, rgba(255, 120, 130, 0.65), rgba(255, 47, 66, 0.25));
}
.top-actions .pill.warn {
  color: #f0dfb0;
  background:
    linear-gradient(125deg, rgba(201, 168, 90, 0.16), transparent 50%),
    rgba(20, 18, 12, 0.95);
}

.top-actions .ghost.sm {
  color: #e8ecf2;
  box-shadow: none;
}
.top-actions .ghost.sm:hover {
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.2), transparent 50%),
    rgba(18, 22, 30, 0.98);
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.85rem 0.38rem 0.7rem;
  border-radius: 0;
  clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
  border: 0;
  background: rgba(255,255,255,0.05);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.28);
}

.pill.on {
  color: #9ff0d0;
  background: rgba(31, 217, 138, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(31, 217, 138, 0.55),
    0 0 16px rgba(31, 217, 138, 0.12);
}
.pill.off {
  color: #ffb0b8;
  background: rgba(255, 47, 66, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 47, 66, 0.5);
}
.pill.warn {
  color: #f0dfb0;
  background: rgba(201, 168, 90, 0.12);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.45);
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

/* —— Dramatic layout: hero + pulse + sheet (v1.6) —— */
.hero-band {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  perspective: 900px;
}
@media (min-width: 640px) {
  .hero-band { grid-template-columns: 1fr 1fr; gap: 1rem; }
}
.hero-cell {
  position: relative;
  padding: 1.25rem 1.35rem 1.3rem 1.45rem;
  /* BMW-ish facet: not a rectangle */
  clip-path: polygon(0 0, 100% 0, 100% 78%, 94% 100%, 0 100%);
  border-radius: 0;
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.16) 0%, transparent 38%),
    linear-gradient(180deg, #121925 0%, #0a0f16 100%);
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 7.6rem;
  isolation: isolate;
}
.hero-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(
    135deg,
    rgba(232, 210, 160, 0.55),
    rgba(196, 174, 122, 0.2) 35%,
    rgba(80, 100, 130, 0.15) 70%,
    rgba(255, 255, 255, 0.08)
  );
  padding: 1px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
.hero-cell::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 18%;
  width: 3px;
  background: linear-gradient(180deg, #e8d6a8, #9a7d48);
  box-shadow: 0 0 12px rgba(212, 188, 136, 0.35);
}
.hero-band .hero-cell:nth-child(2) {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 6% 100%, 0 78%);
}
.hero-band .hero-cell:nth-child(2)::after {
  left: auto;
  right: 0;
}
@media (min-width: 640px) {
  .hero-band .hero-cell:first-child {
    clip-path: polygon(0 0, 100% 0, 100% 86%, 92% 100%, 0 100%);
    transform: skewY(-0.6deg);
  }
  .hero-band .hero-cell:nth-child(2) {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%, 0 86%);
    transform: skewY(0.6deg);
  }
}
.hero-cell .label {
  color: #c4ae7a;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}
.hero-cell strong {
  font-size: clamp(2rem, 5vw + 0.6rem, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}
.hero-cell .metric-hint {
  color: #7d8796;
  font-size: 0.72rem;
}
.hero-cell-pnl {
  background:
    linear-gradient(125deg, rgba(255, 47, 66, 0.14) 0%, transparent 42%),
    linear-gradient(180deg, #181018 0%, #0a0f16 100%);
}
.hero-cell-pnl .label { color: #d4a0a6; }
.hero-cell-pnl::after {
  background: linear-gradient(180deg, #ff6b7a, #ff2f42);
  box-shadow: 0 0 12px rgba(255, 47, 66, 0.35);
}
.hero-cell-ok {
  background:
    linear-gradient(125deg, rgba(31, 217, 138, 0.14) 0%, transparent 42%),
    linear-gradient(180deg, #0e1814 0%, #0a0f16 100%);
}
.hero-cell-ok .label { color: #8fd4b4; }
.hero-cell-ok::after {
  background: linear-gradient(180deg, #6aefb8, #1fd98a);
  box-shadow: 0 0 12px rgba(31, 217, 138, 0.3);
}
.hero-cell-flat {
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.12) 0%, transparent 42%),
    linear-gradient(180deg, #121925 0%, #0a0f16 100%);
}
.hero-cell-flat .label { color: #c4ae7a; }

.hero-cell .unit,
.pulse .unit,
.stat .unit {
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #7a8494;
  margin-left: 0.15rem;
}

.pulse-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}
@media (min-width: 720px) {
  .pulse-row { grid-template-columns: repeat(4, 1fr); }
}
.pulse {
  position: relative;
  padding: 0.8rem 0.85rem 0.85rem 1rem;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 91% 100%, 0 100%);
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.12) 0%, transparent 42%),
    linear-gradient(180deg, #121925 0%, #0a0f16 100%);
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  isolation: isolate;
  min-height: 4.1rem;
}
.pulse:nth-child(even) {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 9% 100%, 0 80%);
}
.pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(
    135deg,
    rgba(232, 210, 160, 0.45),
    rgba(196, 174, 122, 0.15) 40%,
    rgba(255,255,255,0.08)
  );
  padding: 1px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
.pulse::after {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 22%;
  width: 2px;
  background: linear-gradient(180deg, #dcc892, #8a7348);
  opacity: 0.85;
}
.pulse:nth-child(even)::after {
  left: auto;
  right: 0;
}
.pulse .label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b94a3;
  font-weight: 650;
}
.pulse strong {
  font-size: clamp(1.15rem, 2vw + 0.4rem, 1.45rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
}

.stat-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0 0 1rem;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: none;
  clip-path: none;
  box-shadow: none;
}
@media (min-width: 900px) {
  .stat-sheet { grid-template-columns: repeat(5, 1fr); gap: 0.5rem; }
}
.stat {
  position: relative;
  padding: 0.75rem 0.8rem 0.8rem 0.95rem;
  border: 0;
  border-radius: 0;
  border-right: 0;
  border-bottom: 0;
  min-width: 0;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 90% 100%, 0 100%);
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.1) 0%, transparent 42%),
    linear-gradient(180deg, #121925 0%, #0a0f16 100%);
}
.stat:nth-child(even) {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10% 100%, 0 80%);
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(
    135deg,
    rgba(232, 210, 160, 0.4),
    rgba(196, 174, 122, 0.12) 45%,
    rgba(255,255,255,0.07)
  );
  padding: 1px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
.stat::after {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 24%;
  width: 2px;
  background: linear-gradient(180deg, #d4bc88, #7a6540);
  opacity: 0.75;
}
.stat:nth-child(even)::after {
  left: auto;
  right: 0;
}
/* Mobile 2-col: avoid lonely empty half beside last item */
.stat-sheet .stat:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  clip-path: polygon(0 0, 100% 0, 100% 86%, 97% 100%, 0 100%);
}
@media (min-width: 900px) {
  .stat { border-right: 0; border-bottom: 0; }
  .stat:last-child { border-right: 0; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat-sheet .stat:last-child:nth-child(odd) {
    grid-column: auto;
  }
}
.stat .label {
  font-size: 0.6rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #9aa3b0;
  font-weight: 650;
}
.stat strong {
  font-size: 1.02rem;
  font-weight: 750;
  color: #e8ecf2;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
}

.metric {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 4.6rem;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(14, 18, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: rgba(196, 174, 122, 0.45);
  box-shadow: none;
  opacity: 0.9;
}

@media (hover: hover) {
  .metric:hover {
    border-color: rgba(186, 162, 118, 0.22);
    transform: none;
    box-shadow: none;
    background: rgba(18, 24, 34, 0.95);
  }
}

.metric::after { display: none; }

.metric.metric-primary {
  min-height: 5.4rem;
  background: rgba(16, 22, 32, 0.95);
  border-color: rgba(255, 255, 255, 0.07);
}
.metric.metric-primary::before {
  width: 3px;
  background: linear-gradient(180deg, #e0c992, #9a7d48);
}
.metric.metric-primary strong {
  font-size: clamp(1.45rem, 2.8vw + 0.55rem, 1.9rem);
}

.metric.metric-secondary {
  min-height: 3.8rem;
  opacity: 0.92;
}
.metric.metric-secondary strong {
  font-size: clamp(1.05rem, 1.5vw + 0.55rem, 1.25rem);
  font-weight: 700;
}
.metric.metric-secondary .label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.metric .label {
  position: relative;
  display: block;
  margin: 0;
  color: #8e97a6;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
  line-height: 1.2;
}

.metric strong {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.35rem;
  row-gap: 0.1rem;
  margin: 0;
  font-size: clamp(1.15rem, 2vw + 0.5rem, 1.45rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.metric strong .metric-num {
  min-width: 0;
}

.metric strong .unit,
.pos-pnl .unit,
.metric .unit {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #8e96a3;
  vertical-align: baseline;
  margin-left: 0;
  white-space: nowrap;
}

.metric strong.pos { color: var(--ok); text-shadow: none; }
.metric strong.neg { color: var(--bad); text-shadow: none; }
.metric strong.flat { color: var(--warn); }
.hero-cell strong.pos,
.pulse strong.pos,
.stat strong.pos { color: var(--ok); }
.hero-cell strong.neg,
.pulse strong.neg,
.stat strong.neg { color: var(--bad); }
.hero-cell strong.flat,
.pulse strong.flat,
.stat strong.flat { color: var(--warn); }

.metric-hint {
  position: relative;
  display: block;
  margin: auto 0 0;
  padding-top: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
  opacity: 0.9;
}

.metric-accent {
  border-color: rgba(186, 162, 118, 0.2);
  background: rgba(186, 162, 118, 0.06);
  box-shadow: none;
}

.why-panel {
  padding: 0;
}
.why-panel > summary.why-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  padding: 0.9rem 1.15rem;
  font-weight: 700;
  user-select: none;
}
.why-panel > summary.why-summary::-webkit-details-marker { display: none; }
.why-panel > summary.why-summary::before {
  content: "▸";
  color: var(--accent);
  font-size: 0.85rem;
  transition: transform 0.15s ease;
}
.why-panel[open] > summary.why-summary::before {
  transform: rotate(90deg);
}
.why-summary-title {
  letter-spacing: 0.04em;
  color: #c8ced8;
}
.why-summary #why-summary-now {
  flex: 1 1 12rem;
  font-weight: 550;
  font-size: 0.88rem;
  min-width: 0;
}
.why-body {
  padding: 0.85rem 1.25rem 1.25rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.why-body .chart-help {
  margin: 0 0 0.85rem;
  padding: 0;
  line-height: 1.45;
}
.why-panel .why-now {
  margin: 0.35rem 0 0.75rem;
  padding: 0.9rem 1.15rem 1rem 1rem;
  border-radius: 0;
  clip-path: none;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(201, 184, 150, 0.3);
  background: rgba(0, 0, 0, 0.35);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.why-panel .why-now.blocked {
  border-color: rgba(160, 175, 195, 0.35);
  color: #d8dde6;
  box-shadow: inset 0 0 0 1px rgba(160, 175, 195, 0.35);
}
.why-panel .why-now.clear {
  border-color: rgba(34, 201, 138, 0.45);
  color: #b8e8d4;
  box-shadow: inset 0 0 0 1px rgba(34, 201, 138, 0.45);
}
.why-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.why-chips .chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.why-top {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.why-top li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 0.55rem 0.65rem;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 96% 100%, 0 100%);
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.16);
  font-size: 0.82rem;
}
.why-top .cnt {
  color: #c4a86e;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.why-top .lbl { color: var(--muted); min-width: 0; }

.meta-bar {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  margin: 0 0 0.35rem;
  min-height: 1rem;
}
.sync-warn {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #ffb4ba;
  background: rgba(255, 47, 66, 0.1);
  border: 1px solid rgba(255, 47, 66, 0.35);
  border-radius: 8px;
}
.sync-warn[hidden] { display: none !important; }

.tabs {
  display: flex;
  gap: 0.15rem;
  margin: 0 0 1.25rem;
  padding: 0.2rem 0.35rem 0;
  border-radius: 0;
  clip-path: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(196, 174, 122, 0.22);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.7rem 1rem 0.75rem;
  border: 0;
  border-radius: 0;
  clip-path: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 2px;
  background: transparent;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  transition: background 0.15s ease;
}

.tab.active {
  background: transparent;
  color: #f3ebd8;
  box-shadow: none;
}

.tab.active::after {
  background: linear-gradient(90deg, #e0c992, #a88c55);
}

.tab-short { display: inline; }
.tab-full { display: none; }

@media (min-width: 420px) {
  .tab { font-size: 0.84rem; padding: 0.72rem 1.15rem 0.8rem; }
  .tab-short { display: none; }
  .tab-full { display: inline; }
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.report-grid { display: grid; gap: 0.85rem; }
@media (min-width: 900px) { .report-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .report-grid { grid-template-columns: repeat(4, 1fr); } }

.report-card {
  padding: 1rem 1.15rem 1.25rem 1.2rem;
  clip-path: polygon(0 0, 100% 0, 100% 93%, 96.5% 100%, 0 100%);
}
.report-card .panel-head {
  margin-bottom: 0.75rem;
  align-items: center;
}
.report-card h2 {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d4bc88;
}

.report-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.report-stats > div {
  padding: 0.55rem 0.65rem 0.6rem;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 94% 100%, 0 100%);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.16);
  min-width: 0;
}
.report-stats .wide {
  grid-column: 1 / -1;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 97% 100%, 0 100%);
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.08), transparent 55%),
    rgba(0, 0, 0, 0.4);
}
.report-stats .label {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.report-stats strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.report-stats .wide strong { font-size: 1.2rem; }
.report-stats strong.pos { color: var(--ok); }
.report-stats strong.neg { color: var(--bad); }
.report-stats strong.flat { color: var(--warn); }

.report-card .hint,
.report-card .report-volume {
  margin: 0.75rem 0 0;
  padding-right: 0.75rem;
  font-size: 0.72rem;
  line-height: 1.4;
  word-break: break-word;
}

.report-nav { display: flex; align-items: center; gap: 0.25rem; }
.report-nav .key {
  min-width: 4.2rem;
  max-width: 7.5rem;
  text-align: center;
  color: #c8ced8;
  font-size: 0.72rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrity-panel .integrity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 900px) {
  .integrity-panel .integrity-grid {
    grid-template-columns: 1fr;
  }
}
.integ-card {
  padding: 0.55rem 0.65rem;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.18);
}
.integ-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.integ-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.integ-list li {
  margin: 0.15rem 0;
}
.integ-ok { color: #22c98a !important; }
.integ-warn { color: #e6b84d !important; }
.integ-bad { color: #ff2f42 !important; }

.panel {
  position: relative;
  overflow: visible;
  margin-bottom: 1.05rem;
  padding: 1.05rem 1.15rem 1.2rem 1.15rem;
  border-radius: 0;
  clip-path: none;
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.11) 0%, transparent 38%),
    linear-gradient(180deg, #121925 0%, #0a0f16 100%);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.32);
  backdrop-filter: none;
}
.panel::before,
.panel::after {
  display: none;
}

.chart-panel {
  clip-path: none;
}
.chart-panel::after {
  display: none;
}
.chart-help {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.chart-head-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem 0.75rem;
  min-width: 0;
}
.chart-ranges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.chart-range {
  min-width: 2.4rem;
  padding: 0.28rem 0.55rem !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
}
.chart-range.active {
  opacity: 1;
  color: #1a1204;
  background: var(--gold-shine);
  box-shadow: none;
}


.status-line {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28rem 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: #7a8494;
  font-weight: 500;
  max-width: 100%;
  line-height: 1.35;
  text-align: right;
}
.status-line::before { display: none; }
.status-line .status-k {
  text-transform: uppercase;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: #9aa3b0;
  font-weight: 650;
  font-family: "Outfit", system-ui, sans-serif;
}
.status-line .status-v {
  color: #c4cad4;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: 0.03em;
  font-size: 0.68rem;
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
}
.status-line .status-sep {
  color: #4a5566;
  font-weight: 400;
}
.status-line .status-note {
  color: #6f7888;
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .logo {
    width: 52px;
    height: 52px;
  }
  .brand {
    font-size: 1.05rem;
    letter-spacing: 0.2em;
  }
  h1 {
    font-size: 1.35rem;
  }
  .brand-sub {
    font-size: 0.68rem;
  }
  .top {
    padding: 0.8rem 0.7rem 0.85rem;
    gap: 0.5rem;
  }
  .top-actions .ghost.sm,
  .top-actions .pill {
    min-height: 2rem;
    padding: 0.36rem 0.75rem;
    font-size: 0.74rem;
    white-space: nowrap;
  }
  .meta-bar {
    justify-content: flex-start;
  }
  .status-line {
    text-align: left;
  }
  .status-line .status-note.status-state {
    display: none;
  }
}

.monitor-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.log-tail {
  margin: 0;
  max-height: 14rem;
  overflow: auto;
  padding: 0.75rem 1.1rem 0.9rem 0.85rem;
  border-radius: 0;
  clip-path: none;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.2);
  background: rgba(0, 0, 0, 0.45);
  color: #a8b0bc;
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}
.audit-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.7rem 0.5rem 0.55rem;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 96% 100%, 0 100%);
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.12);
  font-size: 0.75rem;
  color: #a8b0bc;
}
.audit-list .ok { color: var(--ok); }
.audit-list .bad { color: var(--bad); }
.audit-list .ts {
  color: #6f7888;
  font-variant-numeric: tabular-nums;
}
.audit-list .audit-extra { display: none; }
.audit-list.expanded .audit-extra { display: flex; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.btn-row button,
.btn-row .ghost {
  padding: 0.7rem 1.35rem;
}

button, .ghost {
  appearance: none;
  border: 0;
  border-radius: 0;
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  button.primary:hover:not(:disabled) { filter: brightness(1.06); }
  button.danger:hover:not(:disabled) { filter: brightness(1.05); }
  button.ghost:hover, .ghost:hover { filter: brightness(1.08); }
}

button.primary {
  background: var(--gold-shine);
  color: #1a1204;
  box-shadow: 0 8px 18px rgba(201, 160, 58, 0.28);
}

button.danger {
  background: linear-gradient(135deg, #ff2f42, #c41228);
  color: #fff;
  box-shadow: 0 8px 18px rgba(201, 16, 40, 0.32);
}

button.danger.armed {
  outline: 0;
  box-shadow:
    0 0 0 2px rgba(255, 180, 190, 0.7),
    0 0 18px rgba(255, 47, 66, 0.35);
  animation: pulse-stop 1s ease-in-out infinite;
}

@keyframes pulse-stop { 50% { filter: brightness(1.12); } }

.stop-hint { margin: 0.65rem 0 0; }

button.ghost, .ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  color: #dde2ea;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.28);
}

button.ghost:hover, .ghost:hover {
  color: #e8eaef;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.5);
}

button.sm, .ghost.sm { padding: 0.38rem 0.65rem; font-size: 0.8rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.flash {
  margin: 0.8rem 0 0;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid rgba(160, 175, 195, 0.28);
  font-size: 0.88rem;
}

.flash.err {
  background: rgba(255, 47, 66, 0.14);
  border-color: rgba(255, 47, 66, 0.45);
}

.pos-list { display: grid; gap: 0.65rem; }

.pos-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.pos-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.pos-card {
  padding: 1rem 1.05rem 1rem 1.2rem;
  border-radius: 0;
  clip-path: none;
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, #121925, #0a0f16);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.28);
  position: relative;
  overflow: hidden;
}
.pos-legend {
  font-size: 0.78rem;
  margin: 0 0 0.65rem 0;
  line-height: 1.35;
}
.pos-phase-banner {
  margin: -1rem -1.05rem 0.75rem -1.2rem;
  padding: 0.48rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.pos-phase-banner.loss {
  background: rgba(255, 47, 66, 0.2);
  color: #ffb8c4;
}
.pos-phase-banner.pre-trail {
  background: rgba(201, 168, 90, 0.18);
  color: #f0dfb0;
}
.pos-phase-banner.mec-hold,
.pos-phase-banner.d-waiting-arm {
  background: rgba(201, 168, 90, 0.18);
  color: #f0dfb0;
}
.pos-phase-banner.d-armed {
  background: rgba(100, 160, 255, 0.18);
  color: #b8d4ff;
}
.pos-phase-banner.mec-would-sell,
.pos-phase-banner.d-would-sell {
  background: rgba(31, 217, 138, 0.24);
  color: #b9ffdf;
  animation: sell-pulse 1.6s ease-in-out infinite;
}
.pos-phase-banner.trail-wait {
  background: rgba(100, 160, 255, 0.18);
  color: #b8d4ff;
}
.pos-phase-banner.trail-blocked {
  background: rgba(232, 140, 60, 0.22);
  color: #ffd0a8;
}
.pos-phase-banner.sell-now {
  background: rgba(31, 217, 138, 0.24);
  color: #b9ffdf;
  animation: sell-pulse 1.6s ease-in-out infinite;
}
.pos-card.phase-loss::after { background: linear-gradient(180deg, #ff8a96, #ff2f42); }
.pos-card.phase-pre-trail::after { background: linear-gradient(180deg, #e8c96a, #c9a85a); }
.pos-card.phase-mec-hold::after,
.pos-card.phase-d-waiting-arm::after { background: linear-gradient(180deg, #e8c96a, #c9a85a); }
.pos-card.phase-d-armed::after { background: linear-gradient(180deg, #8ab8ff, #5090e8); }
.pos-card.phase-mec-would-sell::after,
.pos-card.phase-d-would-sell::after { background: linear-gradient(180deg, #6ff0b8, #1fd98a); }
.pos-card.phase-trail-wait::after { background: linear-gradient(180deg, #8ab8ff, #5090e8); }
.pos-card.phase-trail-blocked::after { background: linear-gradient(180deg, #f0a060, #e07830); }
.pos-card.phase-sell-now::after { background: linear-gradient(180deg, #6ff0b8, #1fd98a); }
.pos-card::before {
  display: none;
}
.pos-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(196, 174, 122, 0.45);
}
.pos-card.pos-border {
  box-shadow: inset 0 0 0 1px rgba(110, 240, 180, 0.4);
}
.pos-card.pos-border::after {
  background: linear-gradient(180deg, #6ff0b8, #1fd98a);
}
.pos-card.neg-border {
  box-shadow: inset 0 0 0 1px rgba(255, 120, 130, 0.45);
}
.pos-card.neg-border::after {
  background: linear-gradient(180deg, #ff8a96, #ff2f42);
}
.pos-card.flat-border {
  box-shadow: inset 0 0 0 1px rgba(255, 196, 77, 0.4);
}
.pos-card.flat-border::after {
  background: linear-gradient(180deg, #f0dfb0, #c9a85a);
}

.pos-summary-left { min-width: 0; }
.pos-mini {
  font-size: 0.76rem;
  line-height: 1.25;
}
.pos-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(120px, 200px);
  grid-template-rows: auto auto auto;
  gap: 0.5rem;
  align-items: start;
}
.pos-headline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  margin-bottom: 0;
  min-width: 0;
}
.pos-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  width: 100%;
  min-width: 0;
}
.cell-a1 { grid-column: 1 / 3; grid-row: 1 / 2; min-width: 0; }
.cell-a2 { display: none; } /* badge lives in title-row */
.cell-a3 { grid-column: 3 / 4; grid-row: 1 / 2; }
.cell-b1 { grid-column: 1 / 2; grid-row: 2 / 3; }
.cell-b2 { grid-column: 2 / 3; grid-row: 2 / 3; }
.cell-b3 { grid-column: 3 / 4; grid-row: 2 / 3; }
.cell-c1 { grid-column: 1 / 2; grid-row: 3 / 4; }
.cell-c2 { grid-column: 2 / 3; grid-row: 3 / 4; }
.cell-c3 { grid-column: 3 / 4; grid-row: 3 / 4; }

.pos-state-wrap { justify-content: flex-start; }
.pos-title {
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.2;
}
.pos-state {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.42rem;
  box-shadow: inset 0 0 0 1px rgba(196, 168, 110, 0.35);
  color: #d6deea;
}
.pos-state.on {
  color: #b9ffdf;
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.52);
  background: rgba(31, 217, 138, 0.12);
}
.pos-state.wait {
  color: #f0dfb0;
  box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.5);
  background: rgba(201, 168, 90, 0.12);
}
.pos-state.sell-now {
  color: #b9ffdf;
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.65);
  background: rgba(31, 217, 138, 0.2);
  animation: sell-pulse 1.6s ease-in-out infinite;
}
.pos-state.pre-trail {
  color: #f0dfb0;
  box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.5);
  background: rgba(201, 168, 90, 0.12);
}
.pos-state.mec-hold,
.pos-state.d-waiting-arm {
  color: #f0dfb0;
  box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.5);
  background: rgba(201, 168, 90, 0.12);
}
.pos-state.d-armed {
  color: #b8d4ff;
  box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.5);
  background: rgba(100, 160, 255, 0.12);
}
.pos-state.mec-would-sell,
.pos-state.d-would-sell {
  color: #b9ffdf;
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.65);
  background: rgba(31, 217, 138, 0.2);
  animation: sell-pulse 1.6s ease-in-out infinite;
}
.pos-state.trail-wait {
  color: #b8d4ff;
  box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.5);
  background: rgba(100, 160, 255, 0.12);
}
.pos-state.trail-blocked {
  color: #ffd0a8;
  box-shadow: inset 0 0 0 1px rgba(232, 140, 60, 0.55);
  background: rgba(232, 140, 60, 0.14);
}
.pos-state.loss {
  color: #ffb8c4;
  box-shadow: inset 0 0 0 1px rgba(255, 47, 66, 0.55);
  background: rgba(255, 47, 66, 0.14);
}
@keyframes sell-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.65); }
  50% { box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.95), 0 0 12px rgba(31, 217, 138, 0.35); }
}
.meta-box {
  padding: 0.42rem 0.56rem;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(196, 168, 110, 0.24);
  display: grid;
  gap: 0.12rem;
  border-radius: 4px;
}
.meta-box span {
  color: #8fa0b5;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.meta-box strong {
  color: #d8e0eb;
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.25;
}
.pos-exit-inline {
  margin-top: 0.55rem;
  padding: 0.46rem 0.62rem;
  font-size: 0.81rem;
  line-height: 1.25;
  box-shadow: inset 0 0 0 1px rgba(143, 160, 181, 0.22);
  background: rgba(143, 160, 181, 0.08);
  color: #b5c3d4;
}
.pos-exit-inline.live,
.pos-exit-inline.sell-now,
.pos-exit-inline.mec-would-sell {
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.42);
  background: linear-gradient(180deg, rgba(31, 217, 138, 0.17), rgba(31, 217, 138, 0.06));
  color: #b9ffdf;
  font-weight: 780;
  text-shadow: 0 0 10px rgba(31, 217, 138, 0.28);
  border-left: 3px solid rgba(31, 217, 138, 0.75);
}
.pos-exit-inline.wait,
.pos-exit-inline.pre-trail,
.pos-exit-inline.mec-hold,
.pos-exit-inline.d-waiting-arm {
  box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.35);
  background: rgba(201, 168, 90, 0.1);
  color: #f0dfb0;
}
.pos-exit-inline.d-armed {
  box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.35);
  background: rgba(100, 160, 255, 0.1);
  color: #b8d4ff;
}
.pos-exit-inline.d-would-sell {
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.42);
  background: linear-gradient(180deg, rgba(31, 217, 138, 0.17), rgba(31, 217, 138, 0.06));
  color: #b9ffdf;
  font-weight: 780;
  text-shadow: 0 0 10px rgba(31, 217, 138, 0.28);
  border-left: 3px solid rgba(31, 217, 138, 0.75);
}
.pos-exit-inline.trail-wait {
  box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.35);
  background: rgba(100, 160, 255, 0.1);
  color: #b8d4ff;
}
.pos-exit-inline.trail-blocked {
  box-shadow: inset 0 0 0 1px rgba(232, 140, 60, 0.4);
  background: rgba(232, 140, 60, 0.12);
  color: #ffd0a8;
}
.pos-exit-inline.loss {
  box-shadow: inset 0 0 0 1px rgba(255, 47, 66, 0.35);
  background: rgba(255, 47, 66, 0.08);
  color: #ffb8c4;
}
.spark {
  width: 100%;
  height: 46px;
  display: block;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px rgba(196, 168, 110, 0.22);
}
.pos-pnl-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.72;
  margin-bottom: 0.12rem;
}
.pos-market-mtf {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
}
.pos-entry-mtf {
  font-size: 0.68rem;
  margin-top: 0.15rem;
}
.pulse-hint {
  display: block;
  font-size: 0.58rem;
  opacity: 0.65;
  margin-top: 0.08rem;
  font-weight: 600;
}
.pos-pnl {
  text-align: right;
  display: block;
  min-width: 0;
  padding: 0.46rem 0.62rem;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.4);
  background: rgba(0, 0, 0, 0.28);
}
.pos-pnl-line {
  font-weight: 820;
  font-size: 1.04rem;
  line-height: 1.2;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.pos-pnl-line span {
  font-size: 0.84rem;
  font-weight: 760;
}
.pos-pnl-sub {
  font-size: 0.68rem;
  font-weight: 650;
  opacity: 0.78;
  margin-top: 0.1rem;
}
.pos-pnl.pos { box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.55); background: rgba(31, 217, 138, 0.08); }
.pos-pnl.pos, .pos-pnl.pos .pos-pnl-line, .pos-pnl.pos .pos-pnl-line span, .pos-pnl.pos .pos-pnl-sub { color: var(--ok); }
.pos-pnl.neg { box-shadow: inset 0 0 0 1px rgba(255, 47, 66, 0.55); background: rgba(255, 47, 66, 0.08); }
.pos-pnl.neg, .pos-pnl.neg .pos-pnl-line, .pos-pnl.neg .pos-pnl-line span, .pos-pnl.neg .pos-pnl-sub { color: var(--bad); }
.pos-pnl.wait { box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.45); background: rgba(201, 168, 90, 0.08); }
.pos-pnl.wait, .pos-pnl.wait .pos-pnl-line, .pos-pnl.wait .pos-pnl-sub, .pos-pnl.wait .pos-pnl-label { color: #f0dfb0; }
.pos-pnl.trail { box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.45); background: rgba(100, 160, 255, 0.08); }
.pos-pnl.trail, .pos-pnl.trail .pos-pnl-line, .pos-pnl.trail .pos-pnl-sub, .pos-pnl.trail .pos-pnl-label { color: #b8d4ff; }
.pos-card.phase-pre-trail .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.45) !important;
  background: rgba(201, 168, 90, 0.08) !important;
}
.pos-card.phase-pre-trail .pos-pnl,
.pos-card.phase-pre-trail .pos-pnl .pos-pnl-line,
.pos-card.phase-pre-trail .pos-pnl .pos-pnl-sub,
.pos-card.phase-pre-trail .pos-pnl .pos-pnl-label { color: #f0dfb0 !important; }
.pos-card.phase-mec-hold .pos-pnl,
.pos-card.phase-d-waiting-arm .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(201, 168, 90, 0.45) !important;
  background: rgba(201, 168, 90, 0.08) !important;
}
.pos-card.phase-mec-hold .pos-pnl,
.pos-card.phase-mec-hold .pos-pnl .pos-pnl-line,
.pos-card.phase-mec-hold .pos-pnl .pos-pnl-sub,
.pos-card.phase-mec-hold .pos-pnl .pos-pnl-label,
.pos-card.phase-d-waiting-arm .pos-pnl,
.pos-card.phase-d-waiting-arm .pos-pnl .pos-pnl-line,
.pos-card.phase-d-waiting-arm .pos-pnl .pos-pnl-sub,
.pos-card.phase-d-waiting-arm .pos-pnl .pos-pnl-label { color: #f0dfb0 !important; }
.pos-card.phase-d-armed .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.45) !important;
  background: rgba(100, 160, 255, 0.08) !important;
}
.pos-card.phase-d-armed .pos-pnl,
.pos-card.phase-d-armed .pos-pnl .pos-pnl-line,
.pos-card.phase-d-armed .pos-pnl .pos-pnl-sub,
.pos-card.phase-d-armed .pos-pnl .pos-pnl-label { color: #b8d4ff !important; }
.pos-card.phase-mec-would-sell .pos-pnl,
.pos-card.phase-d-would-sell .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.55) !important;
  background: rgba(31, 217, 138, 0.08) !important;
}
.pos-card.phase-mec-would-sell .pos-pnl,
.pos-card.phase-mec-would-sell .pos-pnl .pos-pnl-line,
.pos-card.phase-mec-would-sell .pos-pnl .pos-pnl-sub,
.pos-card.phase-mec-would-sell .pos-pnl .pos-pnl-label,
.pos-card.phase-d-would-sell .pos-pnl,
.pos-card.phase-d-would-sell .pos-pnl .pos-pnl-line,
.pos-card.phase-d-would-sell .pos-pnl .pos-pnl-sub,
.pos-card.phase-d-would-sell .pos-pnl .pos-pnl-label { color: var(--ok) !important; }
.pos-card.phase-trail-wait .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.45) !important;
  background: rgba(100, 160, 255, 0.08) !important;
}
.pos-card.phase-trail-wait .pos-pnl,
.pos-card.phase-trail-wait .pos-pnl .pos-pnl-line,
.pos-card.phase-trail-wait .pos-pnl .pos-pnl-sub,
.pos-card.phase-trail-wait .pos-pnl .pos-pnl-label { color: #b8d4ff !important; }
.pos-card.phase-trail-blocked .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(232, 140, 60, 0.5) !important;
  background: rgba(232, 140, 60, 0.1) !important;
}
.pos-card.phase-trail-blocked .pos-pnl,
.pos-card.phase-trail-blocked .pos-pnl .pos-pnl-line,
.pos-card.phase-trail-blocked .pos-pnl .pos-pnl-sub,
.pos-card.phase-trail-blocked .pos-pnl .pos-pnl-label { color: #ffd0a8 !important; }
.pos-card.phase-sell-now .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.55) !important;
  background: rgba(31, 217, 138, 0.08) !important;
}
.pos-card.phase-sell-now .pos-pnl,
.pos-card.phase-sell-now .pos-pnl .pos-pnl-line,
.pos-card.phase-sell-now .pos-pnl .pos-pnl-sub,
.pos-card.phase-sell-now .pos-pnl .pos-pnl-label { color: var(--ok) !important; }
.pos-card.phase-loss .pos-pnl {
  box-shadow: inset 0 0 0 1px rgba(255, 47, 66, 0.55) !important;
  background: rgba(255, 47, 66, 0.08) !important;
}
.pos-card.phase-loss .pos-pnl,
.pos-card.phase-loss .pos-pnl .pos-pnl-line,
.pos-card.phase-loss .pos-pnl .pos-pnl-sub,
.pos-card.phase-loss .pos-pnl .pos-pnl-label { color: var(--bad) !important; }
.pos-pnl.flat { box-shadow: inset 0 0 0 1px rgba(143, 160, 181, 0.35); background: rgba(143, 160, 181, 0.06); }

@media (max-width: 720px) {
  .pos-card { padding: 0.85rem 0.75rem 0.8rem 0.95rem; }
  .pos-grid-3 { grid-template-columns: 1fr 1fr; gap: 0.45rem; }
  .cell-a1 { grid-column: 1 / 2; grid-row: 1 / 2; }
  .cell-a3 { grid-column: 2 / 3; grid-row: 1 / 2; height: 52px; }
  .cell-b1 { grid-column: 1 / 2; grid-row: 2 / 3; }
  .cell-b2 { grid-column: 2 / 3; grid-row: 2 / 3; }
  .cell-b3 { grid-column: 1 / -1; grid-row: 3 / 4; }
  .cell-c1 { grid-column: 1 / 2; grid-row: 4 / 5; }
  .cell-c2 { grid-column: 2 / 3; grid-row: 4 / 5; }
  .cell-c3 { grid-column: 1 / -1; grid-row: 5 / 6; }
  .pos-headline { gap: 0.28rem; }
  .pos-state { font-size: 0.64rem; padding: 0.16rem 0.36rem; }
  .meta-box span { font-size: 0.62rem; }
  .meta-box strong { font-size: 0.72rem; }
  .pos-pnl { min-width: 0; padding: 0.32rem 0.45rem; }
  .pos-pnl-line { font-size: 0.92rem; }
  .pos-pnl-line span { font-size: 0.78rem; }
  .pos-exit-inline { font-size: 0.7rem; padding: 0.28rem 0.42rem; }
  .sell-btn { width: 100%; }
}
@media (max-width: 420px) {
  .pos-grid-3 { grid-template-columns: 1fr; }
  .cell-a1, .cell-a3, .cell-b1, .cell-b2, .cell-b3, .cell-c1, .cell-c2, .cell-c3 {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .cell-a3 { height: 40px; }
}

.trade-card .trade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.7rem;
  margin: 0.55rem 0 0.45rem;
}
.trade-grid .label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  margin-bottom: 0.12rem;
}
.trade-grid strong { font-size: 0.92rem; font-weight: 750; color: #d5dae2; }

.trade-card {
  padding: 0.9rem 1.05rem 0.95rem 1.3rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.trade-card .pos-pnl {
  min-width: 0;
  margin-left: 0.15rem;
}
.trade-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: rgba(196, 174, 122, 0.45);
  box-shadow: none;
}
/* Vétel: hűvös menta (nyitás) */
.trade-card.trade-buy {
  background:
    linear-gradient(125deg, rgba(31, 217, 138, 0.12) 0%, transparent 42%),
    linear-gradient(180deg, #121925, #0a0f16);
  box-shadow: inset 0 0 0 1px rgba(31, 217, 138, 0.22);
}
.trade-card.trade-buy::after {
  background: linear-gradient(180deg, #6ff0b8, #1fd98a);
}
.trade-buy .trade-side { color: #9ff0d0; }
.trade-buy .trade-side-dot { background: var(--ok); }

/* Eladás: eredmény szerint — nyereség pezsgő/arany (nem ugyanaz a menta) */
.trade-card.trade-sell-pos {
  background:
    linear-gradient(125deg, rgba(212, 186, 120, 0.16) 0%, transparent 44%),
    linear-gradient(180deg, #16140f, #0c0b08);
  box-shadow: inset 0 0 0 1px rgba(212, 186, 120, 0.38);
}
.trade-card.trade-sell-pos::after {
  background: linear-gradient(180deg, #efe4cc, #c4ae7a);
}
.trade-sell-pos .trade-side { color: #e8d9b0; }
.trade-sell-pos .trade-side-dot { background: #d0ba88; }
.trade-sell-pos .pos-pnl.pos { color: #e2d4b4; }

.trade-card.trade-sell-neg {
  background:
    linear-gradient(125deg, rgba(255, 47, 66, 0.1) 0%, transparent 42%),
    linear-gradient(180deg, #121925, #0a0f16);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 130, 0.4);
}
.trade-card.trade-sell-neg::after {
  background: linear-gradient(180deg, #ff8a96, #ff2f42);
}
.trade-sell-neg .trade-side { color: #ffb0b8; }
.trade-sell-neg .trade-side-dot { background: var(--bad); }

.trade-card.trade-sell-flat {
  background:
    linear-gradient(125deg, rgba(186, 162, 118, 0.1) 0%, transparent 42%),
    linear-gradient(180deg, #121925, #0a0f16);
  box-shadow: inset 0 0 0 1px rgba(186, 162, 118, 0.28);
}
.trade-card.trade-sell-flat::after {
  background: linear-gradient(180deg, #f0dfb0, #c9a85a);
}
.trade-sell-flat .trade-side { color: #d6c8a4; }
.trade-sell-flat .trade-side-dot { background: var(--warn); }

.trade-card .pos-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-weight: 750;
}
.trade-side {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.88rem;
}
.trade-side-dot {
  width: 0.55rem;
  height: 0.55rem;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  flex-shrink: 0;
}

.badge-open {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 0.25rem;
  clip-path: none;
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
  color: #1a1610;
  background: var(--gold-shine);
}

.alert-card .pos-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.alert-card .alert-title {
  font-weight: 750;
  font-size: 0.92rem;
  color: #e8ecf2;
}
.alert-card .pos-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.alert-card.alert-trade {
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, #121925, #0a0f16);
}
.alert-card.alert-stop,
.alert-card.alert-warn {
  background:
    linear-gradient(125deg, rgba(255, 47, 66, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, #121925, #0a0f16);
}
.alert-card.alert-start,
.alert-card.alert-ok {
  background:
    linear-gradient(125deg, rgba(31, 217, 138, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, #121925, #0a0f16);
}
.alert-kind {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4ae7a;
  background: rgba(196, 174, 122, 0.12);
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.28);
}

.chart-wrap {
  position: relative;
  height: 280px;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 94%, 97.5% 100%, 0 100%);
  background:
    linear-gradient(180deg, rgba(196, 174, 122, 0.05), transparent 28%),
    rgba(0, 0, 0, 0.45);
  border: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.2);
}
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.btc-chart-panel {
  margin-top: 0.65rem;
}
.btc-chart-panel .panel-head h2 {
  letter-spacing: 0.02em;
}
.btc-chart-wrap {
  min-height: 280px;
  height: clamp(220px, 38vw, 320px);
}
.btc-chart-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.btc-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btc-leg i {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px dashed currentColor;
}
.btc-leg.entry { color: rgba(255, 193, 77, 0.95); }
.btc-leg.exit { color: rgba(34, 201, 138, 0.95); }
.btc-leg.exit i { border-top-style: solid; border-top-width: 3px; }
.btc-leg.mark-buy { color: #1aa868; }
.btc-leg.mark-sell { color: #d6455a; }
.btc-leg.mark-buy i,
.btc-leg.mark-sell i {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 2px;
  background: currentColor;
}

.tg-box {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1.1rem 0.95rem 1rem;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 96% 100%, 0 100%);
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.22);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
  word-break: break-word;
}
.tg-box code { color: var(--accent-2); font-size: 0.78rem; }
.tg-box.ok {
  box-shadow: inset 0 0 0 1px rgba(34, 201, 138, 0.5);
  color: #b8e8d4;
}
.tg-box.bad {
  box-shadow: inset 0 0 0 1px rgba(255, 47, 66, 0.45);
  color: #f0b8bc;
}

.shell {
  max-width: 28rem;
  margin: 0 auto;
  padding: 14vh 1.5rem 3rem;
}
.card {
  display: grid;
  gap: 0.9rem;
  padding: 1.2rem 1.15rem 1.25rem;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 94% 100%, 0 100%);
  background:
    linear-gradient(145deg, rgba(196, 174, 122, 0.1), transparent 40%),
    #0c121a;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.3);
}
label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1rem;
}
.status {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.status.ok { color: var(--ok); }
.status.err { color: var(--bad); }
.sub { margin: 0 0 1.5rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 639px) {
  .trade-card {
    padding: 0.85rem 0.95rem 0.9rem 1.2rem;
  }
  .trade-card .pos-top {
    align-items: flex-start;
    gap: 0.5rem;
  }
  .trade-card .trade-side {
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
  }
  .trade-card .pos-pnl {
    flex: 0 1 auto;
    min-width: unset;
    max-width: min(46%, 9.5rem);
    padding: 0.32rem 0.48rem 0.34rem;
    word-break: break-word;
  }
}
@media (min-width: 640px) {
  .hero-metrics { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
  .trade-card .trade-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .hero-metrics { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1280px) {
  .hero-metrics { grid-template-columns: repeat(4, 1fr); }
  .metric.metric-primary strong { font-size: clamp(1.5rem, 1vw + 1.1rem, 1.95rem); }
}

/* ═══ Manual Sell Modal ═══ */
.pos-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0 0;
}
.sell-btn {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.55rem;
  border-radius: 6px;
  clip-path: none;
  color: var(--bad);
  border: 1px solid rgba(255, 47, 66, 0.5);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 700;
  white-space: nowrap;
}
.sell-btn:hover {
  background: rgba(255, 47, 66, 0.12);
  border-color: var(--bad);
}
@media (max-width: 560px) {
  .pos-actions {
    justify-content: stretch;
    padding-top: 0.45rem;
  }
  .sell-btn {
    width: 100%;
    text-align: center;
    padding: 0.42rem 0.7rem;
  }
}

.sell-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
}
.sell-overlay.open {
  display: flex;
}
.sell-modal {
  position: relative;
  width: min(92vw, 420px);
  max-height: 90vh;
  overflow-y: auto;
  background: #0e1520;
  border: 1px solid rgba(196, 174, 122, 0.25);
  border-radius: 12px;
  padding: 1.5rem 1.6rem 1.3rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}
.sell-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.sell-close:hover { color: var(--text); }
.sell-step h3 {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
  color: var(--text);
}
.sell-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.8rem;
  font-size: 0.88rem;
}
.sell-table td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sell-table td:first-child {
  color: var(--muted);
  width: 40%;
}
.sell-warn {
  color: var(--bad);
  font-size: 0.85rem;
  margin: 0.6rem 0;
  padding: 0.5rem 0.7rem;
  background: rgba(255, 47, 66, 0.08);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 47, 66, 0.2);
}
.sell-input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  margin: 0.5rem 0 0.8rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.sell-input:focus {
  outline: none;
  border-color: var(--bad);
  box-shadow: 0 0 0 2px rgba(255, 47, 66, 0.2);
}
.sell-mode-row {
  margin: 0.6rem 0 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.sell-mode-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.sell-mode-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--ok);
}
.sell-go {
  font-weight: 700;
  font-size: 1rem;
}
.sell-step .btn-row {
  margin-top: 0.8rem;
}
#sell-result-title.pos { color: var(--ok); }
#sell-result-title.neg { color: var(--bad); }
#buy-result-title.pos { color: var(--ok); }
#buy-result-title.neg { color: var(--bad); }
.buy-ctrl {
  background: linear-gradient(135deg, rgba(0, 200, 120, 0.35), rgba(0, 160, 100, 0.25));
  border-color: rgba(0, 220, 130, 0.45);
}
.buy-form {
  display: grid;
  gap: 0.65rem;
  margin: 0.65rem 0 0.5rem;
}
.buy-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.buy-form .sell-input {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
}
.buy-form select.sell-input {
  padding-right: 2rem;
}

/* --- Ravelt UI 1.8.50: monitor / integrity / picker / chart --- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.market-picker {
  position: relative;
  z-index: 402;
  flex-shrink: 1;
  min-width: 0;
  overflow: visible;
}
.market-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.2rem;
  max-width: 100%;
  padding: 0.42rem 1.05rem 0.42rem 1.15rem;
  margin: 0;
  border: 0;
  border-radius: 0;
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  font-family: Outfit, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #e8d7b0;
  background:
    linear-gradient(125deg, rgba(196, 174, 122, 0.18), transparent 55%),
    rgba(14, 18, 26, 0.95);
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.35);
  cursor: pointer;
}
.market-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9.5rem;
}
.market-picker-btn.single {
  cursor: default;
  opacity: 0.95;
}
.market-picker-btn.single .market-picker-caret {
  display: none;
}
.market-picker-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 14rem;
  max-width: min(18rem, 92vw);
  padding: 0.35rem;
  background: linear-gradient(180deg, #151c28 0%, #0b1018 100%);
  box-shadow:
    inset 0 0 0 1px rgba(196, 174, 122, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 0.2rem;
  z-index: 500;
}
/* CSS display:grid overrides HTML [hidden] — must force hide */
.market-picker-menu[hidden] {
  display: none !important;
}
.market-picker-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c8ced8;
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-family: Outfit, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
}
.market-picker-item:hover,
.market-picker-item.active {
  background: rgba(196, 174, 122, 0.14);
  color: #f0e2c0;
}
.market-picker-item .mp-sym {
  display: block;
  color: #e8d7b0;
  font-weight: 750;
}
.market-picker-item .mp-name {
  display: block;
  font-size: 0.72rem;
  color: #7a8494;
  font-weight: 500;
  margin-top: 0.1rem;
}

.integ-reconcile {
  margin: -0.25rem 0 0.65rem;
  font-size: 0.78rem;
}
.integ-status-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.integ-status-line .integ-val {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.integ-card .integ-sub {
  margin: 0;
  font-size: 0.78rem;
  color: #8b93a1;
  line-height: 1.4;
}
.integ-card .integ-detail {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #a8b0bc;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.monitor-head-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.monitor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.monitor-search {
  flex: 1 1 10rem;
  min-width: 8rem;
  max-width: 18rem;
  appearance: none;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #d5dae2;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  font-family: Outfit, system-ui, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.22);
}
.monitor-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.monitor-filters .mon-f {
  padding: 0.28rem 0.65rem;
  font-size: 0.68rem;
  opacity: 0.72;
}
.monitor-filters .mon-f.active {
  opacity: 1;
  color: #e8d7b0;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.45);
}
.monitor-autoscroll {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #8b93a1;
  user-select: none;
}
.monitor-scroll {
  height: 18rem;
  max-height: 18rem;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.2);
  background: rgba(0, 0, 0, 0.45);
}
.monitor-scroll .log-tail {
  max-height: none;
  height: auto;
  overflow: visible;
  box-shadow: none;
  background: transparent;
  margin: 0;
}
.log-tail .log-line {
  display: block;
  padding: 0.08rem 0;
}
.log-tail .log-line.hit-buy { color: #7ddeb8; }
.log-tail .log-line.hit-sell { color: #f0a0a8; }
.log-tail .log-line.hit-why { color: #e6c88a; }
.log-tail .log-line.hit-err { color: #ff6b7a; }
.log-tail .log-line.hit-rec { color: #8ab4e8; }

.pos-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.pos-card.selected {
  box-shadow:
    inset 0 0 0 1px rgba(110, 182, 255, 0.65),
    0 0 0 1px rgba(110, 182, 255, 0.25);
}
.pos-entry-time {
  font-size: 0.78rem;
  color: #c8b48a;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}
.pos-entry-mtf,
.pos-exit-mtf {
  font-size: 0.72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.pos-ids {
  font-size: 0.68rem;
  color: #6f7888;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
  word-break: break-all;
  max-width: 100%;
}
.pos-entry-type {
  font-size: 0.72rem;
  color: #9aa3b0;
}

.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.35rem;
  margin: 0 0 0.55rem;
  align-items: center;
}
.chart-tog {
  font-size: 0.75rem;
  color: #8b93a1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  user-select: none;
  white-space: nowrap;
}
.chart-tog input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: #c4ae7a;
}
.btc-leg.mark-open i {
  background: #6eb6ff;
}
.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.45rem 0.6rem;
  background: rgba(8, 12, 18, 0.94);
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.35);
  color: #d5dae2;
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: pre-line;
}

.why-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}
.why-stage {
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(196, 174, 122, 0.18);
  color: #b8c0cc;
}
.why-stage.pass {
  color: #7ddeb8;
  box-shadow: inset 0 0 0 1px rgba(34, 201, 138, 0.35);
}
.why-stage.fail,
.why-stage.block {
  color: #ff8a95;
  box-shadow: inset 0 0 0 1px rgba(255, 47, 66, 0.35);
}
.why-stage.skip {
  color: #8b93a1;
}

@media (max-width: 700px) {
  .monitor-scroll { height: 14rem; max-height: 14rem; }
  .market-picker-menu {
    left: 0;
    right: auto;
    min-width: min(16rem, 88vw);
  }

  .top {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.55rem 0.65rem;
    padding: 0.75rem 0.7rem 0.8rem;
  }
  .brand-block {
    flex: 1 1 auto;
    min-width: 0;
  }
  .brand-sub {
    display: none;
  }
  .logo {
    width: 44px;
    height: 44px;
  }
  .logo-row {
    gap: 0.65rem;
  }
  h1 {
    font-size: 1.2rem;
  }
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
    padding-top: 0;
  }
  .market-picker {
    order: 0;
    flex: 1 1 auto;
  }
  .market-picker-btn {
    width: 100%;
    justify-content: space-between;
    min-height: 2rem;
    font-size: 0.78rem;
    padding: 0.36rem 0.85rem;
  }
  .market-picker-label {
    max-width: none;
  }
  .top-actions .pill,
  .top-actions .ghost.sm {
    flex: 0 0 auto;
  }

  .meta-bar {
    margin-top: 0.15rem;
  }
  .status-line {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .btc-chart-panel .panel-head,
  .chart-panel .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
  .chart-head-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem 0.5rem;
  }
  .chart-ranges {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .chart-range {
    padding: 0.28rem 0.55rem;
    font-size: 0.68rem;
  }
  #btc-chart-meta,
  #chart-meta {
    width: 100%;
    font-size: 0.7rem;
  }
  .chart-help {
    font-size: 0.72rem;
  }
}

/* Capital / deposits tab */
.capital-form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
}
.capital-form label select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1rem;
}
.capital-form .btn-row {
  grid-column: 1 / -1;
}
.capital-rollups {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.cap-roll-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cap-roll-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
}
.flash.ok { color: var(--ok); }
.flash.err { color: var(--bad); }
#panel-capital .hero-band {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 720px) {
  #panel-capital .hero-band {
    grid-template-columns: 1fr;
  }
}
