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

.watchlist-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.watchlist-tabs__list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex: 1;
}

.watchlist-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.watchlist-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.watchlist-tab--active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.watchlist-tab__count {
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0.75;
}

.watchlist-layout {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 1rem;
  align-items: start;
}

.watchlist-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.watchlist-symbols {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 180px);
}

.watchlist-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}

.watchlist-symbols__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
  min-height: 0;
}

.watchlist-add-symbol {
  flex-shrink: 0;
  padding: 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.watchlist-add-symbol__form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.watchlist-add-symbol__input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.watchlist-add-symbol__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.watchlist-add-symbol__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.watchlist-add-symbol__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.watchlist-add-symbol__btn:hover:not(:disabled) {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.watchlist-add-symbol__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.watchlist-add-symbol__error {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: var(--red);
  line-height: 1.3;
}

.watchlist-symbol {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  width: 100%;
  padding: 0.4rem 0.65rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

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

.watchlist-symbol--active {
  background: var(--accent-dim);
}

.watchlist-symbol__ticker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 400;
  font-family: var(--font);
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.watchlist-symbol--active .watchlist-symbol__ticker {
  font-weight: 600;
}

.watchlist-symbol__remove {
  opacity: 0;
  padding: 0.1rem 0.3rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.watchlist-symbol:hover .watchlist-symbol__remove,
.watchlist-symbol--active .watchlist-symbol__remove {
  opacity: 1;
}

.watchlist-symbol__remove:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--red);
}

.watchlist-detail {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
}

.watchlist-detail__row {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.watchlist-detail__identity {
  flex-shrink: 0;
  min-width: 5rem;
}

.watchlist-detail__title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.watchlist-detail__symbol {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  line-height: 1.2;
}

.watchlist-detail__name {
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

.watchlist-detail__stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

.watchlist-stat {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 0;
}

.watchlist-stat__label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.watchlist-stat__value {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.watchlist-stat__value--date {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
}

.watchlist-stat__value.hisse-stat__value--up {
  color: var(--hisse-positive, var(--green));
}

.watchlist-stat__value.hisse-stat__value--down {
  color: var(--hisse-negative, var(--red));
}

.watchlist-detail__link {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
}

.watchlist-chart-section {
  margin: 0;
}

.watchlist-notes {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.watchlist-notes__body {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.5rem;
}

.watchlist-notes__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.watchlist-notes__textarea {
  min-height: 120px;
  resize: vertical;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.5;
}

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

.watchlist-notes__status {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-height: 1rem;
}

.watchlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

.watchlist-empty--main {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 240px;
}

.watchlist-empty a {
  color: var(--accent);
}

.btn--danger {
  color: var(--red);
}

.btn--danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--red);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .watchlist-layout {
    grid-template-columns: 1fr;
  }

  .watchlist-symbols {
    position: static;
    max-height: 220px;
  }
}

@media (max-width: 640px) {
  .watchlist-detail__row {
    flex-direction: column;
    align-items: stretch;
  }

  .watchlist-detail__identity {
    max-width: none;
  }

  .watchlist-detail__name {
    max-width: none;
  }

  .watchlist-detail__stats {
    width: 100%;
  }

  .watchlist-detail__link {
    margin-left: 0;
    align-self: flex-start;
  }
}
