*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
}

.screen {
  width: 600px;
  height: 600px;
  display: flex;
  flex-direction: column;
}

.positive { color: #00c87a; }
.negative { color: #ff4444; }

.hint {
  font-size: 11px;
  color: #333;
  letter-spacing: 0.1em;
}

/* ── Menu View ──────────────────────────── */

.menu-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ticker-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ticker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  height: 74px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #111;
  transition: border-color 0.1s, background 0.1s;
}

.ticker-item.active {
  border-left-color: #00c87a;
  background: #0a1a12;
}

.ticker-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ticker-symbol {
  font-size: 20px;
  font-weight: bold;
  color: #aaa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticker-item.active .ticker-symbol { color: #fff; }

.ticker-full-name {
  font-size: 13px;
  color: #444;
}

.ticker-item.active .ticker-full-name { color: #666; }

.ticker-spark {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  opacity: 0.85;
}

.ticker-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.ticker-price {
  font-size: 22px;
  font-weight: bold;
  color: #ccc;
}

.ticker-item.active .ticker-price { color: #fff; }

.ticker-change {
  font-size: 18px;
}

/* ── Menu top bar ───────────────────────── */

.menu-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #111;
}

.menu-brand {
  font-size: 11px;
  color: #333;
  letter-spacing: 0.1em;
}

.menu-topbar-btns {
  display: flex;
  gap: 6px;
}

.topbar-btn {
  background: none;
  border: 1px solid #222;
  color: #555;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.topbar-btn-add {
  color: #00c87a;
  border-color: #1e3d2a;
}

.topbar-btn.topbar-focused {
  color: #fff;
  border-color: #00c87a;
  background: rgba(0, 200, 122, 0.1);
}

.menu-editing-badge {
  font-size: 12px;
  color: #ff8844;
  letter-spacing: 0.05em;
}

/* ── Edit mode rows ─────────────────────── */

.ticker-item-edit {
  cursor: default;
}

.edit-dot {
  flex: 0 0 auto;
  font-size: 13px;
  color: #2a2a2a;
  width: 18px;
  text-align: center;
  margin-right: 4px;
}

.edit-dot-active { color: #ff8844; }
.edit-dot-danger { color: #ff4444; }

.ticker-item-swiped {
  background: #1a0000 !important;
  border-left-color: #ff4444 !important;
}

.ticker-symbol-danger { color: #ff6666 !important; }

.ticker-delete-btn {
  flex: 0 0 auto;
  background: #ff4444;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.06em;
  padding: 0 16px;
  display: flex;
  align-items: center;
  margin: -1px -1px -1px 0;
  border-radius: 0 2px 2px 0;
}

.ticker-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.menu-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 22px;
  border-top: 1px solid #111;
}

/* ── Add Stock screen ───────────────────── */

.add-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 20px 14px;
}

.add-header {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.add-title {
  display: block;
  font-size: 11px;
  color: #444;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.add-input-bar {
  background: #0a0a0a;
  border: 1px solid #1e3d2a;
  border-radius: 4px;
  padding: 8px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.add-input-text {
  font-size: 28px;
  font-weight: bold;
  color: #00c87a;
  letter-spacing: 0.12em;
}

.add-blink {
  animation: blink 1s step-end infinite;
  color: #00c87a;
  border-bottom: 2px solid #00c87a;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.add-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  align-content: start;
  margin-bottom: 10px;
}

.add-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  font-size: 16px;
  color: #555;
  border: 1px solid #111;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.08s, border-color 0.08s, background 0.08s;
}

.add-cell.add-cursor {
  color: #fff;
  border-color: #00c87a;
  background: rgba(0, 200, 122, 0.12);
}

.add-cell.add-special {
  color: #444;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.add-cell.add-special.add-cursor {
  color: #fff;
}

.add-status {
  flex: 0 0 auto;
  font-size: 12px;
  color: #555;
  text-align: center;
  min-height: 18px;
  letter-spacing: 0.04em;
}

.add-status-ok  { color: #00c87a; }
.add-status-err { color: #ff6666; }

/* ── Chart View ─────────────────────────── */

.chart-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 20px 14px;
}

.chart-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.back-btn {
  background: none;
  border: 1px solid #2a2a2a;
  color: #888;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.back-btn:active { color: #fff; border-color: #555; }

.back-btn.nav-focused,
.ind-btn.nav-focused {
  color: #fff;
  border-color: #00c87a;
  background: rgba(0, 200, 122, 0.1);
}

.ind-btn {
  background: none;
  border: 1px solid #2a2a2a;
  color: #555;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.chart-date {
  font-size: 13px;
  color: #444;
  letter-spacing: 0.04em;
}

.chart-header { flex: 0 0 auto; margin-bottom: 8px; }

.chart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.stock-name {
  font-size: 20px;
  font-weight: bold;
  color: #aaa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rsi-badge {
  font-size: 13px;
  color: #555;
  letter-spacing: 0.05em;
}

.rsi-badge.rsi-high   { color: #ff6b6b; }
.rsi-badge.rsi-low    { color: #00c87a; }
.rsi-badge.rsi-normal { color: #888; }

.chart-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stock-price-sm {
  font-size: 30px;
  font-weight: bold;
}

.stock-change-sm { font-size: 18px; }

.chart-area-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

.chart-area {
  width: 100%;
  height: 100%;
  background: #070707;
  border-radius: 4px;
  overflow: hidden;
}

.period-strip {
  flex: 0 0 auto;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.period-bar { display: flex; gap: 2px; align-items: center; }

.period {
  font-size: 13px;
  color: #3a3a3a;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}

.period.period-active {
  color: #9fe9c4;
  border-color: #1f5f45;
  background: rgba(0, 200, 122, 0.04);
}

.period-bar.period-bar-focused .period.period-active {
  color: #fff;
  border-color: #00c87a;
  background: rgba(0, 200, 122, 0.08);
}

/* ── Indicators Panel ────────────────────── */

.indicators-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.92);
  border-top: 1px solid #1e1e1e;
  padding: 12px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.ind-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.ind-row.ind-row-focused {
  border-color: #00c87a;
  background: rgba(0, 200, 122, 0.07);
}

.ind-dot {
  font-size: 14px;
  color: #444;
  width: 14px;
}

.ind-row.ind-row-focused .ind-dot { color: #00c87a; }

.ind-label {
  flex: 1;
  font-size: 15px;
  color: #888;
}

.ind-row.ind-row-focused .ind-label { color: #fff; }

.ind-status {
  font-size: 12px;
  color: #333;
  letter-spacing: 0.06em;
}

.ind-status.ind-on { color: #00c87a; }

.ind-hint {
  font-size: 10px;
  color: #2a2a2a;
  letter-spacing: 0.08em;
  text-align: center;
  margin-top: 4px;
}
