*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--text-base)/1.6 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 var(--s3); }
h1 { font-size: var(--text-2xl); } h2 { font-size: var(--text-xl); } h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--s4); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; } .skip:focus { left: var(--s4); top: var(--s4); z-index: 10; background: var(--surface); padding: var(--s2) var(--s3); }
.muted { color: var(--muted); }
.stack > * + * { margin-top: var(--s4); }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--s4); }
.container.narrow { max-width: var(--max-narrow); }
main.container { padding-top: var(--s6); padding-bottom: var(--s8); min-height: 60vh; }
.section { margin-top: var(--s8); }
.icon { flex: none; }

/* Header and footer */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: var(--text-lg); color: var(--text); text-decoration: none; }
.brand .icon { color: var(--accent); }
.brand img { display: block; width: 32px; height: 32px; }
.nav { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; padding: var(--s2); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500; }
.nav a:not(.btn):hover { color: var(--text); background: var(--surface-2); }
.nav form { margin: 0; }
.lang-switch { display: inline-flex; gap: 4px; }
.lang-flag { display: inline-flex; padding: 4px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; opacity: .5; }
.lang-flag svg { display: block; border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }
.lang-flag:hover, .lang-flag[aria-pressed="true"] { opacity: 1; }
.lang-flag[aria-pressed="true"] { border-color: var(--border); background: var(--surface); }
.nav-extras { display: flex; align-items: center; gap: var(--s2); }
.site-header .nav-toggle { display: none; width: 44px; padding: 0; }
.nav-toggle-close { display: none; }
@media (max-width: 719px) {
  /* Phones: brand and a menu button; the links open in a panel under the header. */
  .site-header .container { flex-wrap: wrap; }
  .site-header .nav-toggle { display: inline-flex; }
  .site-header[data-nav="open"] .nav-toggle-open { display: none; }
  .site-header[data-nav="open"] .nav-toggle-close { display: inline; }
  .site-header .nav { display: none; }
  .site-header[data-nav="open"] .nav {
    display: flex; flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: var(--s1);
    padding: var(--s2) 0 var(--s4); border-top: 1px solid var(--border); }
  .site-header[data-nav="open"] .nav a:not(.btn) { padding: var(--s3) var(--s2); font-size: var(--text-base); }
  .site-header[data-nav="open"] .nav > .btn { width: 100%; }
  .site-header[data-nav="open"] .nav-form .btn { width: 100%; justify-content: flex-start; padding: var(--s3) var(--s2);
    font-size: var(--text-base); font-weight: 500; color: var(--muted); }
  .site-header[data-nav="open"] .nav-extras { justify-content: space-between; margin-top: var(--s2); }
}
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: var(--text-sm); padding: var(--s6) 0; }
.site-footer .container { display: flex; gap: var(--s4); flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px;
  padding: 0 var(--s5); border-radius: var(--radius-sm); border: 1px solid transparent; font: 600 var(--text-base)/1 var(--font);
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--muted); color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); padding: 0 var(--s3); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-google { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-google:hover { border-color: var(--muted); color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--text-sm); }
.btn-block { width: 100%; }

/* Cards, alerts, badges */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s5); box-shadow: var(--shadow); }
.alert { background: var(--accent-soft); border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: var(--s1); font-size: .75rem; font-weight: 600; padding: 2px var(--s2);
  border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge-pro { background: var(--accent); color: var(--on-accent); }

/* Forms */
label, .label { font-weight: 500; font-size: var(--text-sm); }
.field { display: grid; gap: var(--s1); margin-bottom: var(--s4); }
.field .help, .helptext { color: var(--muted); font-size: var(--text-sm); }
input[type=text], input[type=email], input[type=number], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; }
.checkbox { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 400; }
.errorlist { list-style: none; padding: 0; margin: 0 0 var(--s2); color: var(--danger); font-size: var(--text-sm); }

/* Hero and drop zone */
.hero { display: grid; gap: var(--s5); align-items: start; padding: var(--s6) 0 var(--s4);
        grid-template-areas: "intro" "form" "how"; }   /* phones: the form comes right after the intro */
.hero-intro { grid-area: intro; } .hero-how { grid-area: how; } .hero-form { grid-area: form; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 1fr; grid-template-rows: auto 1fr; column-gap: var(--s6);
          grid-template-areas: "intro form" "how form"; padding-top: var(--s7); }
}
.hero-title { font-size: var(--text-3xl); letter-spacing: -0.03em; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: var(--text-lg); color: var(--muted); max-width: 34ch; }
.job[id], #buy { scroll-margin-top: 84px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }  /* email links land on a card, not under the sticky header */
.job:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.job-explaining { display: flex; justify-content: center; align-items: center; margin: var(--s5) 0; } /* the explanation loading: spinner centred, room around it */
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; }
.how-step { display: grid; grid-template-columns: 48px 1fr; gap: var(--s4); align-items: center; }
.how-step p { margin: 0; }
.brand-icon { display: block; color: var(--text); }
.hero-how h2 { font-size: var(--text-xl); margin-bottom: var(--s3); }
.dropzone { display: grid; place-items: center; gap: var(--s2); text-align: center; padding: var(--s6) var(--s4);
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { color: var(--accent); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-file { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; color: var(--text); }
.dropzone-file[hidden] { display: none; }
.dropzone-remove { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 600 1.1rem/1 var(--font); cursor: pointer; }
.dropzone-remove:hover, .dropzone-remove:focus-visible { color: var(--text); border-color: var(--accent); }
/* Tag weights (search review): name, priority and "remove" on one line, a rule between tags. */
.weights { display: grid; }
.weight-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s3); align-items: center;
  padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.weight-row:first-child { border-top: 1px solid var(--border); }
.weight-row select { width: auto; min-width: 11rem; }
.weight-row .checkbox { white-space: nowrap; }
@media (max-width: 479px) {
  .weight-row { grid-template-columns: 1fr auto; }
  .weight-name { grid-column: 1 / -1; }
}
.form-row { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.form-row > .field { margin-bottom: 0; }
.form-row > .checkbox { min-height: 44px; }
@media (min-width: 520px) { .form-row { grid-template-columns: 1fr auto; align-items: end; } }
details.paste summary { cursor: pointer; color: var(--muted); font-size: var(--text-sm); margin: var(--s3) 0; }

/* Jobs */
.jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.job { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); }
.job-title { font-weight: 650; font-size: var(--text-lg); color: var(--text); text-decoration: none; }
a.job-title:hover { color: var(--accent); }
.job-meta { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--muted);
  background: var(--surface-2); border-radius: 999px; padding: 2px 10px; }
