/* Job Search Assistant, built on the site styles (css/styles.css) */

/* ─── Hero with the sponsor ticker ─── */
.js-hero .container { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3.5rem; align-items: center; }
.js-hero h1 { max-width: 640px; }
.js-hero .status { margin-bottom: 1.25rem; }
.js-hero-note { margin-top: 1.1rem; font-size: .85rem !important; color: rgba(255, 255, 255, .45) !important; }

.ticker { position: relative; border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .1); padding: 1.1rem 1.1rem .9rem; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); isolation: isolate; }
.ticker-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 .35rem .8rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.ticker-head strong { font-size: .95rem; color: #fff; letter-spacing: -.01em; }
.ticker-head span { font-size: .78rem; color: rgba(255, 255, 255, .5); }
.ticker-window { position: relative; height: 336px; overflow: hidden; perspective: 900px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%); }
.ticker-track { position: absolute; inset: 0 0 auto; will-change: transform; }
.ticker-row { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: .9rem; padding: 0 .55rem; border-radius: 12px; transform-origin: 50% 50%; will-change: transform, opacity, filter; }
.ticker-name { color: #fff; font-weight: 600; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ticker-open { flex: none; display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: #fca5a5; background: rgba(239, 68, 68, .16); border: 1px solid rgba(248, 113, 113, .28); padding: .28rem .6rem; border-radius: 999px; }
.ticker-open::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: tkPulse 1.8s ease-out infinite; }
@keyframes tkPulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } }
.page-hero .ticker-foot { margin-top: .6rem; padding: 0 .35rem; font-size: .74rem; color: rgba(255, 255, 255, .42); }

/* Less space above the hero text (the nav sits over the top of the hero) */
.js-hero { padding: calc(var(--nav-h) + 2.75rem) 0 4.5rem; }
/* Tool page: a short dark header, then straight into the search */
.js-app-hero { padding: calc(var(--nav-h) + 2rem) 0 2.25rem; }
.js-app-hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: .6rem; }
.js-app-hero .breadcrumb { margin-bottom: 1rem; }
.js-app { padding: 2.5rem 0 3.5rem; }
.js-app + .js-results { padding-top: 3.5rem; }
.js-import.is-highlight { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-glow); }
.js-error small { display: block; margin-top: .75rem; font-size: .76rem; color: var(--faint); }

/* ─── How it works ─── */
.js-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.js-steps .card { padding: 1.75rem; }
.js-steps .card-icon { margin-bottom: 1.1rem; }
.js-step-n { font-size: .74rem; font-weight: 700; letter-spacing: .12em; color: var(--blue); display: block; margin-bottom: .45rem; text-transform: uppercase; }
.js-role { color: var(--blue); }

