:root {
  --ink: #19231f;
  --muted: #66716c;
  --paper: #f4f1e8;
  --card: #fffdfa;
  --green: #1d6b4b;
  --green-light: #e6f4ed;
  --line: #d9d8cf;
  --yellow: #f4c95d;
  --red: #a64136;
  --red-light: #fbece8;
  --orange: #d97706;
  --orange-light: #fef3c7;
  --blue: #1e5c8a;
  --blue-light: #eaf3f9;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 16px 45px rgba(34, 55, 45, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: auto;
  padding: 40px 0 100px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.6fr;
  gap: 40px;
  align-items: end;
  margin: 25px 0 35px;
}
.hero h1 {
  margin: 0;
  font: 500 clamp(2.4rem, 5vw, 4.2rem) / 1.05 Georgia, serif;
  letter-spacing: -0.04em;
}
.hero h1 em {
  color: var(--green);
  font-style: normal;
  font-weight: 600;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* Category Sector Pills (Mobile-First Touch Ergonomics) */
.sector-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.pill:hover {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
}
.pill:active {
  transform: scale(0.97);
}
.pill.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* Real-Time Eligibility Matcher Card */
.eligibility-card {
  margin-bottom: 25px;
  border: 1px solid #c7ded2;
  border-radius: var(--radius-md);
  background: #f8fbf9;
  box-shadow: 0 4px 16px rgba(29, 107, 75, 0.05);
  overflow: hidden;
}
.eligibility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  cursor: pointer;
  background: #f1f8f4;
  border-bottom: 1px solid #dbeae2;
}
.eligibility-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.badge-icon {
  font-size: 1.4rem;
}
.eligibility-title h3 {
  margin: 0 0 2px;
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--ink);
}
.eligibility-title p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.btn-toggle-eligibility {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #bad2c6;
  border-radius: 8px;
  background: white;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--green);
  cursor: pointer;
  touch-action: manipulation;
}

.eligibility-body {
  padding: 20px 24px;
}
.eligibility-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input, .form-group select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #cbdcd2;
  border-radius: 8px;
  background: white;
  font-size: 1rem; /* 16px to prevent iOS Safari auto-zoom */
  font-weight: 600;
  color: var(--ink);
}
.eligibility-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #cfe0d6;
}
.calc-age-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}
.calc-age-badge strong {
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 800;
}
.toggle-eligible-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.toggle-eligible-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

/* Signal Shell & Job Board */
.signal-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 35px;
}
.signal-shell > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
}
.signal-shell > header h2 {
  margin: 0;
  font: 500 1.8rem Georgia, serif;
}
.signal-shell > header span {
  padding: 6px 12px;
  border-radius: 99px;
  color: #725a12;
  background: #fff1bc;
  font-size: 0.72rem;
  font-weight: 800;
}

.fraud {
  margin: 20px 30px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--red);
  background: var(--red-light);
  border-radius: 4px;
}
.fraud strong {
  display: block;
  font-size: 0.82rem;
  color: #774b43;
}
.fraud p {
  margin: 4px 0 0;
  color: #774b43;
  font-size: 0.76rem;
  line-height: 1.5;
}

