:root {
  --bg: #ffffff;
  --card: #ffffff;
  --line: #e8ebf2;
  --text: #141826;
  --muted: #6b7280;
  --green: #0f9f61;
  --green-soft: #e9fbf2;
  --red: #e5484d;
  --red-soft: #fff1f2;
  --orange: #d97706;
  --orange-soft: #fff7e8;
  --blue: #1d4ed8;
  --blue-soft: #edf3ff;
  --slate-soft: #f8fafc;
  --shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
}

html,
body {
  width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

body.embed-mode .app-shell {
  width: min(100%, 100%);
  padding: 16px;
}

body.embed-mode .board-section {
  box-shadow: none;
}

body.embed-mode .disclaimer-box {
  margin-bottom: 0;
}

body.embed-mobile .app-shell {
  width: 100%;
  max-width: 100%;
  padding: 18px;
}

body.embed-mobile .page-header h1 {
  font-size: 3.25rem;
  line-height: 0.95;
}

body.embed-mobile .page-copy {
  max-width: none;
  font-size: 1.14rem;
  line-height: 1.7;
}

body.embed-mobile .board-section {
  padding: 22px;
}

body.embed-mobile .section-header h2 {
  font-size: 1.8rem;
}

body.embed-mobile .section-header p {
  font-size: 1.04rem;
}

body.embed-mobile .page-header,
body.embed-mobile .section-header {
  flex-direction: column;
  align-items: flex-start;
}

body.embed-mobile .live-status {
  justify-items: start;
}

body.embed-mobile .live-status__text {
  text-align: left;
}

body.embed-mobile .micro-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

body.embed-mobile .micro-stat {
  width: 100%;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 1.06rem;
}

body.embed-mobile .trade-grid {
  grid-template-columns: 1fr;
}

body.embed-mobile .trade-card {
  padding: 24px;
  gap: 18px;
  border-radius: 22px;
}

body.embed-mobile .trade-card__pair {
  font-size: 1.72rem;
}

body.embed-mobile .trade-card__time,
body.embed-mobile .reason,
body.embed-mobile .catalyst {
  font-size: 1.05rem;
  line-height: 1.72;
}

body.embed-mobile .action-badge,
body.embed-mobile .strength-badge,
body.embed-mobile .market-badge,
body.embed-mobile .result-badge,
body.embed-mobile .target-chip {
  padding: 10px 14px;
  font-size: 0.96rem;
}

body.embed-mobile .levels {
  grid-template-columns: 1fr;
  gap: 12px;
}

body.embed-mobile .level-box {
  padding: 16px;
  border-radius: 16px;
}

body.embed-mobile .level-box span {
  font-size: 0.9rem;
}

body.embed-mobile .level-box strong,
body.embed-mobile .level-box--entry strong {
  font-size: 1.18rem;
  white-space: normal;
}

body.embed-mobile .view-toggle {
  width: 100%;
}

body.embed-mobile .view-toggle__button {
  flex: 1 1 0;
  text-align: center;
}

@media (max-width: 520px) {
  body.embed-mobile .page-header h1 {
    font-size: 2.9rem;
  }

  body.embed-mobile .section-header h2 {
    font-size: 1.72rem;
  }

  body.embed-mobile .trade-card {
    padding: 22px;
  }

  body.embed-mobile .trade-card__pair {
    font-size: 1.62rem;
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-header h1 {
  margin-top: 8px;
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  line-height: 1;
}

.page-copy {
  margin-top: 9px;
  max-width: 620px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.live-status {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.live-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

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

.live-pill--warn {
  background: var(--orange-soft);
  color: var(--orange);
}

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

.live-pill--idle {
  background: var(--slate-soft);
  color: #475467;
}

.live-status__text {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.micro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.micro-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
}

.micro-stat strong {
  color: var(--text);
  font-weight: 800;
}

.board-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.disclaimer-box {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfe;
}

.disclaimer-box__title {
  font-size: 0.9rem;
  font-weight: 800;
}

.disclaimer-box__body {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: 1.35rem;
}

.section-header p {
  margin-top: 6px;
  color: var(--muted);
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
}

.view-toggle__button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.view-toggle__button strong {
  color: inherit;
  font-weight: 800;
}

.view-toggle__button.is-active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.message-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfe;
}

.message-panel__title {
  font-size: 1rem;
  font-weight: 700;
}

.message-panel__body {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.message-panel__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.message-step {
  display: inline-flex;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 600;
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trade-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  animation: fade-in 260ms ease both;
}

.trade-card--buy {
  border-color: rgba(15, 159, 97, 0.22);
}

.trade-card--sell {
  border-color: rgba(229, 72, 77, 0.22);
}

.trade-card--win {
  border-color: rgba(15, 159, 97, 0.22);
}

.trade-card--loss {
  border-color: rgba(229, 72, 77, 0.22);
}

.trade-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.trade-card__pair {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.trade-card__time {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.trade-card__times {
  display: grid;
  gap: 2px;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-badge,
.strength-badge,
.market-badge,
.result-badge,
.target-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

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

.action-badge--sell {
  background: var(--red-soft);
  color: var(--red);
}

.strength-badge--strong {
  background: var(--blue-soft);
  color: var(--blue);
}

.strength-badge--medium {
  background: var(--orange-soft);
  color: var(--orange);
}

.strength-badge--weak {
  background: #f3f4f6;
  color: #475467;
}

.market-badge {
  background: #f3f4f6;
  color: #475467;
}

.result-badge--win {
  background: var(--green-soft);
  color: var(--green);
}

.result-badge--loss {
  background: var(--red-soft);
  color: var(--red);
}

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

.level-box {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #eef2f7;
  background: #fafbfd;
}

.level-box span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.level-box strong {
  display: block;
  margin-top: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
}

.level-box--entry strong {
  white-space: nowrap;
  font-size: 0.92rem;
}

.target-chip {
  background: #f1f5ff;
  color: var(--blue);
}

.reason,
.catalyst {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.58;
}

.catalyst {
  margin-top: -6px;
}

.catalyst-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(29, 78, 216, 0.18);
}

.catalyst-link:hover {
  color: var(--blue);
  border-bottom-color: rgba(29, 78, 216, 0.42);
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: #fcfcfd;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .trade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .trade-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .page-header,
  .section-header {
    flex-direction: column;
    align-items: start;
  }

  .live-status {
    justify-items: start;
  }

  .live-status__text {
    text-align: left;
  }

  .trade-grid,
  .levels {
    grid-template-columns: 1fr;
  }

  .board-section {
    padding: 16px;
  }

  .view-toggle {
    width: 100%;
    justify-content: stretch;
  }

  .view-toggle__button {
    flex: 1 1 0;
    text-align: center;
  }
}
