/* ---------------------------------------------------------------------------
   VCHRO Sourcing — Virtual CHRO identity.
   Palette and type taken from "Virtual CxO Profile.pptx": #002060 navy is the
   dominant brand colour deck-wide, #1B75BC the accent used on the CHRO section
   (slides 21-23), #A8D1F2 its tint. Body type is Arial, as in the deck.
   No build step, no framework.
   --------------------------------------------------------------------------- */

:root {
  --navy: #002060;
  --navy-soft: #284c7c;
  --blue: #1b75bc;
  --blue-dark: #0d5e9b;
  --blue-tint: #a8d1f2;
  --blue-wash: #eef5fc;

  --bg: #f5f7fa;
  --surface: #ffffff;
  --line: #dbe3ed;
  --line-soft: #eaeff5;
  --text: #14213d;
  --muted: #64748b;

  --danger: #b3261e;
  --warn-bg: #fff8e6;
  --warn-line: #e8c979;
  --ok-bg: #e8f4ec;
  --ok-line: #a5cdb5;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 32, 96, .06), 0 6px 16px rgba(0, 32, 96, .06);
}

*, *::before, *::after { box-sizing: border-box; }

/* A class that sets `display` beats the bare [hidden] attribute. Without this an
   invisible overlay once covered the phone app and swallowed every tap. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font: 15px/1.55 Arial, Helvetica, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; color: var(--navy); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

a { color: var(--blue); }

.muted { color: var(--muted); font-size: .9rem; }
.error-text { color: var(--danger); font-size: .9rem; margin: .6rem 0 0; }

/* ── Brand wordmark ─────────────────────────────────────────────────────── */

.wordmark {
  display: inline-flex; align-items: baseline; gap: .4rem;
  font-weight: bold; letter-spacing: .08em; text-transform: uppercase;
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
  font-family: inherit;
}
.wordmark .w-thin { font-weight: normal; opacity: .75; }
.wordmark .w-sub {
  letter-spacing: .02em; text-transform: none; font-weight: normal;
  font-size: .8em; opacity: .7;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

main { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.wide { max-width: 1180px; }

.stack > * + * { margin-top: .7rem; }
.row-between {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }

/* ── Top bar ────────────────────────────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--navy);
  color: #fff;
  padding: .7rem 1.1rem;
  padding-top: max(.7rem, env(safe-area-inset-top));
}
.topbar .wordmark { font-size: 1rem; color: #fff; margin-right: auto; }

.topmeta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.who { font-size: .88rem; color: var(--blue-tint); }
.chip {
  font-size: .78rem; padding: .22rem .6rem; border-radius: 999px;
  background: rgba(168, 209, 242, .2); color: #fff; white-space: nowrap;
}
.chip.is-low { background: #8a4b12; }
.chip.is-out { background: var(--danger); }

.navlink {
  background: none; border: 0; color: var(--blue-tint); cursor: pointer;
  font: inherit; font-size: .9rem; padding: .4rem .7rem; border-radius: 6px;
}
.navlink:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.navlink.is-active { background: rgba(255, 255, 255, .16); color: #fff; }

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: bold;
  padding: .6rem 1.1rem; min-height: 44px;
  border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .35rem .7rem; min-height: 34px; font-size: .87rem; font-weight: normal; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover:not(:disabled) { background: var(--navy-soft); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--blue-wash); border-color: var(--blue-tint); }
.topbar .btn-ghost { border-color: rgba(168, 209, 242, .45); color: #fff; }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }

.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--blue);
  cursor: pointer; text-decoration: underline;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { font-size: .8rem; font-weight: bold; color: var(--navy); }
.field .req, .field .opt {
  font-style: normal; font-weight: normal; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .04em; margin-left: .35rem;
}
.field .req { color: var(--blue); }
.field .opt { color: var(--muted); }

/* What was actually sent upstream, since location and industry become search
   words rather than filters. */
.sent-query {
  font-size: .83rem; color: var(--muted); margin: .8rem 0 0;
}
.sent-query code {
  background: var(--blue-wash); border: 1px solid var(--line-soft);
  border-radius: 4px; padding: .1rem .35rem; color: var(--navy);
  font-family: "Courier New", monospace;
}
.field input, .field select, .field textarea {
  font: inherit; padding: .55rem .65rem; min-height: 44px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); width: 100%;
}
.field textarea { min-height: 60px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue);
}

.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .8rem; align-items: end;
}
.field-wide { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; }

/* ── Login ──────────────────────────────────────────────────────────────── */

.login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(165deg, #002060 0%, #0d3b76 55%, #1b75bc 100%);
}
.login-card { width: 100%; max-width: 370px; }
.login-card > * + * { margin-top: .9rem; }
.login-brand { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .2rem; }
.login-brand .wordmark { font-size: 1.35rem; color: var(--navy); cursor: default; }
.login-brand .tagline { font-size: .85rem; color: var(--muted); }

/* ── Search hero ────────────────────────────────────────────────────────── */

.hero { text-align: center; padding: .5rem 0 1.25rem; }
.hero h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.hero p { color: var(--muted); margin: 0; font-size: .95rem; }

