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

:root {
  --bg: #090c10;
  --bg-subtle: #0d1117;
  --surface: #131921;
  --surface-hover: #1a2233;
  --surface-raised: #182030;
  --border: #1c2536;
  --border-light: #253147;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #545d68;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-dim: rgba(88, 166, 255, 0.1);
  --positive: #3fb950;
  --positive-dim: rgba(63, 185, 80, 0.1);
  --negative: #f85149;
  --negative-dim: rgba(248, 81, 73, 0.1);
  --warning: #d29922;
  --radius: 10px;
  --radius-sm: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

nav {
  display: flex;
  gap: 2px;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Main ───────────────────────────────────────── */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 28px 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Page Intro ─────────────────────────────────── */

.page-intro {
  margin-bottom: 4px;
}

.page-intro h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.page-intro p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ── How It Works ──────────────────────────────── */

.how-it-works {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}

.how-it-works summary {
  padding: 10px 14px;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s;
  list-style: none;
}

.how-it-works summary::before {
  content: '+ ';
  color: var(--accent);
  font-weight: 700;
}

.how-it-works[open] summary::before {
  content: '- ';
}

.how-it-works summary:hover {
  color: var(--text);
}

.how-it-works-body {
  padding: 0 14px 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.how-it-works-body p {
  margin-bottom: 8px;
}

.how-it-works-body p:last-child {
  margin-bottom: 0;
}

.how-it-works-body strong {
  color: var(--text);
}

/* ── Card ───────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}

.card .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.card-header .subtitle {
  margin-bottom: 0;
}

/* ── Forms ──────────────────────────────────────── */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

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

.field > label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

input, select {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range span {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.date-range input {
  flex: 1;
  min-width: 0;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field input {
  flex: 1;
}

.inline-field select {
  flex: 1.5;
}

.unit, .unit-prefix {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Logic Toggle ──────────────────────────────── */

.logic-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.logic-btn {
  background: var(--bg-subtle);
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.logic-btn:first-child {
  border-right: 1px solid var(--border);
}

.logic-btn:hover {
  color: var(--text-secondary);
}

.logic-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Conditions ─────────────────────────────────── */

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.condition-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.condition-row select,
.condition-row input {
  background: var(--surface);
  border-color: var(--border);
}

/* ── Searchable Select ──────────────────────────── */

.searchable-select {
  position: relative;
  min-width: 300px;
  flex-shrink: 0;
}

.ss-display {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 9px 30px 9px 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.ss-display:hover,
.ss-display:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.ss-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 360px;
  max-height: 380px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  z-index: 150;
  flex-direction: column;
  overflow: hidden;
}

.ss-dropdown.open {
  display: flex;
}

.ss-search {
  margin: 10px;
  padding: 9px 12px;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  flex-shrink: 0;
}

.ss-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.ss-list {
  overflow-y: auto;
  padding: 0 6px 8px;
  flex: 1;
}

.ss-group {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 10px 5px;
  position: sticky;
  top: 0;
  background: var(--surface);
}

.ss-item {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
}

.ss-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.ss-item.selected {
  color: var(--accent);
  background: var(--accent-dim);
}

.ss-item.ss-custom {
  color: var(--accent);
  font-style: italic;
}

.condition-row input[type="number"] {
  width: 90px;
}

.condition-row .condition-value-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.condition-row .condition-value-field input {
  width: 100%;
}

.condition-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.condition-remove:hover {
  color: var(--negative);
  background: var(--negative-dim);
}

.empty-state {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

/* ── Toggle / Switch ────────────────────────────── */

.toggle-field {
  gap: 14px;
}

.toggle-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: white;
}

.toggle-body {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-left: 50px;
}

.toggle-body.active {
  display: flex;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* ── Buttons ────────────────────────────────────── */

.btn {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-small {
  background: var(--surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-small:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  font-weight: 600;
  padding: 11px 32px;
  font-size: 14px;
  box-shadow: 0 2px 12px rgba(88, 166, 255, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(88, 166, 255, 0.35);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 11px 20px;
  font-size: 14px;
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ── Action Bar ─────────────────────────────────── */

.action-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

/* ── Results ────────────────────────────────────── */

.results-card {
  border-color: var(--accent);
  border-width: 1px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-subtle) 100%);
}

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

.results-header h2 {
  margin-bottom: 0;
}

.results-elapsed {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.results-warnings {
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--warning);
  margin-bottom: 16px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  position: relative;
}

.stat-help {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: all 0.15s;
  line-height: 1;
}

.stat-help:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.stat-tooltip {
  display: none;
  position: absolute;
  top: -8px;
  right: 28px;
  background: var(--surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  width: 220px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-transform: none;
  letter-spacing: normal;
  pointer-events: none;
}

.stat-help:hover + .stat-tooltip {
  display: block;
}

.results-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hint-icon-sample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.stat-value.positive { color: var(--positive); }
.stat-value.negative { color: var(--negative); }

.chart-container {
  height: 280px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}

/* ── Custom Requirement Modal ───────────────────── */

.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

.custom-modal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 32px;
  width: 520px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.custom-modal h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -12px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.modal-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.modal-field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

/* AI-interpreted badge */
.custom-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* ── Custom Edit Button ─────────────────────────── */

.custom-edit-btn {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.custom-edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── Results Tabs ──────────────────────────────── */

.results-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.results-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.results-tab:hover {
  color: var(--text);
}

.results-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Monthly Heatmap ───────────────────────────── */

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.heatmap-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.heatmap-table th:first-child {
  text-align: left;
}

.heatmap-table td {
  padding: 6px;
  text-align: center;
  font-weight: 500;
  font-size: 11px;
  border-radius: 3px;
}

.heatmap-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
}

.heatmap-table td.ytd-col {
  font-weight: 700;
  border-left: 1px solid var(--border);
}

/* ── Drawdown Table ────────────────────────────── */

.dd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dd-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dd-table td {
  padding: 8px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.dd-table tr:last-child td {
  border-bottom: none;
}

.dd-table .dd-depth {
  color: var(--negative);
  font-weight: 600;
}

.dd-table .dd-ongoing {
  color: var(--warning);
  font-style: italic;
}

/* ── Yearly Returns Table ──────────────────────── */

.yearly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.yearly-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.yearly-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.yearly-table tr:last-child td {
  border-bottom: none;
}

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 900px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
  .results-tabs { overflow-x: auto; }
}

/* ── Custom Universe ───────────────────────────── */

.custom-universe-display {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.custom-universe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.custom-universe-header span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.custom-ticker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticker-tag {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticker-tag .tag-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
}

.ticker-tag .tag-remove:hover {
  color: var(--negative);
}

.universe-search-wrapper {
  position: relative;
}

.universe-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-height: 250px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.universe-search-results:empty {
  display: none;
}

.search-result-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

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

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

.search-result-item .sr-code {
  font-weight: 600;
  color: var(--accent);
  min-width: 70px;
}

.search-result-item .sr-name {
  color: var(--text-secondary);
  flex: 1;
  margin-left: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-item .sr-type {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 10px;
}

.search-result-item.already-added {
  opacity: 0.4;
  cursor: default;
}

.universe-modal-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.universe-modal-tickers:empty::before {
  content: "No tickers added yet. Search above to add stocks.";
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  header { padding: 0 16px; }
  main { padding: 16px 12px 100px; }
  .form-row { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .condition-row { flex-wrap: wrap; }
  .searchable-select { min-width: 200px; }
  .ss-dropdown { width: 280px; }
  .toggle-body { padding-left: 0; }
  .results-tabs { gap: 0; }
  .results-tab { padding: 8px 10px; font-size: 12px; }
}
