/* Watchlists (plan block 7): star buttons, the #/watch feed and inbox, the home panel. Same tokens as styles.css /
   app.css; loaded once by js/watch.js. */

/* ---- star (follow) button and its list menu */
.w-star { position: relative; display: inline-flex; vertical-align: middle; }
.w-star-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; flex: none; }
.w-star-btn.on { border-color: var(--yours); background: var(--yours-wash); color: var(--ink); }
.w-star-btn.on svg { fill: var(--yours); stroke: var(--yours); }
.w-star-btn:disabled { opacity: .55; }
.w-star-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn.small.w-star-btn { padding: 3px 8px; font-size: 11px; gap: 4px; }
.btn.small.w-star-btn svg { width: 12px; height: 12px; }
.w-star-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 230px; max-width: min(320px, calc(100vw - 32px));
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.w-star-menu.flip { left: auto; right: 0; }
.w-star-h { font: 600 11px/1.2 var(--text); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.w-star-menu .check { justify-content: flex-start; }
.w-star-menu .check small { margin-left: auto; color: var(--ink-3); font-size: 11px; }
.w-star-note { font-size: 12px; color: var(--ink-3); }
.w-star-new { display: flex; gap: 6px; margin-top: 4px; }
.w-star-new input { flex: 1; min-width: 0; font: 500 13px var(--text); color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; padding: 5px 8px; }
.w-star-new .btn { flex: none; }
.w-star-all { font-size: 12px; font-weight: 600; }
.w-prog-star { display: block; margin-top: 4px; }
.w-aside { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }

/* ---- watchlist nav (Feed / Alert inbox) */
.w-nav { display: flex; gap: 6px; margin: -8px 0 18px; flex-wrap: wrap; }
.w-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font: 600 13px/1 var(--text);
  color: var(--ink-2); text-decoration: none; border: 1px solid var(--rule); }
.w-nav a[aria-current="page"] { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.w-badge { font: 700 11px/1 var(--text); background: var(--yours); color: #3b2604; border-radius: 999px; padding: 3px 6px; }

/* ---- layout: lists on the left, feed on the right */
.w-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 24px; align-items: start; }
.w-side .section { margin-top: 0; }
.w-main > .filters { margin-bottom: 4px; }
.w-main > .filters + #w-body > .section:first-child, .w-main > #w-body > .section:first-child { margin-top: 0; }
.w-lists { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.w-lists a { display: block; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.w-lists a:hover { background: var(--paper); }
.w-lists li[aria-current="true"] a { background: var(--paper); box-shadow: inset 3px 0 0 var(--ink); }
.w-lists b { display: block; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.w-lists small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.w-new summary { cursor: pointer; font: 600 13px var(--text); color: var(--ink-2); padding: 4px 0; }
.w-form { display: grid; gap: 10px; margin-top: 10px; }
.w-form .btn { justify-self: start; }
.w-form [hidden] { display: none; }
.w-add, .w-rform { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); align-items: end; }
.w-set { max-width: 560px; }
.w-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- filters */
.w-filters .filters { margin-bottom: 10px; gap: 8px; }
.w-filters .filters:last-child { margin-bottom: 0; }
.w-lab { font: 600 11px/1 var(--text); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); min-width: 44px; }
.w-fchip { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--text); padding: 7px 11px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-2); cursor: pointer; }
.w-fchip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--ink-3)); }
.w-fchip span { font-weight: 500; color: var(--ink-3); }
.w-fchip[aria-pressed="false"] { opacity: .55; background: transparent; }
.w-fchip[aria-pressed="false"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--k, var(--ink-3)); }
.w-fchip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.w-row2 { justify-content: space-between; }
.w-q { flex: 1 1 240px; max-width: 360px; }
.w-filters .field.inline select { width: auto; max-width: 100%; }

