:root {
  --bg: #090c12;
  --surface: #111622;
  --surface-elevated: #171e2e;
  --surface-hover: #1d2638;
  --border: #242e42;
  --border-strong: #33415c;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --up: #16c784;
  --up-bg: rgba(22, 199, 132, 0.14);
  --down: #ea3943;
  --down-bg: rgba(234, 57, 67, 0.15);
  --accent: #38bdf8;
  --accent-bg: rgba(56, 189, 248, 0.14);
  --gold: #f5b942;
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

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

.app-shell {
  width: 100%;
  max-width: 640px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(9, 12, 18, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.brand > div {
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(245, 185, 66, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand-gold {
  color: var(--gold);
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #060912;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.splash-screen.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  width: min(250px, 68vw);
  height: auto;
  border-radius: 20px;
  object-fit: contain;
}

.splash-bar {
  width: 150px;
  height: 3px;
  border-radius: 999px;
  background: var(--surface-elevated);
  overflow: hidden;
}

.splash-progress {
  display: block;
  width: 55%;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
  animation: splashSlide 900ms ease-in-out infinite alternate;
}

@keyframes splashSlide {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(100%);
  }
}

.brand-sub {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.live-badge.connected {
  color: var(--up);
  border-color: rgba(22, 199, 132, 0.4);
  background: var(--up-bg);
}

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

.icon-btn {
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

/* Search */
.search-wrap {
  position: relative;
  padding: 12px 16px 4px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 150ms ease;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  min-height: 44px;
  padding: 10px 40px 10px 38px;
  background: transparent;
  border: 0;
  font-size: 14px;
}

#searchInput::placeholder {
  color: var(--text-dim);
}

.search-clear {
  position: absolute;
  right: 4px;
  min-width: 36px;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.search-dropdown {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 60px;
  z-index: 40;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

.search-item {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.search-item:last-child {
  border-bottom: 0;
}

.search-item:hover {
  background: var(--surface-hover);
}

/* Main Content */
.main-content {
  padding: 12px 16px 20px;
  flex: 1;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.seg-btn {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.seg-btn.active {
  background: var(--surface-elevated);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.notice-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: var(--warn-bg);
  color: #fde68a;
  font-size: 12.5px;
  margin-bottom: 12px;
}

/* Card */
.card {
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  overflow: hidden;
}

.detail-card {
  margin-bottom: 16px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-head > div:first-child {
  min-width: 0;
  flex: 1;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-symbol {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill-exchange,
.pill-status {
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.pill-status.open {
  color: var(--up);
  border-color: rgba(22, 199, 132, 0.4);
  background: var(--up-bg);
}

.detail-name {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.detail-price-col {
  text-align: right;
}

.detail-price {
  font-size: 20px;
  font-weight: 700;
}

.detail-change {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

/* Chart */
.chart-stage {
  margin: 8px 0 10px;
}

.chart-scrub-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 20px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  border-radius: var(--radius-md);
  background: #0c1019;
  border: 1px solid var(--border);
  overflow: hidden;
}

#priceChartCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  cursor: crosshair;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.range-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.range-btn {
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.range-btn.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.metric-cell {
  min-width: 0;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: #0d121d;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-val {
  font-size: 12.5px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.action-btn {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 120ms ease, background-color 150ms ease, border-color 150ms ease;
}

.action-btn:active {
  transform: scale(0.98);
}

.action-btn.primary {
  background: var(--up);
  color: #05130c;
}

.action-btn.primary:hover {
  background: #1ed690;
}

.action-btn.secondary {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}

.action-btn.secondary:hover {
  background: var(--surface-hover);
}

.action-btn.full {
  width: 100%;
}

.source-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}

/* Section headers & Ticker list */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-header.spaced {
  margin-top: 18px;
}

.section-header h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.ticker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticker-row {
  width: 100%;
  min-height: 60px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.ticker-row:hover {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
}

.ticker-row.selected {
  border-color: var(--accent);
  background: var(--surface-elevated);
}

.ticker-row.flash-up {
  animation: tickUp 650ms ease-out;
}

.ticker-row.flash-down {
  animation: tickDown 650ms ease-out;
}

@keyframes tickUp {
  0% {
    background-color: var(--up-bg);
  }
  100% {
    background-color: var(--surface);
  }
}

@keyframes tickDown {
  0% {
    background-color: var(--down-bg);
  }
  100% {
    background-color: var(--surface);
  }
}

.ticker-left {
  min-width: 0;
  flex: 1;
}

.ticker-sym-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticker-sym {
  font-weight: 700;
  font-size: 14.5px;
}

.ticker-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.ticker-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-right {
  text-align: right;
  flex-shrink: 0;
}

.ticker-price {
  font-weight: 600;
  font-size: 14px;
}

.change-pill {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.change-pill.up {
  background: var(--up-bg);
  color: var(--up);
}

.change-pill.down {
  background: var(--down-bg);
  color: var(--down);
}

.change-pill.flat {
  background: var(--surface-elevated);
  color: var(--text-muted);
}

/* Crypto KPI */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.kpi-card {
  min-width: 0;
  padding: 10px 9px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.kpi-label {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-toggle {
  display: inline-flex;
  gap: 4px;
}

.mini-btn {
  min-height: 36px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mini-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* FX */
.card-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

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

.fx-input-group,
.fx-select-wrap,
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fx-input-group label,
.fx-select-wrap label,
.field label {
  font-size: 12px;
  color: var(--text-muted);
}

.fx-input-group input,
.fx-select-wrap select,
.field input,
.field select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #0d121d;
  font-size: 14px;
}

.fx-pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  width: 100%;
}

.fx-select-wrap {
  min-width: 0;
}

.fx-select-with-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #0d121d;
  overflow: hidden;
}

.fx-select-with-flag:focus-within {
  border-color: var(--accent);
}

.fx-select-with-flag select {
  width: 100%;
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  text-overflow: ellipsis;
}

.fx-select-with-flag select:focus-visible {
  outline: none;
}

.fx-flag-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flag-svg {
  width: 24px;
  height: 17px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: block;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.fx-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.fx-result-main {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--up);
  word-break: break-word;
}

.fx-result-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.fx-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #0d121d;
  border: 1px solid var(--border);
}

.fx-result-main {
  font-size: 18px;
  font-weight: 700;
  color: var(--up);
}

.fx-result-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Personal rows */
.personal-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.personal-actions {
  display: flex;
  gap: 6px;
}

.chip-btn {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn.danger {
  color: var(--down);
  border-color: rgba(234, 57, 67, 0.35);
}

.attribution-note,
.disclaimer-bar {
  margin: 14px 0 4px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 640px;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(11, 15, 24, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}

.nav-btn {
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-btn.active {
  color: var(--accent);
  background: var(--accent-bg);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px));
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: 92vw;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.empty-state {
  padding: 20px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Desktop top nav (hidden on mobile) */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.dnav-btn {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.dnav-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.dnav-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
}

/* Market Pulse Strip */
.pulse-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.pulse-card {
  min-width: 0;
  padding: 9px 9px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.pulse-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-elevated);
}

.pulse-label {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-val {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sector Chips */
.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
  display: none;
}

.sector-chip {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.sector-chip.active {
  border-color: var(--gold);
  background: rgba(245, 185, 66, 0.14);
  color: var(--gold);
}

.pill-sector {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 185, 66, 0.12);
  border: 1px solid rgba(245, 185, 66, 0.35);
  color: var(--gold);
}

.market-session-note {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text-dim);
}

.market-session-note.open {
  color: var(--up);
}

.detail-idr-est {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Daily Range Meter */
.range-meter {
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: #0d121d;
  border: 1px solid var(--border);
}

.range-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.range-meter-caption {
  font-size: 11px;
  color: var(--accent);
}

.range-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-elevated);
  margin-bottom: 7px;
}

.range-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--down), var(--gold), var(--up));
  width: 50%;
}

.range-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.55);
}

.range-meter-ends {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* Info Banner for Web Browser Mode */
.info-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.09);
  color: #e0f2fe;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.banner-cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #06131f;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

/* Glossary Modal */
.guide-sheet {
  max-height: 82dvh;
  overflow-y: auto;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-item {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: #0d121d;
  border: 1px solid var(--border);
}

.guide-item strong {
  display: block;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 4px;
}

.guide-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.spaced-mobile {
  margin-top: 18px;
}

/* Desktop 2-Column Responsive Workspace (>= 1024px) */
@media (min-width: 1024px) {
  .app-shell {
    max-width: 1160px;
    padding-bottom: 24px;
  }

  .desktop-nav {
    display: inline-flex;
  }

  .bottom-nav {
    display: none;
  }

  .stocks-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
    align-items: start;
  }

  .workspace-primary {
    position: sticky;
    top: 76px;
  }

  .chart-canvas-wrap {
    height: 240px;
  }

  .two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }

  .spaced-mobile {
    margin-top: 0;
  }

  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }

  .modal-sheet {
    max-width: 480px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
  }
}

/* Top Loading Progress Bar & Shimmer Skeleton Loaders */
.top-loader {
  position: sticky;
  top: 60px;
  z-index: 29;
  width: 100%;
  height: 2px;
  background: rgba(245, 185, 66, 0.14);
  overflow: hidden;
}

.top-loader-bar {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--gold);
  animation: topLoadSlide 950ms ease-in-out infinite;
}

@keyframes topLoadSlide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(300%);
  }
}

.icon-btn.spinning svg {
  animation: spin360 750ms linear infinite;
}

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

.skel {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface-elevated) 20%,
    #242f45 50%,
    var(--surface-elevated) 80%
  );
  background-size: 220% 100%;
  animation: shimmer 1.25s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.skel-row {
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skel-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.skel-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.skel-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

.skel-flag {
  width: 26px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skel-title {
  width: 78px;
  height: 14px;
}

.skel-sub {
  width: 132px;
  max-width: 85%;
  height: 11px;
}

.skel-price {
  width: 84px;
  height: 14px;
}

.skel-pill {
  width: 54px;
  height: 18px;
  border-radius: 6px;
}

.chart-skeleton {
  position: absolute;
  inset: 0;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #0c1019;
}

.skel-chart-line {
  width: 100%;
  height: 112px;
  border-radius: 10px;
}

.skel-chart-bar {
  width: 55%;
  height: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .ticker-row.flash-up,
  .ticker-row.flash-down,
  .splash-progress,
  .skel,
  .top-loader-bar,
  .icon-btn.spinning svg {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
