@import url('/css/coss-tokens.css');
@import url('/css/coss-ui.css');

/* Legacy alias — charts and nav highlights still use --accent */
:root,
[data-theme='dark'] {
  --accent: var(--accent-color);
}

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

html {
  min-width: 320px;
  background: var(--bg-base);
  scroll-behavior: smooth;
}

html[data-i18n-pending] body {
  visibility: hidden;
}

body {
  font-family: var(--font);
  font-optical-sizing: auto;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 70% 35% at 45% -15%, var(--bg-gradient-1), transparent 70%),
    radial-gradient(ellipse 40% 30% at 100% 0%, var(--bg-gradient-2), transparent 72%);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

.hidden,
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* focus-visible handled in coss-ui.css */

.app {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.app--wide {
  max-width: none;
}

/* Shared product navigation */
.app > .nav {
  margin-bottom: 1.5rem;
}

.nav--product {
  position: relative;
  z-index: 40;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
}

.nav__top {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.5vw, 2rem);
  min-height: 70px;
  padding: 0.75rem 1rem;
}

.nav .nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
}

.nav .nav__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 11px;
  background: #000;
  box-shadow: 0 2px 5px rgba(16, 24, 40, 0.16);
}

.nav .nav__mark img,
.site-footer__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

[data-theme='dark'] .nav .nav__mark,
[data-theme='dark'] .site-footer__mark {
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav__identity {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  white-space: nowrap;
}

.nav__identity strong {
  font-size: 1.05rem;
  letter-spacing: -0.035em;
}

.nav__identity small {
  margin-top: 0.28rem;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav__search {
  position: relative;
  z-index: 1;
  flex: 1 1 400px;
  max-width: 540px;
}

.nav__search-icon {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  z-index: 1;
  color: var(--text-muted);
  font-size: 1.15rem;
  transform: translateY(-54%);
  pointer-events: none;
}

.nav__search input {
  width: 100%;
  min-height: 2rem;
  padding-left: 2.25rem;
  font-size: 0.84rem;
}

.nav__search-suggestions {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
  text-align: left;
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

.nav__search-suggestion {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav__search-suggestion:hover,
.nav__search-suggestion.is-active {
  background: var(--bg-elevated);
}

.nav__search-suggestion-symbol {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.nav__search-suggestion-name {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav__search-suggestion-empty {
  padding: 0.7rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.nav__utility {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.nav__alarms {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav__alarms.is-visible {
  display: inline-flex;
}

.nav__alarms:hover {
  background: var(--bg-hover);
}

.nav__alarms-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.nav__alarms-count {
  position: absolute;
  top: -0.15rem;
  right: -0.2rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}

.nav__market {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.nav__market i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent);
}

.nav__market--closed i {
  background: var(--text-muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-muted) 13%, transparent);
}

.nav__menu {
  display: flex;
  align-items: stretch;
  min-height: 39px;
  padding: 0 0.55rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 68%, var(--bg-surface));
  overflow-x: auto;
  scrollbar-width: none;
}

.nav__menu::-webkit-scrollbar {
  display: none;
}

.nav .nav__link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 0.82rem;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.nav .nav__link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav .nav__link--active {
  border-bottom-color: var(--accent);
  background: var(--bg-surface);
  color: var(--text);
}

.nav .nav__link--end {
  margin-left: auto;
}

.nav .theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
}

.nav .theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
}

.nav .theme-toggle__icon {
  font-size: 0.8rem;
  line-height: 1;
}

/* Shared product footer */
.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.site-footer__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 9px;
  background: #000;
}

.site-footer__brand strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: -0.03em;
}

.site-footer__brand p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.site-footer__nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.site-footer__link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.site-footer__link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.site-footer__link--active {
  background: var(--accent-dim);
  color: var(--accent);
}

.company-logo {
  display: inline-block;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  border-radius: 5px;
  background: var(--bg-elevated);
  vertical-align: middle;
}

.company-logo--sm {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 4px;
}

.company-logo--md {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
}

.company-logo--lg {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.ticker-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  white-space: nowrap;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.placeholder-card {
  min-height: 170px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.placeholder-card__eyebrow {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.placeholder-card h2 {
  margin: 0.55rem 0 0.4rem;
  font-size: 1rem;
}

.placeholder-card p {
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* Groups */
.groups-toolbar {
  margin-bottom: 1rem;
  align-items: flex-end;
}

.groups-toolbar__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 220px;
}

.groups-toolbar__field .select {
  min-width: 220px;
  max-width: 360px;
}

.results-table.groups-table .groups-table__company {
  font-family: var(--font);
  font-weight: 400;
  color: var(--text-muted);
}

.groups-toolbar__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.groups-empty {
  margin: 0;
  padding: 1.5rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.results-table.groups-table th {
  cursor: pointer;
}

.results-table.groups-table th:hover {
  color: var(--text);
}

.results-table.groups-table th.num-col {
  text-align: right;
}

.results-table.groups-table tbody tr {
  cursor: default;
}

.results-table.groups-table .groups-table__name {
  font-family: var(--font);
  font-weight: 400;
  text-align: left;
}

.results-table.groups-table .groups-table__name a {
  color: var(--text);
  font-weight: 400;
  text-decoration: none;
}

.results-table.groups-table .groups-table__name a.ticker-with-logo {
  font-weight: 500;
}

.results-table.groups-table .groups-table__name a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.results-table.groups-table .num-cell {
  font-family: var(--mono);
  text-align: right;
  white-space: nowrap;
}

.results-table.groups-table .groups-change--up {
  color: var(--green);
}

.results-table.groups-table .groups-change--down {
  color: var(--red);
}

/* Earnings calendar */
.earnings-calendar__toolbar {
  margin-bottom: 1.25rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.earnings-calendar__sector {
  min-width: 180px;
}

.earnings-calendar__sector .select {
  min-width: 180px;
  max-width: 260px;
}

.earnings-calendar__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.earnings-calendar__weeks {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.earnings-week__label {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.earnings-week__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.earnings-week__grid--cols-1 {
  grid-template-columns: minmax(0, 320px);
  justify-content: center;
}

.earnings-week__grid--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
  margin-inline: auto;
}

.earnings-week__grid--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.earnings-week__grid--cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.earnings-day {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.earnings-day__title {
  margin: 0;
  padding: 0.85rem 0.9rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}

.earnings-day__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.earnings-day__row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  color: inherit;
  border: none;
  background: transparent;
}

.earnings-day__row:nth-child(odd) {
  background: var(--bg-elevated);
}

.earnings-day__row:hover {
  background: var(--bg-hover);
}

.earnings-day__avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-elevated);
}

.earnings-day__avatar .company-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.earnings-day__company {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
}

.earnings-day__ticker {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.earnings-day__empty {
  margin: 0;
  padding: 1rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.earnings-day__show-all {
  margin: 0.55rem 0.65rem 0.7rem;
  padding: 0.55rem 0.75rem;
  width: calc(100% - 1.3rem);
  border: none;
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.earnings-day__show-all:hover {
  background: var(--bg-hover);
}

.earnings-modal {
  max-width: 520px;
  width: 94%;
  max-height: min(80vh, 720px);
  padding: 0;
  overflow: hidden;
}

.earnings-modal[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
}

.earnings-modal__header {
  flex-shrink: 0;
}

.earnings-modal__header > div {
  min-width: 0;
}

.earnings-modal__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.earnings-modal__search {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.earnings-modal__search input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
}

.earnings-modal__search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.earnings-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0 0.75rem;
}

.earnings-modal__body .earnings-day__row {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

@media (max-width: 1100px) {
  .earnings-week__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .earnings-week__grid {
    grid-template-columns: 1fr;
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.header__brand {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  min-width: 0;
  flex: 1 1 16rem;
}

.header__title {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  flex: 0 0 auto;
}

.header__subtitle {
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.header__subtitle + .header__subtitle {
  flex-basis: 100%;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Buttons — see coss-ui.css */

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-card--accent {
  border-color: color-mix(in srgb, var(--green) 24%, var(--border));
  background: color-mix(in srgb, var(--green) 7%, var(--bg-surface));
}

.stat-card--momentum {
  border-color: color-mix(in srgb, var(--purple) 24%, var(--border));
  background: color-mix(in srgb, var(--purple) 7%, var(--bg-surface));
}

.stat-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card__value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
}

.stat-card__value--sm {
  font-size: 0.85rem;
  line-height: 1.3;
}

/* Progress */
.progress-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.progress-panel.hidden {
  display: none;
}

.progress-panel__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
}

.progress-panel__pct {
  font-family: var(--mono);
  color: var(--blue);
}

.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress-panel__detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.progress-panel__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.progress-panel__cancel:not(:disabled) {
  color: var(--red, #dc2626);
  border-color: color-mix(in srgb, var(--red, #dc2626) 35%, transparent);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box__icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding-left: 2.5rem;
}

.filters {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* select / input base styles — see coss-ui.css */

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  accent-color: var(--accent);
}

/* Table */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.table-pagination__size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-pagination__size .select {
  width: auto;
  min-width: 4.5rem;
}

.table-pagination__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-pagination__info {
  min-width: 10rem;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.results-table th {
  text-align: left;
  padding: 0.4rem 0.65rem;
  background: color-mix(in srgb, var(--bg-elevated) 72%, var(--bg-surface));
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.results-table th.sorted-asc::after {
  content: ' ↑';
  color: var(--accent);
}

.results-table th.sorted-desc::after {
  content: ' ↓';
  color: var(--accent);
}

.results-table td {
  padding: 0.35rem 0.65rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 400;
}

.results-table .num-cell,
.results-table .score-bar,
.results-table .rsi-cell {
  font-family: var(--mono);
}

.results-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.results-table tbody tr:hover {
  background: var(--bg-hover);
}

.results-table .ticker-cell {
  font-weight: 400;
  font-family: var(--font);
  color: var(--text);
}

.results-table .ticker-cell a {
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
}

.results-table .ticker-cell a.ticker-with-logo {
  font-weight: 500;
}

.results-table .ticker-cell a.ticker-with-logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.results-table .ticker-cell a:hover {
  text-decoration: underline;
}

.score-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-bar__track {
  flex: 1;
  height: 4px;
  background: var(--bg-base);
  border-radius: 99px;
  min-width: 40px;
  max-width: 60px;
}

.score-bar__fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}

/* Rating badges — see coss-ui.css */

.early-yes {
  color: var(--purple);
  font-weight: 600;
}

.early-no {
  color: var(--text-muted);
}

/* Empty state */
.empty-row td {
  padding: 3rem !important;
  text-align: center;
  font-family: var(--font);
  letter-spacing: -0.01em;
}

.empty-state {
  font-family: var(--font);
}

.empty-state p {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.empty-state span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Detail modal */
.detail-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  padding: 0;
  max-width: 520px;
  width: 92%;
  box-shadow: var(--shadow-lg);
}

.detail-modal::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(4px);
}

.detail-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-modal__header h2 {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.detail-modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.detail-modal__close:hover {
  color: var(--text);
}

.detail-modal__scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
}

.score-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem;
  text-align: center;
}

.score-chip__label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.score-chip__value {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
}

.detail-modal__reasons {
  padding: 0 1.5rem 1.5rem;
}

.detail-modal__reasons h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.detail-modal__reasons ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-modal__reasons li {
  font-size: 0.875rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

@media (max-width: 768px) {
  .app {
    padding: 0.75rem 1rem 2rem;
  }

  .nav__top {
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .nav__search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .nav__utility {
    margin-left: auto;
  }

  .nav__clock,
  .nav__market,
  .theme-toggle__label {
    display: none;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    flex-wrap: wrap;
  }

  .header__actions {
    width: 100%;
  }

  .header__actions .btn {
    flex: 1 1 auto;
  }

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

  .site-footer__inner {
    align-items: flex-start;
  }

  .site-footer__nav {
    width: 100%;
  }
}

/* RS Paneli */
.rs-dashboard__toolbar {
  margin-bottom: 1rem;
}

.rs-filters {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.rs-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rs-filters__title {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}

.rs-filters__clear {
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
}

.rs-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.rs-filters__field,
.rs-filters__limit {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rs-filters__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.rs-filters__field .select {
  width: 100%;
}

.rs-filters__limits-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
}

.rs-filters__limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem 1rem;
}

.rs-filters__limit--all .rs-filters__label {
  color: var(--accent);
  font-weight: 600;
}

.rs-filters__limit--all .rs-filters__input {
  border-color: var(--accent);
}

.rs-filters__input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.rs-filters__input:focus {
  outline: none;
  border-color: var(--accent);
}

.rs-filters__input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.rs-period-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.rs-period-tab {
  padding: 0.5rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.rs-period-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.rs-period-tab--active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.rs-table tbody tr {
  cursor: default;
}

.rs-table .name-cell {
  font-family: var(--font);
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-table .sector-cell {
  font-family: var(--font);
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rsi-cell {
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.rsi-cell__value {
  display: inline-block;
  min-width: 2.5rem;
}

.rsi-trend {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.65rem;
  line-height: 1;
  vertical-align: middle;
}

.rsi-trend--up {
  color: var(--green);
}

.rsi-trend--down {
  color: var(--red);
}

.rsi-trend--flat {
  color: var(--text-muted);
  opacity: 0.6;
  font-size: 0.75rem;
}

.rsi-cell--strong {
  color: var(--green);
}

.rsi-cell--bull {
  color: var(--accent);
}

.rsi-cell--neutral {
  color: var(--text-muted);
}

.rsi-cell--bear {
  color: var(--amber);
}

.rsi-cell--weak {
  color: var(--red);
}

.rsi-cell--na {
  color: var(--text-muted);
  opacity: 0.5;
}

.rsi-cell--highlight {
  background: var(--accent-dim);
  font-weight: 600;
}
