/* Find links — the review queue for proposed application pages.

   Most colours here are existing theme-aware custom properties
   (--charcoal-soft, --glass-border, --bone, --muted, --sand redefine themselves
   under body.light-theme already in index.html's inline stylesheet), so those
   rules need no counterpart.

   The convention for flat accents holds for FILLS and BORDERS only, not for
   text: raw --amber reads about 2:1 on a light card and #E05A4A about 3.2:1,
   both under AA. Every flat accent used as text below therefore carries a
   body.light-theme counterpart, reusing the pair already established for the
   profit figures and the asset tags — #9C5C08 for amber, #B03A2E for red. */

.links-wrap { padding: 0 1.5rem 2rem; }

.links-bar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: .8rem;
}

/* How many events still have no link. The point of the screen is progress, so
   this is the figure, not a caption — amber as text, hence the override. */
.lnk-progress { font-size: .8rem; color: var(--muted); }
.lnk-progress-count { font-weight: 600; color: var(--amber); }
body.light-theme .lnk-progress-count { color: #9C5C08; }

/* "No link exists" is recoverable knowledge, not an alarm — plain --muted,
   which already redefines itself under body.light-theme, needs no override. */
.lnk-progress-nolink { color: var(--muted); }

.lnk-note {
  font-size: .75rem; line-height: 1.55; color: var(--muted);
  background: var(--glass-white); border-left: 2px solid var(--glass-border);
  border-radius: 0 8px 8px 0; padding: .6rem .9rem; margin-bottom: 1rem;
}

.lnk-status { font-size: .8rem; line-height: 1.55; min-height: 1.2rem; margin-bottom: 1rem; }
.lnk-status-done { color: var(--muted); }

/* --teal-bright reads well on charcoal but only ~2.6:1 on white, so light
   theme drops to the deeper --teal. Same pair as .inv-status-working. */
.lnk-status-working { color: var(--teal-bright); }
body.light-theme .lnk-status-working { color: var(--teal); }

.lnk-status-error { color: #E05A4A; }
body.light-theme .lnk-status-error { color: #B03A2E; }

/* ---------- One event's worth of proposals ---------- */

.lnk-group { margin-bottom: 1.6rem; }

.lnk-event { padding: 0 0 .5rem; }

.lnk-event-name {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1rem;
  color: var(--bone);
}

.lnk-event-meta { font-size: .74rem; color: var(--muted); margin-top: .2rem; }

/* FIX 2 — the event already has a confirmed apply_url. --sand already
   redefines itself under body.light-theme (see the file header note), so
   reusing it here for the URL needs no separate override. */
.lnk-current { font-size: .74rem; line-height: 1.5; color: var(--muted); margin-top: .35rem; }
.lnk-current-url { color: var(--sand); word-break: break-all; }

/* FIX 1 — "No link exists". Deliberately as quiet as .lnk-reject: this is a
   considered admission ("I looked, there isn't one"), not a warning, so nothing
   here uses an accent colour and no light-theme override is needed. */
.lnk-nolink {
  display: inline-block; margin-top: .5rem;
  background: transparent; border: 1px dashed var(--glass-border); border-radius: 8px;
  color: var(--muted);
  font-family: 'Archivo', sans-serif; font-weight: 600; font-size: .72rem;
  padding: .3rem .7rem; cursor: pointer;
}
.lnk-nolink:hover { border-color: var(--muted); color: var(--bone); }
.lnk-nolink:disabled { opacity: .45; cursor: not-allowed; }

.lnk-card {
  background: var(--charcoal-soft); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: .9rem 1rem; margin-bottom: .55rem;
}

/* Dimming while a decision is in flight. Opacity moves foreground and border
   together without introducing a colour, so it needs no light-theme rule. */
.lnk-card-busy { opacity: .5; }

.lnk-title {
  font-family: 'Archivo', sans-serif; font-weight: 600; font-size: .9rem;
  color: var(--bone); line-height: 1.4;
}

/* The full address, wrapped rather than truncated: reading the whole path is
   how a lookalike domain gets caught, so no ellipsis and no "read more". */
.lnk-url {
  display: block; margin-top: .35rem;
  font-family: 'Archivo', sans-serif; font-size: .76rem; line-height: 1.5;
  color: var(--amber); word-break: break-all;
}
body.light-theme .lnk-url { color: #9C5C08; }

.lnk-url-bad { color: #E05A4A; }
body.light-theme .lnk-url-bad { color: #B03A2E; }

.lnk-snippet {
  font-size: .8rem; line-height: 1.55; color: var(--sand); margin-top: .5rem;
}

/* ---------- Tags ---------- */

.lnk-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

.lnk-tag {
  font-size: .6rem; letter-spacing: 1px; text-transform: uppercase; font-weight: 700;
  padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--glass-border);
  color: var(--muted);
}

/* An info page is the result worth having — ordinary server-rendered HTML, and
   where "applications open 1 March" actually gets written. A bare form link is
   the destination, not the signal, so it is marked plainly rather than dressed
   up as an equal answer. Tints and borders are flat in both themes; the text
   colours are not, and get their counterparts. */
.lnk-kind-info {
  color: #22C55E; border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.10);
}
body.light-theme .lnk-kind-info { color: #15803D; }

.lnk-kind-form {
  color: var(--amber); border-color: rgba(232,162,61,0.45); background: rgba(232,162,61,0.10);
}
body.light-theme .lnk-kind-form { color: #9C5C08; }

.lnk-kind-unknown { color: var(--muted); }

.lnk-conf-high { color: var(--sand); }

.lnk-conf-med { color: var(--amber); }
body.light-theme .lnk-conf-med { color: #9C5C08; }

.lnk-conf-low { color: #E05A4A; border-color: rgba(224,90,74,0.45); }
body.light-theme .lnk-conf-low { color: #B03A2E; }

/* ---------- Actions ---------- */

.lnk-actions { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }

/* The amber fill with dark text is the app's primary button in both themes
   (.tasks-add-btn, .btn-primary), so the fill needs no counterpart. */
.lnk-accept {
  background: var(--amber); color: #1A1410; border: 0; border-radius: 8px;
  font-family: 'Archivo', sans-serif; font-weight: 600; font-size: .78rem;
  padding: .45rem .9rem; cursor: pointer;
}
.lnk-accept:disabled { opacity: .45; cursor: not-allowed; }

/* FIX 2 — replacing a confirmed link is deliberate, not an ordinary accept,
   so it gets a warning fill rather than the primary amber. #1A1410 text on a
   solid fill reads fine in both themes without a separate rule (the file's
   own convention: fills and borders are exempt, only text needs the pair),
   so no body.light-theme override is needed here either. */
.lnk-accept-replace { background: #E05A4A; }
.lnk-accept-replace:disabled { opacity: .45; cursor: not-allowed; }

.lnk-reject {
  background: transparent; border: 1px solid var(--glass-border); border-radius: 8px;
  color: var(--muted);
  font-family: 'Archivo', sans-serif; font-weight: 600; font-size: .78rem;
  padding: .45rem .9rem; cursor: pointer;
}
.lnk-reject:hover { border-color: var(--amber); color: var(--bone); }
.lnk-reject:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Verdicts: why a search found nothing ----------

   Four situations, previously one boolean. See
   supabase/0018_apply_url_verdicts.sql. Two of them need the owner to do
   something and two do not, and the visual weight follows that split rather
   than the severity of the verdict — "apply by email to X" is the most
   actionable thing on this screen and used to appear nowhere at all. */

.lnk-verdict-section { margin: 1.6rem 0 0; }

.lnk-verdict-head {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: .95rem;
  color: var(--bone);
}

.lnk-verdict-blurb {
  font-size: .75rem; line-height: 1.55; color: var(--muted);
  margin: .15rem 0 .7rem;
}

.lnk-verdict {
  background: var(--charcoal-soft); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: .8rem .95rem; margin-bottom: .5rem;
}

/* "Waiting on you" carries the accent because it is the only one with a task
   in it. A left border rather than a fill: this is a list to work through, not
   an alarm, and the app already uses a fill for the primary action button.
   Border colour is flat in both themes (see the file header note). */
.lnk-verdict-action .lnk-verdict { border-left: 2px solid var(--amber); }

/* Deferred and closed stay deliberately unaccented. They are shown so the
   screen cannot claim "nothing to do" while events sit out of sight, not
   because they want attention. */
.lnk-verdict-wait .lnk-verdict,
.lnk-verdict-closed .lnk-verdict { opacity: .85; }

/* The searcher's own sentence, verbatim. --sand redefines itself under
   body.light-theme already, so no counterpart is needed. */
.lnk-verdict-note {
  font-size: .78rem; line-height: 1.55; color: var(--sand); margin-top: .45rem;
}

/* The thing to actually do. Amber as TEXT, so it takes the light-theme pair. */
.lnk-verdict-do {
  font-size: .78rem; line-height: 1.6; color: var(--bone); margin-top: .5rem;
}

.lnk-verdict-contact {
  font-weight: 600; color: var(--amber); word-break: break-all;
}
body.light-theme .lnk-verdict-contact { color: #9C5C08; }

.lnk-verdict-when {
  font-size: .75rem; line-height: 1.55; color: var(--muted); margin-top: .45rem;
}

/* Opening the event is the fix for "not enough detail to search", so it sits
   inline with the sentence that says so rather than beside the undo. */
.lnk-verdict-open {
  display: inline-block; margin-left: .35rem;
  background: transparent; border: 1px solid var(--glass-border); border-radius: 8px;
  color: var(--muted);
  font-family: 'Archivo', sans-serif; font-weight: 600; font-size: .7rem;
  padding: .18rem .55rem; cursor: pointer;
}
.lnk-verdict-open:hover { border-color: var(--amber); color: var(--bone); }