.searchbar { display: flex; gap: .6rem; }
.searchbar input {
  flex: 1 1 auto; font: inherit; font-size: 1.05rem;
  padding: .8rem 1rem; min-height: 52px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
.searchbar input:focus { outline: none; border-color: var(--blue); }
.searchbar .btn { min-height: 52px; padding-inline: 1.5rem; }

.searchmeta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-top: .6rem;
  font-size: .85rem; color: var(--muted);
}
.examples { margin-top: .8rem; font-size: .85rem; color: var(--muted); }
.examples button {
  background: var(--blue-wash); border: 1px solid var(--line-soft); color: var(--navy);
  border-radius: 999px; padding: .28rem .7rem; margin: .2rem .25rem 0 0;
  font: inherit; font-size: .82rem; cursor: pointer;
}
.examples button:hover { background: var(--blue-tint); }

.advanced { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line-soft); }

/* ── Results ────────────────────────────────────────────────────────────── */

.summary {
  display: flex; gap: 1.3rem; flex-wrap: wrap; align-items: center;
  background: var(--blue-wash); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: .6rem .95rem; margin: 1.1rem 0;
  font-size: .88rem;
}
.summary b { font-size: 1.05rem; color: var(--navy); }

.warnings { margin: 1rem 0; }
.warning {
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: 8px; padding: .55rem .8rem; font-size: .88rem;
}
.warning.is-ok { background: var(--ok-bg); border-color: var(--ok-line); }

.person {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .85rem .95rem; box-shadow: var(--shadow);
}
.person.is-anon { background: #fbfcfd; border-style: dashed; }

.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 48px;
  object-fit: cover; background: var(--blue-wash);
}
.avatar-fallback {
  display: grid; place-items: center;
  font-weight: bold; color: var(--navy); font-size: .95rem;
}

.person-main { flex: 1 1 auto; min-width: 0; }
.person-name { font-weight: bold; color: var(--navy); font-size: 1rem; }
.person-line { color: #33415c; font-size: .92rem; margin-top: .1rem; word-wrap: break-word; }
.person-meta { color: var(--muted); font-size: .83rem; margin-top: .2rem; }

.profile-link {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .5rem; font-size: .9rem; font-weight: bold;
  color: var(--blue); text-decoration: none;
}
.profile-link:hover { text-decoration: underline; }
.no-link { margin-top: .5rem; font-size: .85rem; color: var(--muted); font-style: italic; }

.person-links { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.person-links .profile-link { margin-top: 0; }

.contact-box {
  margin-top: .55rem; padding-top: .5rem;
  border-top: 1px dashed var(--line);
  display: flex; gap: .4rem; flex-wrap: wrap; align-items: center;
  font-size: .88rem;
}
.contact-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--blue-wash); border: 1px solid var(--blue-tint);
  color: var(--navy); border-radius: 999px;
  padding: .22rem .6rem; text-decoration: none; font-weight: bold;
  font-size: .85rem;
}
.contact-chip:hover { background: var(--blue-tint); }
.contact-chip.is-guess {
  background: var(--warn-bg); border-color: var(--warn-line); color: #7a4b00;
  border-style: dashed;
}
.contact-chip.is-wa { background: #e7f6ec; border-color: #a6d9b8; color: #14683a; }
.contact-chip.is-wa:hover { background: #cfeeda; }

.badge {
  display: inline-block; font-size: .72rem; font-weight: bold;
  padding: .12rem .45rem; border-radius: 4px; margin-left: .4rem;
  background: var(--blue-wash); color: var(--navy); vertical-align: middle;
}
.badge.is-good { background: var(--ok-bg); color: #1a6b4d; }
.badge.is-warn { background: #fdecc8; color: #7a4b00; }
.badge.is-score { background: var(--navy); color: #fff; }

/* Matching people LinkedIn will not name. Deliberately plain — these are not
   candidates you can act on, they are evidence the market exists. */
.also-seen {
  margin-top: 1.2rem; padding: .9rem 1rem;
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.also-seen h4 { margin: 0 0 .3rem; font-size: .95rem; color: var(--navy); }
.also-seen p { margin: 0 0 .7rem; font-size: .85rem; }
.also-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .3rem 0; border-top: 1px solid var(--line-soft);
  font-size: .88rem;
}
.also-row span:first-child { flex: 1 1 auto; min-width: 0; }

.employer-row {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-bottom: .8rem; padding-bottom: .8rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: .85rem;
}
.employer-chip {
  font: inherit; font-size: .85rem; font-weight: bold;
  background: var(--blue-wash); border: 1px solid var(--blue-tint);
  color: var(--navy); border-radius: 999px; padding: .25rem .7rem;
  cursor: pointer;
}
.employer-chip:hover { background: var(--blue-tint); }

/* ── Tables ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line-soft); }
th {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--navy); border-bottom-color: var(--line);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Dialog + toast ─────────────────────────────────────────────────────── */

.backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 32, 96, .5);
  display: grid; place-items: center; padding: 1.25rem;
}
.dialog { max-width: 460px; width: 100%; }
.dialog pre {
  background: var(--blue-wash); border: 1px solid var(--line);
  border-radius: 6px; padding: .6rem; font-size: .9rem;
  overflow-x: auto; user-select: all; font-family: "Courier New", monospace;
}

.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  background: var(--navy); color: #fff;
  padding: .65rem 1.1rem; border-radius: 999px; font-size: .9rem;
  box-shadow: 0 6px 22px rgba(0, 32, 96, .35); max-width: 90vw;
}
.toast.is-error { background: var(--danger); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Narrow screens (the Android shell loads this same page) ─────────────── */

@media (max-width: 620px) {
  .who { display: none; }
  .hero h2 { font-size: 1.25rem; }
  .searchbar { flex-direction: column; }
  .searchbar .btn { width: 100%; }
  .person { flex-wrap: wrap; }
}
