/* Career Colleague look: frosted glass over a night-blue globe. Change the colours in :root. */
:root {
  --ink: #e9f1f8; --muted: #9fb4c7; --accent: #4aa3d8; --accent-dark: #3a8dc0; --good: #3ecf8e; --bad: #ff7b66; --warm: #ffa14a;
  --glass: rgba(18,38,64,.58); --glass-edge: rgba(150,195,235,.22); --soft: rgba(255,255,255,.07); --line: rgba(255,255,255,.10);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { min-height: 100%; }
body {
  color: var(--ink); margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1200px 800px at 75% 40%, #12335a 0%, rgba(18,51,90,0) 60%), linear-gradient(135deg, #060e1a 0%, #0a1a2f 55%, #0c2038 100%) fixed;
}
#globe { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.veil { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,14,26,.9) 0%, rgba(6,14,26,.7) 36%, rgba(6,14,26,.2) 60%, rgba(6,14,26,0) 80%); }
.topbar, .page { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand-dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 5px rgba(255,161,74,.28); }
.tagline { color: var(--muted); font-size: .9rem; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 3rem; }

/* ---------- welcome ---------- */
.hero { padding: clamp(1.5rem, 7vh, 5rem) 0 2rem; max-width: 640px; }
.hero-title { font-size: clamp(2.2rem, 5.4vw, 3.9rem); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; margin: 0 0 1rem; text-shadow: 0 2px 30px rgba(0,0,0,.55); }
.hero-sub { font-size: clamp(1.02rem, 1.6vw, 1.25rem); color: var(--muted); margin-bottom: 1.8rem; }
.start-card { padding: 1.6rem; max-width: 520px; }

/* ---------- glass ---------- */
.glass, .glass-card {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 20px;
  box-shadow: 0 14px 50px rgba(0,0,0,.35); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
}
.glass-card { margin-bottom: 1.25rem; overflow: hidden; }
.glass-card .card-header {
  background: transparent; border: 0; padding: 1rem 1.25rem .35rem; font-weight: 700; font-size: .98rem;
  display: flex; justify-content: space-between; align-items: center;
}
.glass-card .card-body { padding: .5rem 1.25rem 1.25rem; }
.glass-card .list-group-item { background: transparent; border-color: var(--line); color: var(--ink); padding: .7rem 1.25rem; }
.glass-card .table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-active-bg: rgba(74,163,216,.15); }
.glass-card .table > :not(caption) > * > * { padding: .6rem 1.1rem; }
.glass-alert { border-radius: 14px; border: 0; background: rgba(255,123,102,.15); color: #ffb3a6; }
.form-label, .eyebrow { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-select, .form-control { border-radius: 12px; border: 1px solid var(--glass-edge); background-color: rgba(255,255,255,.07); color: var(--ink); padding: .65rem .85rem; }
.form-select:focus, .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(74,163,216,.3); }
.form-text { color: var(--muted); }
.btn-go, .btn-primary { background: var(--accent); border: 0; color: #04121f; border-radius: 12px; padding: .75rem 1.2rem; font-weight: 700; }
.btn-go:hover, .btn-primary:hover { background: #6bb7e4; color: #04121f; }
.btn-ghost { background: var(--soft); border: 1px solid var(--glass-edge); color: var(--ink); border-radius: 10px; }
.btn-ghost:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn-outline-secondary { border-radius: 10px; }

/* ---------- results header and tabs ---------- */
.run-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: .5rem 0 1rem; }
.run-goal { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 800; letter-spacing: -.01em; margin: 0; }
.run-cv { color: var(--muted); font-size: .9rem; }
.run-actions { display: flex; align-items: center; gap: .75rem; }
#run-status { font-size: .85rem; padding: .45rem .8rem; border-radius: 999px; }
.tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding: .35rem; border-radius: 999px; width: fit-content; max-width: 100%;
  background: var(--glass); border: 1px solid var(--glass-edge); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tab { border: 0; background: transparent; color: var(--muted); padding: .5rem 1rem; border-radius: 999px; font-weight: 600; font-size: .92rem; }
.tab:hover { color: var(--ink); }
.tab.active { background: rgba(74,163,216,.28); color: #fff; box-shadow: inset 0 0 0 1px rgba(150,195,235,.4); }
.pane { display: none; }
.pane.active { display: block; }

/* ---------- agent workflow (the "shipments in transit" list) ---------- */
.live { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .15rem .55rem; border-radius: 999px; background: var(--soft); }
.live.on { color: #1c1004; background: var(--warm); animation: blink 1.2s ease-in-out infinite; }
.live.done { color: #04170f; background: var(--good); }
@keyframes blink { 50% { opacity: .55; } }
.agent-list { list-style: none; margin: 0; padding: .25rem .75rem .9rem; }
.agent { padding: .75rem .6rem; border-radius: 14px; transition: background .3s; }
.agent.running { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,161,74,.35); }
.agent-top { display: flex; align-items: center; gap: .7rem; }
.agent-num { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; font-weight: 700;
  background: var(--soft); color: var(--muted); }
.agent.running .agent-num { background: var(--warm); color: #1c1004; box-shadow: 0 0 0 5px rgba(255,161,74,.28); }
.agent.complete .agent-num { background: var(--good); color: #04170f; }
.agent.failed .agent-num { background: var(--bad); color: #2a0a04; }
.agent-name { font-weight: 700; line-height: 1.2; }
.agent-note { color: var(--muted); font-size: .84rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.agent-state { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.agent.running .agent-state { color: var(--warm); } .agent.complete .agent-state { color: var(--good); } .agent.failed .agent-state { color: var(--bad); }
.track { height: 5px; border-radius: 99px; background: var(--soft); margin: .6rem 0 0 2.6rem; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 99px; background: var(--good); transition: width .6s ease; }
.agent.complete .fill { width: 100%; }
.agent.failed .fill { width: 100%; background: var(--bad); }
.agent.running .fill { width: 45%; background: linear-gradient(90deg, rgba(255,161,74,.15), var(--warm), rgba(255,161,74,.15)); background-size: 200% 100%; animation: flow 1.3s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }
.agent.future { opacity: .55; }

/* ---------- match score ---------- */
.score-row { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1rem; }
.ring { --p: 0; width: 6.5rem; height: 6.5rem; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-size: 1.6rem; font-weight: 800;
  background: conic-gradient(var(--ring, var(--accent)) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); position: relative; transition: --p .8s; }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #0d2038; }
.ring span { position: relative; }
.score-level { font-size: 1.25rem; font-weight: 700; }
.mini-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.mini { background: var(--soft); border-radius: 14px; padding: .7rem .5rem; text-align: center; font-size: .8rem; color: var(--muted); }
.mini-n { font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.mini.good .mini-n { color: var(--good); } .mini.bad .mini-n { color: var(--bad); }

/* ---------- chips, logs, misc ---------- */
.skill-chip { display: inline-block; margin: 0 .35rem .35rem 0; padding: .25rem .7rem; border-radius: 999px; background: rgba(74,163,216,.18); color: #bfe3f7; font-size: .88rem; }
.skill-chip.matched { background: rgba(62,207,142,.18); color: #8ff0c4; }
.skill-chip.missing { background: rgba(255,123,102,.17); color: #ffb6a8; }
.log-panel { max-height: 460px; overflow-y: auto; font-size: .9rem; }
.log-entry { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.log-entry:last-child { border-bottom: 0; }
.log-agent { font-weight: 700; display: block; font-size: .78rem; color: var(--accent); }
.log-entry.warning .log-agent { color: #f0b84a; } .log-entry.error .log-agent { color: var(--bad); }
.source-note { color: var(--muted); font-size: .85rem; padding: .25rem .5rem; }
.progress { background: var(--soft); border-radius: 99px; }
.badge { font-weight: 700; }
.text-muted { color: var(--muted) !important; }
.form-control::file-selector-button { background: var(--soft); color: var(--ink); border-color: var(--line); }
.form-select option { color: #111; }

@media (max-width: 760px) {
  .veil { background: linear-gradient(180deg, rgba(6,14,26,0) 0%, rgba(6,14,26,.25) 25%, rgba(6,14,26,.88) 48%, rgba(6,14,26,.92) 100%); }
  .tagline { display: none; }
  .hero { padding-top: 38vh; }
  .tabs { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .agent.running .fill, .live.on { animation: none; } }