/* feed kind colours */
.f-news { --k: var(--stage-3); }
.f-calendar { --k: #2b8a9a; }
.f-deal { --k: var(--crowd, #8a4a9e); }
.f-stage_change { --k: var(--good); }
.f-ot_change { --k: var(--warn); }

/* ---- feed rows (inside .feed) */
.w-feed li { grid-template-columns: 112px minmax(0, 1fr) minmax(90px, 170px); }
.w-feed li.w-row { padding-left: 10px; box-shadow: inset 3px 0 0 var(--k, var(--rule)); }
.w-feed li.w-row:first-child { padding-top: 11px; }
.w-feed li.yours { background: var(--yours-wash); }
.w-kind { font: 600 11px/1.3 var(--text); letter-spacing: .04em; text-transform: uppercase; color: var(--k, var(--ink-3)); }
.w-title { font-weight: 600; overflow-wrap: anywhere; }
.w-title a { color: var(--ink); }
.w-feed .feed-b .dim { overflow-wrap: anywhere; }
.w-src { white-space: normal; text-align: right; overflow-wrap: anywhere; }
.tag.w-up { background: var(--stage-0); color: var(--ink); }
.tag.w-priv { background: var(--yours-wash); color: var(--ink); box-shadow: inset 0 0 0 1px var(--yours); }
.tag.w-new { background: var(--yours); color: #3b2604; margin-top: 6px; }
.w-matched { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.w-chip { display: inline-block; font-size: 12px; line-height: 1.4; padding: 1px 8px; border-radius: 999px; background: var(--paper);
  color: var(--ink-2); text-decoration: none; box-shadow: inset 0 0 0 1px var(--rule); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.w-chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.w-chip.k-yours { background: var(--yours-wash); box-shadow: inset 0 0 0 1px var(--yours); }

/* ---- items */
.w-items { list-style: none; margin: 0; padding: 0; }
.w-items li { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 9px 0; border-top: 1px solid var(--rule-2); }
.w-items li:first-child { border-top: 0; }
.w-items .w-ik { justify-self: start; }
.w-it a, .w-it b { font-weight: 600; overflow-wrap: anywhere; }
.w-it small { display: block; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }

/* ---- inbox */
.w-alerts li.st-read, .w-alerts li.st-dismissed { opacity: .8; }
.w-alerts li.st-new { background: var(--yours-wash); }
.w-alerts .feed-k { display: flex; flex-direction: column; align-items: flex-start; }
.w-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.r-competitor_phase3 { --k: var(--stage-3); }
.r-hold_or_crl { --k: var(--warn); }
.r-new_entrant { --k: var(--crowd, #8a4a9e); }
.r-deal_upfront { --k: #2b8a9a; }
.r-partner_runway { --k: var(--yours); }
.w-rules tr.w-off td { color: var(--ink-3); }
.w-racts { white-space: nowrap; text-align: right; }
.w-rulenew { margin-top: 14px; }

/* ---- exports bar (target competition tab) */
.w-exports { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; font-size: 13px; }

/* ---- digest preview */
.w-dlg { width: min(860px, calc(100vw - 24px)); height: min(88vh, 900px); padding: 0; border: 1px solid var(--rule); border-radius: 14px;
  background: var(--sheet); color: var(--ink); box-shadow: var(--shadow); }
.w-dlg[open] { display: flex; flex-direction: column; }
.w-dlg::backdrop { background: rgba(10, 26, 29, .45); }
.w-dlg header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.w-dlg header .dim { font-size: 12px; flex: 1; }
.w-dlg iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---- home panel */
.w-week .sub-h { margin-top: 18px; }
.w-week > div > .feed li { grid-template-columns: 104px minmax(0, 1fr) auto; }

@media (max-width: 1100px) {
  .w-layout { grid-template-columns: minmax(0, 1fr); }
  .w-side .w-lists { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .w-side .w-lists a { padding: 6px 10px; box-shadow: inset 0 0 0 1px var(--rule); }
  .w-side .w-lists li[aria-current="true"] a { box-shadow: inset 0 0 0 1.5px var(--ink); }
}
@media (max-width: 640px) {
  .w-feed li, .w-week > div > .feed li { grid-template-columns: minmax(0, 1fr); }
  .w-feed .feed-t { flex-wrap: wrap; }
  .w-src { text-align: left; }
  .w-acts { justify-content: flex-start; }
  .w-items li { grid-template-columns: minmax(0, 1fr) auto; }
  .w-items .w-ik { grid-column: 1 / -1; }
  .w-q { max-width: none; }
  .w-lab { width: 100%; }
  .w-racts { white-space: normal; text-align: left; }
}
/* the kind select carries long rule labels: let it shrink inside narrow cards */
.w-filters .field.inline { min-width: 0; max-width: 100%; }
.w-filters .field.inline select { min-width: 0; text-overflow: ellipsis; }