.job-reason { margin: 0; }
.job-explanation { margin: 0; }
.job-explanation dt { font-weight: 600; font-size: var(--text-sm); color: var(--text); }
.job-explanation dd { margin: 0 0 var(--s2); font-size: var(--text-sm); color: var(--muted); }
.job-score { float: right; font-weight: 700; color: var(--accent); white-space: nowrap;
             cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.job-locked { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s2); font-size: var(--text-sm); color: var(--muted); }
.more { margin: var(--s2) 0 var(--s5); font-size: var(--text-lg); text-align: center; }

/* Plans */
.plans { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
/* Horizontal plan widgets, one under the other: what you get on the left, the button on the right. */
.plans--rows { grid-template-columns: 1fr; }
.plan.plan--row { flex-flow: row wrap; gap: var(--s3) var(--s5); align-items: center; }  /* beats .plan's column */
.plan--row .plan-info { flex: 1 1 280px; display: grid; gap: var(--s2); align-content: start; }
.plan--row .plan-info > * { margin: 0; }
.plan.plan--row > .btn, .plan.plan--row > .btn:last-child { flex: 0 0 auto; min-width: 200px; margin: 0 auto; }  /* right of the text when the card has room */
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.plan > .btn:last-child, .plan > form:last-child { margin-top: auto; }
.plan--pro { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan ul { padding-left: 1.1em; margin: 0; } .plan li { margin: var(--s1) 0; }
.price { font-size: var(--text-2xl); font-weight: 750; margin: 0; } .price small { font-size: var(--text-base); color: var(--muted); font-weight: 500; }

/* Sign-in choices */
.auth-choices { display: grid; gap: var(--s3); }
.auth-choices form { display: grid; gap: var(--s3); margin: 0; }
@media (min-width: 520px) { .auth-choices form { grid-template-columns: 1fr auto; } }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--text-sm); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Onboarding steps */
.steps { list-style: none; padding: 0; margin: 0 0 var(--s5); display: flex; gap: var(--s2); font-size: var(--text-sm); color: var(--muted); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: var(--s2); }
.steps li::before { content: counter(step); counter-increment: step; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--surface-2); font-weight: 600; }
.steps { counter-reset: step; }
.steps li[aria-current=step] { color: var(--text); font-weight: 600; }
.steps li[aria-current=step]::before { background: var(--accent); color: var(--on-accent); }

/* Prose (legal pages) */
.prose { max-width: 70ch; } .prose h2 { margin-top: var(--s6); }

/* Spinner (htmx progress) */
.spinner { flex: none; box-sizing: border-box; width: 20px; height: 20px; aspect-ratio: 1; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } * { transition: none !important; } }

/* Free query: "more jobs" marker, nearby towns, town picker */
.more-dots { text-align: center; font-size: 2.5rem; line-height: 1; letter-spacing: .35em; color: var(--muted);
             margin: var(--s4) 0 0; user-select: none; }
.nearby { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.nearby form { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.town-picker { display: grid; gap: var(--s2); }
.town-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip--remove { min-height: 36px; padding: 0 var(--s2) 0 var(--s3); border: 1px solid var(--border); cursor: pointer;
  font: inherit; color: var(--text); gap: var(--s2); }
.chip--remove:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip--remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-x { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 1.15rem; line-height: 1; color: var(--muted); }
.chip--remove:hover .chip-x { color: var(--text); }
.town-empty { padding: var(--s2) var(--s3); color: var(--muted); }
.town-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); }
.town-list li { padding: var(--s2) var(--s3); cursor: pointer; }
.town-list li:hover, .town-list li:focus { background: var(--accent-soft); outline: none; }
.town-list li[aria-selected=true] { font-weight: 600; color: var(--accent); }

/* A job this person has opened (on any device): dimmed title like a visited link, and a "✓ Opened" chip */
.job--opened .job-title { color: var(--muted); }
.chip-opened { color: var(--accent); }

/* Several one-line forms (control + button) in one grid: the buttons share a column and line up */
.form-rows { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.form-rows > form { display: contents; }
.form-rows > form > .checkbox { min-height: 44px; display: flex; align-items: center; }
@media (min-width: 520px) { .form-rows { grid-template-columns: 1fr auto; align-items: center; } }

/* Destructive actions, and the confirmation popup */
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.dialog { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  padding: var(--s5); width: min(480px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(0 0 0 / .5); }
.dialog .actions { justify-content: flex-end; }

/* The score slider and its value on one line: [ ----slider---- 5/10 ] */
.slider-row { display: flex; align-items: center; gap: var(--s2); }
.slider-row input[type=range] { flex: 1; min-width: 0; margin: 0; }
.slider-row output { min-width: 2ch; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.slider-row .muted { margin-left: -2px; }
