:root {
  color-scheme: light;
  --ink: #15211e;
  --muted: #61706b;
  --paper: #f6f3eb;
  --card: #fffdf8;
  --line: #d8ddd7;
  --green: #12372f;
  --green-soft: #e0eee7;
  --gold: #a36814;
  --gold-soft: #fbefd9;
  --blue: #315b72;
  --blue-soft: #e4edf2;
  --danger: #85352e;
  --shadow: 0 12px 35px rgba(21, 33, 30, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(209, 229, 216, 0.9), transparent 32rem),
    var(--paper);
  color: var(--ink);
}

button, select, textarea { font: inherit; }
button, a, select, textarea { -webkit-tap-highlight-color: transparent; }

.hidden { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  background: white;
  color: var(--green);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }

.site-header {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--green);
  color: white;
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -0.01em; }
h2 { margin-bottom: 0.6rem; font-family: Georgia, serif; font-size: clamp(2rem, 7vw, 3.3rem); line-height: 1.02; letter-spacing: -0.035em; }
h3 { margin-bottom: 0.35rem; font-family: Georgia, serif; font-size: 1.45rem; line-height: 1.18; }

.eyebrow {
  margin-bottom: 0.2rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiet-button {
  margin-left: auto;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  cursor: pointer;
}

main { padding: 0 clamp(1rem, 4vw, 2.5rem) 8rem; }

.auth-panel {
  max-width: 42rem;
  margin: clamp(2.5rem, 10vh, 7rem) auto;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid rgba(18, 55, 47, 0.12);
  border-radius: 1.5rem;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
}

.auth-panel > p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }

.primary-button {
  min-height: 3rem;
  padding: 0.8rem 1.15rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--green);
  color: white;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(18, 55, 47, 0.2);
}
.primary-button:disabled { cursor: not-allowed; opacity: 0.45; box-shadow: none; }
.primary-button:not(:disabled):hover { background: #1c4b40; }

.status-message { min-height: 1.4em; margin: 1rem 0 0; color: var(--danger); }

.workspace { max-width: 72rem; margin: 1.4rem auto 0; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.workspace-heading h2 { font-size: clamp(2rem, 6vw, 3rem); }
.muted { margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }

.selection-summary {
  flex: 0 0 auto;
  min-width: 5rem;
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: var(--green-soft);
  text-align: center;
}
.selection-summary strong { display: block; font-size: 1.45rem; }
.selection-summary span { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }

.rule-note {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--gold);
  border-radius: 0 0.8rem 0.8rem 0;
  background: rgba(255, 253, 248, 0.76);
  color: var(--muted);
  font-size: 0.9rem;
}
.rule-note p { margin-bottom: 0.35rem; }
.rule-note p:last-child { margin-bottom: 0; }

.filters {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}
.filter {
  white-space: nowrap;
  min-height: 2.65rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.filter.active { border-color: var(--green); background: var(--green); color: white; }
.filter span { margin-left: 0.25rem; opacity: 0.72; }

.page-message {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  background: var(--green-soft);
  color: var(--green);
}
.page-message.error { background: #f9e5e2; color: var(--danger); }

.review-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.job-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--card);
  box-shadow: 0 4px 18px rgba(21, 33, 30, 0.045);
}
.job-card.selected { outline: 2px solid var(--green); outline-offset: 2px; }

.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.fit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}
.fit-badge.strong { background: var(--green-soft); color: var(--green); }
.fit-badge.plausible { background: var(--gold-soft); color: #71460a; }
.fit-badge.needs { background: var(--blue-soft); color: var(--blue); }
.date-label { color: var(--muted); font-size: 0.78rem; text-align: right; }

.company { margin-bottom: 0.25rem; color: var(--gold); font-size: 0.85rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.location { margin-bottom: 1rem; color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 0.55rem;
  margin: 0 0 1rem;
}
.facts div { min-width: 0; padding: 0.7rem; border-radius: 0.7rem; background: #f3f2ec; }
.facts dt { margin-bottom: 0.25rem; color: var(--muted); font-size: 0.7rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; font-size: 0.82rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }

.fit-summary { color: #35433f; line-height: 1.55; }
.open-question-wrap { margin-bottom: 1rem; padding: 0.85rem; border-radius: 0.75rem; background: var(--blue-soft); }
.open-question-wrap > span { color: var(--blue); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.open-question { margin: 0.25rem 0 0; color: #294a5c; line-height: 1.45; }

.job-link { align-self: flex-start; margin: auto 0 1rem; color: var(--green); font-weight: 800; text-underline-offset: 0.2em; }

.decision-fieldset { margin: 0; padding: 0; border: 0; }
.decision-fieldset legend { margin-bottom: 0.55rem; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; }
.decision-button {
  min-height: 3rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: white;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}
.decision-button:hover { border-color: var(--green); }
.decision-button.active { border-color: var(--green); background: var(--green); color: white; }
.decision-button[data-action="SKIP"].active { border-color: var(--danger); background: var(--danger); }

.skip-details { display: grid; gap: 0.75rem; margin-top: 0.85rem; }
.skip-details label { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.skip-details select, .skip-details textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: white;
  color: var(--ink);
}
.skip-details textarea { resize: vertical; }

.owner-status { margin: 0.85rem 0 0; padding: 0.7rem; border-radius: 0.65rem; background: var(--green-soft); color: var(--green); font-size: 0.82rem; }
.empty-state { margin: 2rem 0; padding: 2rem; border: 1px dashed var(--line); border-radius: 1rem; text-align: center; color: var(--muted); }

.submit-dock {
  position: fixed;
  left: 50%;
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  z-index: 10;
  width: min(calc(100% - 2rem), 48rem);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid rgba(18, 55, 47, 0.15);
  border-radius: 1rem;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 12px 35px rgba(21, 33, 30, 0.18);
  backdrop-filter: blur(12px);
}
.submit-dock div { min-width: 0; }
.submit-dock strong, .submit-dock span { display: block; }
.submit-dock span { color: var(--muted); font-size: 0.78rem; }

@media (max-width: 760px) {
  .review-list { grid-template-columns: 1fr; }
  .workspace-heading { align-items: center; }
  .selection-summary { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:first-child { grid-column: 1 / -1; }
  .submit-dock { align-items: stretch; }
  .submit-dock > div { align-self: center; }
}

@media (max-width: 480px) {
  .site-header { padding-top: 0.9rem; padding-bottom: 0.9rem; }
  main { padding-inline: 0.75rem; }
  .auth-panel { margin-top: 2rem; border-radius: 1.1rem; }
  .job-card { padding: 1rem; border-radius: 1rem; }
  .decision-grid { grid-template-columns: 1fr; }
  .decision-button { min-height: 2.75rem; }
  .submit-dock { width: calc(100% - 1rem); flex-direction: column; }
  .submit-dock .primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