#filters {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 20px 30px;
}
#filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#filters input, #filters select {
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
#clear {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
#clear:hover {
  background: var(--paper);
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 30px;
  border-block: 1px solid var(--line);
  background: #f6f5ef;
}
.result-head p {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}
.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.sort-controls select {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Job Cards Grid */
.job-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 26px 30px;
}
.job-grid article {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.job-grid article:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(25, 35, 31, 0.06);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.card-top > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Status & Urgency Badges */
.card-top strong {
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}
.status-open { color: #16593e; background: #e2f2e8; }
.status-upcoming { color: #725510; background: #fff0b8; }
.status-expired { color: #7a3d37; background: #f4e4e2; }

.urgency-badge {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.urgency-critical {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #f87171;
}
.urgency-warning {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}
.urgency-normal {
  color: #065f46;
  background: #d1fae5;
}
.urgency-expired {
  color: #6b7280;
  background: #f3f4f6;
}

.job-grid h3 {
  margin: 14px 0 6px;
  font: 600 1.25rem Georgia, serif;
  line-height: 1.25;
}
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.job-grid dl {
  margin: 14px 0 16px;
  display: flex;
  flex-direction: column;
}
.job-grid dl div {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #f0f0ea;
  font-size: 0.74rem;
}
.job-grid dt {
  color: var(--muted);
  font-weight: 600;
}
.job-grid dd {
  margin: 0;
  color: var(--ink);
  font-weight: 550;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.btn-save-job {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.btn-save-job:hover {
  background: #fff8e8;
  border-color: #f4c95d;
}
.btn-save-job:active {
  transform: scale(0.96);
}
.btn-save-job.is-saved {
  background: #fff3d1;
  border-color: #e5b338;
  color: #8c6708;
}

.job-grid a.btn-apply {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  color: white;
  background: var(--green);
  text-align: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 750;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.15s ease;
}
.job-grid a.btn-apply:hover {
  background: #145037;
}
.job-grid a.btn-apply:active {
  transform: scale(0.98);
}

.empty {
  margin: 0 30px 28px;
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
}
.empty strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Monetization Slot */
.ad-slot {
  margin: 35px 0 25px;
}
.ad-container {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: #fafbfc;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.ad-badge {
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--green);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.ad-placeholder {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.ad-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.ad-cta {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  #filters {
    grid-template-columns: 1fr 1fr;
  }
  .job-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .job-grid article {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .eligibility-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    line-height: 1.35;
  }
  main {
    width: min(100% - 1.25rem, 1160px);
    padding-top: 15px;
  }
  .hero {
    grid-template-columns: 1fr;
    margin: 15px 0 20px;
    gap: 12px;
  }
  .hero h1 {
    font-size: clamp(1.35rem, 5.2vw, 1.7rem);
    line-height: 1.25;
    margin-bottom: 0.5rem;
    text-wrap: pretty;
  }
  .signal-shell > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .result-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .eligibility-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }
  .btn-toggle-eligibility {
    width: 100%;
    text-align: center;
  }
  .eligibility-body {
    padding: 14px 16px;
  }
  .eligibility-status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .card-top {
    flex-wrap: wrap;
    gap: 6px;
  }
  .job-grid dl div {
    grid-template-columns: 80px 1fr;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .card-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .card-actions .btn-save-job,
  .card-actions .btn-notification,
  .job-grid a.btn-apply {
    width: 100%;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }
  .ad-placeholder {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  main {
    width: min(100% - 1rem, 1160px);
    padding-top: 10px;
  }
  .signal-shell > header {
    padding: 16px 14px;
  }
  .fraud {
    margin: 12px 14px 0;
    padding: 10px 12px;
  }
  #filters {
    grid-template-columns: 1fr;
    padding: 14px 14px;
  }
  .result-head {
    padding: 10px 14px;
  }
  .job-grid {
    padding: 14px 14px;
    gap: 14px;
  }
  .job-grid article {
    padding: 14px;
  }
  .empty {
    margin: 0 14px 14px;
  }
}

/* Medical & Healthcare Sub-Role Navigation & Components (Task 6) */
.medical-role-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.role-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted, #64748b);
  margin-right: 0.35rem;
  white-space: nowrap;
}
.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 999px;
  background: white;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.role-pill:hover {
  border-color: #0d9488;
  color: #0f766e;
  background: #f0fdfa;
}
.role-pill.active {
  background: #0f766e;
  color: white;
  border-color: #0f766e;
}

.org-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 8px;
  border-radius: 4px;
  margin-block: 4px 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-notification {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink, #0f172a);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-notification:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.official-source-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 24px;
}

.source-card {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.source-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.source-card-top h4 {
  margin: 0;
  font-size: 0.92rem;
  color: #0f172a;
}
.source-scope-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.scope-AP { background: #dbeafe; color: #1e40af; }
.scope-TG { background: #fef3c7; color: #92400e; }
.scope-National { background: #e0e7ff; color: #3730a3; }

.source-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.4;
}
.source-card a {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f766e;
  text-decoration: none;
}
.source-card a:hover {
  text-decoration: underline;
}

