/* watch-auth.css — shared styles for the account chip, watchlist
   toggle button, and signin/dashboard chrome. Layered on top of
   styles.css; uses the same design tokens. Only loaded by watch-*
   pages, so the public site is unaffected. */

/* ─────────────── PUBLIC_ONLY launch posture ─────────────── */
/* When watch-auth.js detects accounts:false from /api/capabilities,
   body.phi-no-accounts gets set and these rules hide every UI element
   that would otherwise try to talk to disabled endpoints. The page
   degrades cleanly to "public feed only" without script errors. */
body.phi-no-accounts #subscribe-mount,
body.phi-no-accounts [data-auth-chip],
body.phi-no-accounts [data-requires-account],
body.phi-no-accounts [data-watchlist-toggle] {
  display: none !important;
}

/* Optional banner that pages can render to signal the preview posture
   without having to hardcode "accounts launching soon" copy. */
.phi-preview-banner {
  display: none;
  margin: 0 0 18px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  border: 1px solid var(--rule);
  border-radius: 6px;
  letter-spacing: 0.02em;
  background: var(--bg-2);
}
body.phi-no-accounts .phi-preview-banner {
  display: block;
}

/* ─────────────── nav-right account chip ─────────────── */
.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  letter-spacing: 0.02em;
  margin-left: 12px;
  transition: 0.15s;
}
.auth-pill:hover {
  color: var(--ink);
  border-color: var(--ink-mute);
}
.auth-pill .auth-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 4px var(--signal);
}
.auth-pill .auth-handle {
  color: var(--ink);
}
.auth-pill .auth-tier {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--signal);
  font-weight: 600;
}
.auth-pill.auth-signin {
  color: var(--ink);
  background: transparent;
  border-color: var(--rule);
}
.auth-pill.auth-signin:hover {
  border-color: var(--signal);
  color: var(--signal);
}

/* ─────────────── watchlist toggle button ─────────────── */
[data-watchlist-toggle] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--rule);
  background: var(--bg-3);
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: 0.15s;
}
[data-watchlist-toggle]:hover {
  border-color: var(--signal-3);
}
[data-watchlist-toggle].watching {
  background: oklch(0.82 0.17 145 / 0.15);
  border-color: var(--safe);
  color: var(--safe);
}
[data-watchlist-toggle].signin-cta {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink-dim);
}
[data-watchlist-toggle].signin-cta:hover {
  border-color: var(--signal);
  color: var(--signal);
}

/* ─────────────── signin page ─────────────── */
.signin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 0 32px;
}
@media (max-width: 720px) {
  .signin-grid {
    grid-template-columns: 1fr;
  }
}
.signin-card {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-2);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
}
.signin-card.primary {
  background: linear-gradient(180deg, oklch(0.86 0.21 130 / 0.05), var(--bg-2));
  border-color: var(--signal-3);
}
.signin-card.is-disabled {
  background: var(--bg-2);
  border-color: var(--rule);
  opacity: 0.6;
}
.signin-card.is-disabled .num { color: var(--ink-mute); }
.signin-card .num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.14em;
  margin-bottom: 12px;
}
.signin-card.primary .num {
  color: var(--signal);
}
.signin-card h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink);
}
.signin-card .lede {
  font-size: 13px;
  color: var(--ink-dim);
  margin: 0 0 22px;
  line-height: 1.55;
}
.signin-card .gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--rule);
  background: var(--bg-3);
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s;
  letter-spacing: 0.04em;
}
.signin-card .gh-btn:hover {
  border-color: var(--ink-mute);
}
.signin-card .gh-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.signin-card .gh-btn:disabled:hover {
  border-color: var(--rule);
}
.signin-card .gh-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ─────────────── dashboard ─────────────── */
.dash-hero {
  padding: 56px 0 24px;
  border-bottom: 1px solid var(--rule);
}
.dash-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  margin-bottom: 22px;
}
.dash-hero .eyebrow .liveDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  animation: pulse 1.6s infinite;
}
.dash-hero h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(32px, 4.5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.dash-hero h1 em {
  font-style: italic;
  color: var(--signal);
}
.dash-hero .sub {
  font-size: 16px;
  color: var(--ink-dim);
  max-width: 60ch;
  margin: 0;
}
.dash-hero .sub b {
  color: var(--ink);
  font-weight: 500;
}

.dash-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
  margin-top: 24px;
}
@media (max-width: 720px) {
  .dash-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}
.dash-meta .cell {
  padding: 18px 20px;
  border-right: 1px solid var(--rule);
}
.dash-meta .cell:last-child {
  border-right: none;
}
@media (max-width: 720px) {
  .dash-meta .cell:nth-child(2) {
    border-right: none;
  }
  .dash-meta .cell:nth-child(1),
  .dash-meta .cell:nth-child(2) {
    border-bottom: 1px solid var(--rule);
  }
}
.dash-meta .lbl {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dash-meta .v {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin-top: 8px;
  word-break: break-all;
}
.dash-meta .v.signal {
  color: var(--signal);
}
.dash-meta .sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 4px;
}

.dash-section {
  padding: 32px 0 0;
}
.dash-section .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
}
.dash-section .head h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.dash-section .head .actions {
  display: flex;
  gap: 10px;
  padding: 0;
}
.dash-section .head .actions a,
.dash-section .head .actions button {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: 0.15s;
}
.dash-section .head .actions a:hover,
.dash-section .head .actions button:hover {
  color: var(--ink);
  border-color: var(--ink-mute);
}

.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.wl-card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: 0.15s;
}
.wl-card:hover {
  border-color: var(--ink-mute);
}
.wl-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.wl-card .name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.wl-card .name .v {
  color: var(--ink-mute);
  font-weight: 400;
}
.wl-card .last {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.wl-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.wl-card .actions a,
.wl-card .actions button {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-dim);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: 0.15s;
}
.wl-card .actions a:hover,
.wl-card .actions button:hover {
  color: var(--ink);
  border-color: var(--ink-mute);
}
.wl-card .actions button.remove:hover {
  color: var(--crit);
  border-color: var(--crit);
}

.wl-empty {
  border: 1px dashed var(--rule);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-mute);
  background: var(--bg-2);
}
.wl-empty a {
  color: var(--signal);
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--signal-3);
  border-radius: 6px;
}
.wl-empty a:hover {
  background: oklch(0.86 0.21 130 / 0.1);
}

/* signin gate (shown on dashboard when not signed in) */
.signin-gate {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-2);
  padding: 40px 32px;
  text-align: center;
  max-width: 540px;
  margin: 48px auto;
}
.signin-gate h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.signin-gate p {
  font-size: 14px;
  color: var(--ink-dim);
  margin: 0 0 24px;
  line-height: 1.55;
}
.signin-gate a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--signal);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.signin-gate a.btn:hover {
  background: oklch(0.92 0.18 130);
}
