
:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #14181d;
  --panel2: #1a2027;
  --text: #f4f7fa;
  --muted: #8b96a5;
  --line: #2a313a;
  --accent: #f6b73c;
  --buy: #65d68b;
  --sell: #ff7171;
  --wait: #9aa6b2;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
button { font: inherit; }

.shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
h1 { margin: 3px 0 0; font-size: 32px; letter-spacing: -.04em; }
h2 { margin: 0 0 14px; font-size: 18px; }

.ghost, .seg, .primary {
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.ghost {
  background: transparent;
  color: var(--text);
  padding: 9px 14px;
}
.status-card, .logic, .safety {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.label, .muted { color: var(--muted); font-size: 13px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: #0f1216; border-radius: 12px; padding: 3px; }
.seg {
  min-width: 74px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  border: 0;
}
.seg.active { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

.signal-wrap { text-align: center; padding: 28px 0 22px; }
.signal { font-size: 58px; font-weight: 800; letter-spacing: -.05em; line-height: 1; margin: 8px 0 10px; }
.signal.buy { color: var(--buy); }
.signal.sell { color: var(--sell); }
.signal.hold { color: var(--accent); }
.signal.wait { color: var(--wait); }
.signal-note { color: var(--muted); font-size: 14px; min-height: 21px; }

.primary {
  width: 100%;
  padding: 15px;
  border-color: transparent;
  background: var(--accent);
  color: #17120a;
  font-weight: 800;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  min-width: 0;
}
.metric span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 7px; }
.metric strong { font-size: 17px; letter-spacing: -.02em; word-break: break-word; }

.logic { margin-top: 12px; }
.rule { display: grid; grid-template-columns: 12px 1fr; gap: 11px; align-items: start; padding: 10px 0; color: #dbe2e9; line-height: 1.45; font-size: 14px; }
.rule + .rule { border-top: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; }
.dot.buy { background: var(--buy); }
.dot.sell { background: var(--sell); }
.dot.hold { background: var(--accent); }

.safety { margin-top: 12px; }
.safety b { font-size: 14px; }
.safety p { color: var(--muted); margin: 7px 0 0; font-size: 13px; line-height: 1.5; }

footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  padding: 14px 3px 0;
}

.error {
  background: #2a1618;
  border: 1px solid #5d2b31;
  color: #ffb7bf;
}

@media (max-width: 360px) {
  .signal { font-size: 50px; }
  .metric strong { font-size: 15px; }
  .seg { min-width: 64px; }
}


/* ===== Mobile V1.1 signal emphasis ===== */
.status-card {
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.status-card.signal-buy {
  border-color: rgba(101, 214, 139, .5);
}

.status-card.signal-sell {
  border-color: rgba(255, 113, 113, .55);
}

.status-card.signal-hold {
  border-color: rgba(246, 183, 60, .45);
}

.status-card.signal-wait {
  border-color: var(--line);
}

.status-card.signal-alert::before {
  content: "";
  position: absolute;
  inset: -45%;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%);
  animation: pulseGlow 1.7s ease-in-out infinite;
  pointer-events: none;
}

.status-card.signal-buy.signal-alert {
  box-shadow:
    0 0 0 1px rgba(101, 214, 139, .35),
    0 0 28px rgba(101, 214, 139, .22);
  background:
    linear-gradient(180deg, rgba(101,214,139,.07), rgba(20,24,29,1) 46%);
}

.status-card.signal-sell.signal-alert {
  box-shadow:
    0 0 0 1px rgba(255, 113, 113, .35),
    0 0 28px rgba(255, 113, 113, .22);
  background:
    linear-gradient(180deg, rgba(255,113,113,.07), rgba(20,24,29,1) 46%);
}

.new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 24px;
  margin: 0 auto 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #17120a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  box-shadow: 0 0 18px rgba(246,183,60,.28);
  animation: badgePop .35s ease-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(.92); opacity: .35; }
  50% { transform: scale(1.05); opacity: .75; }
}

@keyframes badgePop {
  from { transform: scale(.72); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .status-card.signal-alert::before,
  .new-badge {
    animation: none;
  }
}