/* ─── Search card ─── */
.js-search { max-width: 920px; margin: 0 auto; }
.js-account { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; padding: .85rem 1rem; margin-bottom: 1.5rem; border-radius: var(--radius); background: var(--bg-alt); border: 1px solid var(--border); font-size: .88rem; color: var(--muted); }
.js-account p { flex: 1 1 260px; }
.gh-google { display: inline-flex; align-items: center; gap: .55rem; padding: .6rem 1rem; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; font-weight: 600; font-size: .86rem; color: var(--text); transition: border-color .2s, box-shadow .2s; }
.gh-google:hover { border-color: var(--text); box-shadow: var(--shadow); }
.gh-google svg { width: 17px; height: 17px; }
.gh-user { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .3rem .25rem .25rem; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.gh-user[hidden], .gh-google[hidden] { display: none !important; }
#gh-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; overflow: hidden; }
#gh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gh-user-name { font-size: .84rem; font-weight: 600; color: var(--text); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gh-sign-out { font-size: .78rem; font-weight: 600; color: var(--muted); padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--border); }
#gh-sign-out:hover { color: var(--text); border-color: var(--text); }
.gh-sync { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.gh-sync:empty { display: none; }
.gh-sync::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.gh-sync[data-state="saving"]::before, .gh-sync[data-state="loading"]::before { background: #f59e0b; }
.gh-sync[data-state="error"]::before, .gh-sync[data-state="offline"]::before { background: #dc2626; }
.gh-sync[data-state="local"]::before { background: var(--faint); }

.js-start { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, .62fr); gap: 1.25rem; align-items: stretch; }
.js-or { align-self: center; font-size: .78rem; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.js-import { display: flex; flex-direction: column; justify-content: center; gap: .65rem; padding: 1.25rem; border-radius: var(--radius); border: 1.5px dashed #cfdbf5; background: linear-gradient(135deg, #f5f8ff, #fff8f1); text-align: center; }
.js-import strong { font-size: .95rem; }
.js-import span { font-size: .82rem; color: var(--muted); }
.js-import .btn { align-self: center; }
.js-start .form-group { margin-bottom: 0; }
.js-start textarea { min-height: 128px; }
.js-actions-row { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: .75rem; }
.js-summary { margin: 1.25rem 0 0; padding: .85rem 1rem; border-radius: var(--radius); background: var(--blue-soft); color: var(--blue-dark); font-size: .9rem; }
.js-summary[hidden] { display: none; }
.js-divider { height: 1px; background: var(--border); margin: 1.75rem 0 1.5rem; }
.js-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.js-filters .js-wide { grid-column: 1 / -1; }
.btn.is-working { pointer-events: none; opacity: .85; }
.btn.is-working::after { content: ''; width: 14px; height: 14px; margin-left: .5rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: jsSpin .8s linear infinite; }
@keyframes jsSpin { to { transform: rotate(360deg); } }
.js-hint { font-size: .8rem; color: var(--faint); margin-top: .6rem; }

/* Chips: type to search, click to add as a card */
.chips-field { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-height: 52px; padding: .45rem .55rem; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-alt); transition: border-color .2s, box-shadow .2s, background .2s; cursor: text; }
.chips-field:focus-within { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px var(--blue-glow); }
.chips-field input { flex: 1 1 160px; min-width: 120px; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: .35rem .3rem !important; outline: none; }
.chip-card { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .35rem .3rem .75rem; border-radius: 999px; background: #fff; border: 1px solid #cfdbf5; color: var(--text); font-size: .84rem; font-weight: 600; line-height: 1.2; animation: chipIn .28s var(--ease); }
.chip-card.is-title { background: var(--blue-soft); border-color: #bcd0f7; color: var(--blue-dark); }
.chip-card button { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 1rem; line-height: 1; }
.chip-card button:hover, .chip-card button:focus-visible { background: #fee2e2; color: #dc2626; }
@keyframes chipIn { from { opacity: 0; transform: scale(.85); } }
.chips-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); padding: .35rem; margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px rgba(11, 16, 32, .12); max-height: 280px; overflow-y: auto; }
.chips-list[hidden] { display: none; }
.chips-list li { padding: .6rem .8rem; border-radius: 10px; font-size: .9rem; cursor: pointer; }
.chips-list li[aria-selected="true"], .chips-list li:hover { background: var(--blue-soft); color: var(--blue); }

/* ─── Results ─── */
.js-results[hidden] { display: none; }
.js-results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.js-results-meta { font-size: .88rem; color: var(--muted); }
.js-group { margin-bottom: 3rem; }
.js-group-head { display: flex; align-items: baseline; gap: .65rem; flex-wrap: wrap; }
.js-group-head h3 { font-size: 1.2rem; }
.js-count { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 .5rem; border-radius: 999px; background: var(--blue); color: #fff; font-size: .75rem; font-weight: 700; }
.js-group-sub { font-size: .9rem; color: var(--muted); margin: .3rem 0 1.1rem; max-width: 720px; }
.js-group details > summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: .9rem; list-style: none; }
.js-group details > summary::-webkit-details-marker { display: none; }
.js-jobs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.job { position: relative; display: flex; flex-direction: column; gap: .55rem; padding: 1.35rem 1.4rem; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--border); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
.job:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(11, 16, 32, .09); border-color: #cfdbf5; }
.job-top { display: flex; align-items: flex-start; gap: .85rem; }
.job-score { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: .95rem; }
.job-score small { display: block; font-size: .56rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: -2px; }
.job h4 { font-size: 1.05rem; line-height: 1.3; letter-spacing: -.01em; }
.job-employer { font-size: .9rem; font-weight: 600; color: var(--text); margin-top: .15rem; }
.job-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; letter-spacing: .01em; }
.badge-sponsor { background: rgba(22, 163, 74, .12); color: #15803d; }
.badge-hint { background: var(--blue-soft); color: var(--blue-dark); }
.badge-closed { background: #fee2e2; color: #b91c1c; }
.job-meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem .6rem; }
.job-desc { font-size: .86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job .tags { margin-top: .1rem; }
.job-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.job-actions .btn { padding: .6rem 1rem; font-size: .82rem; }
.js-empty { padding: 2rem; border-radius: var(--radius-lg); border: 1.5px dashed var(--border); text-align: center; color: var(--muted); }
.js-skeleton { height: 210px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--bg-alt) 0%, #eef2f9 50%, var(--bg-alt) 100%); background-size: 200% 100%; animation: jsShimmer 1.4s linear infinite; }
@keyframes jsShimmer { to { background-position: -200% 0; } }
.js-note { margin-top: 1rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--bg-alt); border: 1px solid var(--border); font-size: .84rem; color: var(--muted); }

/* Toast */
.js-toast { position: fixed; left: 50%; bottom: 24px; z-index: 300; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(520px, calc(100% - 32px)); padding: .85rem 1.15rem; border-radius: 14px; background: var(--ink); color: #fff; font-size: .9rem; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); transition: opacity .3s, transform .3s var(--ease); }
.js-toast.show { opacity: 1; transform: translate(-50%, 0); }
.js-toast.error { background: #991b1b; }
.js-toast.success { background: #166534; }

@media (max-width: 980px) {
  .js-hero .container { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .js-steps { grid-template-columns: minmax(0, 1fr); }
  .js-jobs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .js-hero { padding: calc(var(--nav-h) + 1.25rem) 0 3.5rem; }
  .js-app-hero { padding: calc(var(--nav-h) + 1rem) 0 1.75rem; }
  .js-app { padding: 1.5rem 0 2.75rem; }
  .js-start { grid-template-columns: minmax(0, 1fr); }
  .js-or { justify-self: center; }
  .js-filters { grid-template-columns: minmax(0, 1fr); }
  .ticker-window { height: 280px; }
  .form-card.js-search { padding: 1.5rem 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-open::before, .chip-card, .js-skeleton { animation: none; }
}
