:root {
  --bg: #eef2f1;
  --panel: #ffffff;
  --ink: #17201d;
  --muted: #63736e;
  --line: #d8e0dd;
  --accent: #087f8c;
  --accent-2: #d85a42;
  --good: #087a52;
  --bad: #b43b3b;
  --shadow: 0 18px 48px rgba(28, 45, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.13), transparent 34%),
    linear-gradient(315deg, rgba(216, 90, 66, 0.12), transparent 38%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar,
.hero-panel,
.list-heading,
.filter-heading,
.follow-form {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow,
.hero-panel p,
.list-heading span,
.empty {
  color: var(--muted);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0;
}

.follow-form {
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.follow-form input {
  width: 150px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
}

.follow-form button,
.icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  padding: 0 14px;
  cursor: pointer;
}

.hero-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.hero-panel {
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin-bottom: 18px;
}

.hero-panel h2 {
  font-size: clamp(1.3rem, 2.4vw, 2.2rem);
}

.hero-panel p {
  max-width: 850px;
  margin-top: 8px;
  line-height: 1.5;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faf9;
  padding: 2px 5px;
}

.status-card {
  min-width: 150px;
  border-left: 4px solid var(--accent-2);
  padding: 8px 0 8px 16px;
}

.status-card strong {
  display: block;
  font-size: 2rem;
}

.status-card span {
  color: var(--muted);
}

.filter-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.filter-heading {
  justify-content: space-between;
  gap: 12px;
}

.filter-heading h2 {
  font-size: 1.05rem;
}

.filter-heading a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.preset-row {
  display: grid;
  grid-template-columns: minmax(360px, 0.6fr) minmax(280px, 1fr);
  gap: 12px 18px;
  align-items: start;
}

.preset-save {
  display: grid;
  grid-template-columns: 110px minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.preset-save span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.preset-save input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
}

.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-list a,
.preset-list button,
.external-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.preset-list a {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
}

.preset-list button {
  width: 34px;
  cursor: pointer;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.sort-row {
  display: grid;
  grid-template-columns: minmax(360px, 0.5fr);
}

.filter-control,
.sort-control {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) 104px minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
}

.sort-control {
  grid-template-columns: 90px minmax(150px, 1fr) minmax(150px, 1fr);
}

.filter-control span,
.sort-control span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-control select,
.filter-control input,
.sort-control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.chooser-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.check-panel {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.check-panel legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.check-scroll {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 4px 2px;
}

.check-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 5px 6px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.check-option:hover {
  border-color: var(--line);
  background: #f8faf9;
}

.check-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.check-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel > button,
.preset-save button {
  justify-self: start;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  padding: 0 14px;
  cursor: pointer;
}

.lists {
  display: grid;
  gap: 18px;
}

.list-panel {
  padding: 16px;
}

.list-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.list-heading h2 {
  font-size: 1.15rem;
}

.table-wrap {
  overflow: auto;
}

.stock-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.stock-table th,
.stock-table td {
  min-height: 58px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.stock-table th {
  color: var(--muted);
  background: #f8faf9;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.stock-table td {
  font-size: 0.9rem;
}

.rank-cell {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.ticker-link {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.ticker-link:hover,
.detail-link:hover {
  text-decoration: underline;
}

.detail-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.company-cell {
  max-width: 180px;
  font-weight: 700;
}

.description-cell {
  width: 30%;
  min-width: 260px;
  color: var(--muted);
  line-height: 1.35;
}

.classes-cell {
  min-width: 180px;
}

.classes-cell span {
  display: inline-block;
  margin: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  background: #f8faf9;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.sharp-badge {
  display: inline-grid;
  min-width: 48px;
  min-height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf9;
  color: var(--ink);
  font-weight: 900;
}

.sharp-badge.smooth {
  border-color: rgba(8, 122, 82, 0.28);
  color: var(--good);
  background: rgba(8, 122, 82, 0.08);
}

.sharp-badge.noisy {
  border-color: rgba(180, 59, 59, 0.25);
  color: var(--bad);
  background: rgba(180, 59, 59, 0.08);
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: var(--accent-2);
  font-size: 1.2rem;
}

.sparkline {
  display: block;
  width: 180px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.sparkline path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.external-button {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.detail-chart-panel {
  min-width: 0;
}

.detail-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.detail-chart path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.volume-chart {
  min-height: 180px;
}

.volume-chart path {
  stroke: var(--accent-2);
}

.metrics-panel h2,
.detail-grid h2 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}

.metric-grid dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid dd {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.detail-description {
  color: var(--muted);
  line-height: 1.5;
}

.detail-classes {
  margin-top: 14px;
}

.positive {
  color: var(--good);
  font-weight: 800;
}

.negative {
  color: var(--bad);
  font-weight: 800;
}

.empty {
  padding: 24px 4px;
}

@media (max-width: 760px) {
  .shell {
    padding: 12px;
  }

	  .topbar,
	  .hero-panel,
	  .follow-form {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

	  .sort-row,
	  .preset-row,
	  .preset-save,
	  .chooser-row,
	  .filter-control,
	  .sort-control {
	    grid-template-columns: 1fr;
	  }

	  .check-scroll {
	    grid-template-columns: 1fr;
	  }

	  .detail-grid,
	  .metric-grid {
	    grid-template-columns: 1fr;
	  }

  .follow-form input {
    width: 100%;
  }
}
