body {
  background: #080b0e;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  padding: max(12px, env(safe-area-inset-top)) 10px calc(88px + env(safe-area-inset-bottom));
}

.app-topbar,
.topbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px;
  min-height: 0;
  margin-bottom: 10px;
}

.brand-lockup {
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 28px;
}

.brand-lockup strong {
  font-size: 22px;
  line-height: 1;
}

.brand-lockup small {
  margin-top: 4px;
  font-size: 12px;
}

.compact-controls,
.topbar-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 44px;
  gap: 8px;
}

.select-control,
.quiet-button,
.primary-action,
.secondary-link {
  min-height: 42px;
  border-radius: 8px;
}

.compact-controls .select-control {
  width: 100%;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-button svg,
.bottom-nav svg,
.trend-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-screens {
  display: block;
}

.screen {
  display: none;
}

.screen.is-active {
  display: grid;
  gap: 10px;
}

.time-panel,
.pulse-panel,
.panel,
.market-chart-card,
.activity-card,
.review-decision-card,
.feed-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 27, 34, 0.96), rgba(11, 15, 19, 0.96));
}

.time-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  border-color: rgba(98, 201, 255, 0.18);
}

.time-cell {
  min-width: 0;
  padding: 14px 12px;
}

.time-cell + .time-cell {
  border-left: 1px solid var(--line);
}

.time-cell span,
.setting-row span,
.detail-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.time-cell strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 8vw, 34px);
  line-height: 1;
}

.session-time-cell strong {
  color: var(--cyan);
  text-transform: uppercase;
}

.time-cell small,
.time-cell em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.25;
}

.time-cell em {
  color: var(--cyan);
  font-weight: 900;
}

.pulse-panel,
.panel {
  padding: 14px;
}

.section-title-row,
.market-chart-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.eyebrow,
.section-heading p,
.section-title-row p {
  margin: 0 0 4px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-title-row h1,
.section-title-row h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
}

.quiet-summary,
.live-feed-note,
.state-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
}

.next-candle-pill,
.grade-pill,
.meta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.opportunity-list,
.chart-grid,
.activity-list,
.feed-meta-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.opportunity-card {
  width: 100%;
  min-height: 102px;
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.opportunity-card.is-selected {
  border-color: rgba(154, 98, 255, 0.68);
}

.opportunity-symbol {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.opportunity-symbol strong {
  font-size: 26px;
  line-height: 1;
}

.opportunity-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.opportunity-copy strong {
  font-size: 22px;
  line-height: 1.08;
}

.opportunity-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.opportunity-card em {
  min-width: 58px;
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
}

.trade-buy {
  border-color: rgba(98, 227, 111, 0.52);
  background: linear-gradient(180deg, rgba(98, 227, 111, 0.11), rgba(255, 255, 255, 0.03));
}

.trade-buy .trend-icon,
.trade-buy .opportunity-copy strong,
.trade-buy .market-chart-head p,
.trade-buy .review-decision-card em,
.grade-pill.trade-buy {
  color: var(--green);
}

.trade-sell {
  border-color: rgba(255, 86, 86, 0.52);
  background: linear-gradient(180deg, rgba(255, 86, 86, 0.12), rgba(255, 255, 255, 0.03));
}

.trade-sell .trend-icon,
.trade-sell .opportunity-copy strong,
.trade-sell .market-chart-head p,
.trade-sell .review-decision-card em,
.grade-pill.trade-sell {
  color: var(--red);
}

.trade-wait .trend-icon,
.trade-wait .opportunity-copy strong,
.grade-pill.trade-wait {
  color: var(--muted);
}

.timeframe-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(48px, 1fr);
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.timeframe-strip::-webkit-scrollbar {
  display: none;
}

.timeframe-chip,
.toggle-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.timeframe-chip.is-active,
.toggle-chip.is-active,
.nav-item.is-active {
  border-color: rgba(154, 98, 255, 0.8);
  background: rgba(154, 98, 255, 0.2);
  color: var(--purple);
}

.chart-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.market-chart-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.market-chart-head p,
.market-chart-head h3,
.review-decision-card strong,
.review-decision-card small {
  margin: 0;
}

.market-chart-head h3 {
  font-size: 22px;
  line-height: 1;
}

.market-chart-head p {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.market-chart-head span {
  max-width: 112px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
}

.mini-chart-stage,
.chart-stage {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1217;
}

.mini-chart-stage {
  min-height: 260px;
}

.chart-stage {
  height: 340px;
  min-height: 340px;
  margin-top: 12px;
}

.market-chart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tradingview-link {
  width: 100%;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

body.chart-is-expanded {
  overflow: hidden;
}

.market-chart-card.is-expanded {
  position: fixed;
  inset: max(10px, env(safe-area-inset-top)) 8px calc(82px + env(safe-area-inset-bottom));
  z-index: 60;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

.market-chart-card.is-expanded .mini-chart-stage {
  min-height: min(68vh, 620px);
}

.review-decision-card {
  min-height: 90px;
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
}

.review-decision-card > span {
  display: grid;
  gap: 6px;
}

.review-decision-card > span strong {
  font-size: 24px;
  line-height: 1;
}

.review-decision-card div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.review-decision-card div strong {
  font-size: 20px;
  line-height: 1.1;
}

.review-decision-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.review-decision-card em {
  min-width: 56px;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.overlay-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.compact-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.detail-card,
.setting-row,
.feed-meta-card,
.score-row,
.activity-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.detail-card {
  min-height: 64px;
  padding: 10px;
}

.detail-card strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.score-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compact-score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px;
}

.compact-score-row span {
  color: var(--text);
  font-weight: 900;
}

.compact-score-row strong {
  color: var(--purple);
}

.compact-score-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.activity-card {
  padding: 12px;
}

.activity-card h3 {
  margin: 0;
  font-size: 18px;
}

.activity-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.setting-row {
  min-height: 62px;
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-top: 10px;
}

.setting-row strong,
.setting-row output {
  font-size: 18px;
  font-weight: 900;
}

#thresholdRange {
  width: 100%;
  margin: 12px 0;
  accent-color: var(--purple);
}

.feed-status-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-color: rgba(98, 227, 111, 0.28);
}

.feed-status-card p,
.feed-meta-card small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.feed-meta-grid {
  margin-top: 0;
}

.feed-meta-card {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.feed-meta-card span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 80;
  width: min(410px, calc(100% - 16px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 8, 10, 0.94);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-width: 0;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 5px 2px;
  border-radius: 8px;
}

.nav-item span {
  max-width: 100%;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .app-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .time-panel,
  .compact-detail-grid {
    grid-template-columns: 1fr;
  }

  .time-cell + .time-cell {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .opportunity-card,
  .review-decision-card {
    grid-template-columns: 72px 1fr;
  }

  .opportunity-card em,
  .review-decision-card em {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 38px;
    text-align: center;
  }
}

@media (min-width: 720px) {
  .app-shell {
    width: min(100%, 460px);
  }

  .mini-chart-stage {
    min-height: 300px;
  }
}
