/* Watchlists: the Library's list bar, the star on each company, and the star's popover. Tokens and
   components from app.css / ui.css; nothing here adds a colour. */

/* list bar: All · each list · New list, with the open list's actions on the right */
.watch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); }
.watch-tabs { flex: 0 1 auto; min-width: 0; }
.watch-tabs .tabs-trigger { flex: none; padding: 0 var(--space-3); text-decoration: none; gap: 6px; }
.watch-tabs .tabs-trigger .icon { color: var(--muted-foreground); }
.watch-tabs .tabs-trigger[data-state="active"] .icon { color: var(--foreground); fill: currentColor; }
.watch-chip-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }

/* the star: outline when the company is in none of your lists, filled ink when it is in any */
.watch-star { color: var(--muted-foreground); }
.watch-star:hover { color: var(--foreground); }
.watch-star[data-on="true"] { color: var(--foreground); }
.watch-star[data-on="true"] .icon { fill: currentColor; }
tr[data-watch-out] > td:not(.lib-star) { opacity: .45; }

/* the star's popover */
.watch-pop { width: 17rem; gap: var(--space-2); }
.watch-pop-title { margin: 0; font-weight: 600; font-size: var(--text-sm); }
.watch-muted { margin: 0; color: var(--muted-foreground); font-size: var(--text-sm); }
.watch-opts { display: grid; gap: 2px; max-height: 15rem; overflow-y: auto; margin: 0 calc(-1 * var(--space-2)); }
.watch-opt { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 4px var(--space-2);
  border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-base); }
.watch-opt:hover { background: var(--muted); }
.watch-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-opt-n { color: var(--muted-foreground); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.watch-quick { display: flex; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.watch-quick .input { flex: 1; min-width: 0; height: 32px; }
.watch-err { margin: 0; color: var(--destructive); font-size: var(--text-sm); }

/* Add ticker */
.watch-add { width: 19rem; }
.watch-add form { display: grid; gap: var(--space-2); }
.watch-add .input { height: 32px; }
.watch-sugg { display: grid; gap: 2px; margin: 0 calc(-1 * var(--space-2)); }
.watch-sugg:empty { display: none; }
.watch-sugg-item { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); width: 100%;
  min-height: 32px; padding: 4px var(--space-2); border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--foreground); font: inherit; text-align: left; cursor: pointer; }
.watch-sugg-item:hover, .watch-sugg-item:focus-visible { background: var(--muted); outline: none; }
.watch-sugg-item:disabled { cursor: default; opacity: .6; }
.watch-sugg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.watch-dlg { display: grid; gap: var(--space-4); }

@media (max-width: 640px) {
  .watch-tabs { flex-basis: 100%; max-width: 100%; }
  .watch-actions { margin-left: 0; }
}
@media (pointer: coarse) {
  .watch-opt, .watch-sugg-item { min-height: 44px; }
  .watch-quick .input, .watch-add .input { height: 44px; }
}

/* first-run welcome */
.watch-welcome { width: min(30rem, calc(100vw - 32px)); }
.ww-picked { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ww-picked:empty { display: none; }
.ww-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px;
  background: var(--accent-surface); color: var(--foreground); font-size: var(--text-sm); font-weight: 600; }
.ww-chip button { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 999px; background: none; color: inherit; cursor: pointer; }
.ww-chip button:hover { background: color-mix(in srgb, var(--foreground) 10%, transparent); }
.ww-results { display: grid; gap: var(--space-1); }
.ww-cap { margin: 0; color: var(--muted-foreground); font-size: var(--text-xs); }
.ww-cap:empty { display: none; }
.ww-list { display: grid; max-height: 16rem; overflow-y: auto; margin: 0 calc(-1 * var(--space-2)); }
.ww-item { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 40px; padding: 4px var(--space-2);
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--foreground); font: inherit; text-align: left; cursor: pointer; }
.ww-item:hover, .ww-item:focus-visible { background: var(--muted); outline: none; }
.ww-item[aria-selected="true"] { background: var(--accent-surface); }
.ww-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ww-item-tk { color: var(--muted-foreground); font-size: var(--text-sm); margin-right: auto; }
.ww-item-mark { display: inline-flex; color: var(--muted-foreground); }
.ww-item[aria-selected="true"] .ww-item-mark { color: var(--foreground); }
.ww-empty { margin: 0; padding: var(--space-2); color: var(--muted-foreground); font-size: var(--text-sm); }
.ww-opt { color: var(--muted-foreground); font-weight: 400; margin-left: 4px; }
@media (pointer: coarse) { .ww-item { min-height: 44px; } }
