/* DDV app baseline. Mobile-first, CSS variables, dark mode via prefers-color-scheme. */
:root {
  --bg: #fafafa;
  --fg: #111;
  --muted: #555;
  --accent: #0066cc;
  --border: #ddd;
  --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111; --fg: #f5f5f5; --muted: #aaa; --accent: #4ea1f7; --border: #333; }
}
[data-theme="dark"]  { --bg: #111; --fg: #f5f5f5; --muted: #aaa; --accent: #4ea1f7; --border: #333; }
[data-theme="light"] { --bg: #fafafa; --fg: #111; --muted: #555; --accent: #0066cc; --border: #ddd; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--fg);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1rem; flex: 1; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; text-decoration: none; color: var(--fg); }
nav { display: flex; gap: 1rem; align-items: center; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--fg); }
form.inline { display: inline; }
form.inline button { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; font: inherit; }
form.inline button:hover { color: var(--fg); }
footer { text-align: center; padding: 1rem; color: var(--muted); border-top: 1px solid var(--border); }

h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.lede { color: var(--muted); margin-top: 0; }

.btn { display: inline-block; padding: 0.5rem 1rem; background: var(--accent); color: white; text-decoration: none; border-radius: 4px; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button { padding: 0.5rem 1rem; background: var(--accent); color: white; border: none; border-radius: 4px; cursor: pointer; font: inherit; }
button:hover { filter: brightness(1.1); }

.auth label { display: block; margin: 0.75rem 0; }
.auth input { display: block; width: 100%; max-width: 360px; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; font: inherit; background: var(--bg); color: var(--fg); }
.auth img { max-width: 240px; }

.announcement-banner { padding: 0.5rem 1rem; background: #ffd; color: #553; text-align: center; font-size: 0.95rem; border-bottom: 1px solid #ddd; }

.admin { max-width: 100%; }
.admin-nav { padding: 0.5rem 0; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.admin-stats { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 1rem 0; }
.admin-stats dt { color: var(--muted); }
.admin-stats dd { margin: 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table.audit code { font-size: 0.8rem; color: var(--muted); word-break: break-all; }

.admin-table.checklist td { vertical-align: top; }
.cl-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.cl-pill.ok   { background: #cfe9d4; color: #1a5024; }
.cl-pill.warn { background: #fff1c2; color: #6a4d00; }
.cl-pill.fail { background: #fbd0d0; color: #8a1a1a; }
.cl-pill.na   { background: #e8e8e8; color: #555; }
@media (prefers-color-scheme: dark) {
  .cl-pill.ok   { background: #1f5e2c; color: #d6f3dd; }
  .cl-pill.warn { background: #6a5200; color: #fff2c2; }
  .cl-pill.fail { background: #6f1f1f; color: #fbd0d0; }
  .cl-pill.na   { background: #3a3a3a; color: #ccc; }
}

.legal { max-width: 56ch; }
.legal h1 { font-size: 1.4rem; }
.legal h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.legal-draft-banner { padding: 0.75rem; margin-bottom: 1.5rem; border-left: 4px solid #c80; background: rgba(204, 136, 0, 0.08); font-size: 0.95rem; }

.contact textarea { width: 100%; max-width: 480px; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; font: inherit; background: var(--bg); color: var(--fg); resize: vertical; }
.contact label { display: block; margin: 0.5rem 0; }
.contact input { display: block; width: 100%; max-width: 360px; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; font: inherit; background: var(--bg); color: var(--fg); }

/* Respect the HTML `hidden` attribute even when display is set elsewhere.
   Without this, `display: flex` on #ddv-cookie-banner overrides the UA
   default `display: none` for [hidden], so the banner stays visible after
   accepting and clicking OK appears to do nothing. */
[hidden] { display: none !important; }
#ddv-cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; padding: 1rem; background: var(--fg); color: var(--bg); display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; z-index: 1000; }
#ddv-cookie-banner p { margin: 0; }
#ddv-cookie-banner a { color: var(--bg); text-decoration: underline; }
#ddv-cookie-banner button { background: var(--accent); }

.skeleton { background: linear-gradient(90deg, var(--border), var(--bg), var(--border)); background-size: 200% 100%; animation: skeleton 1.5s infinite; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Jobs board ===== */
.jobs-hero { padding: 2.5rem 0 1.5rem; }
.jobs-hero h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 0.5rem; max-width: 28ch; }
.jobs-hero h1 em { color: var(--accent); font-style: normal; }
.jobs-hero__sub { font-size: 1.05rem; color: var(--muted); max-width: 60ch; margin: 0; }

.vertical-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1.5rem 0 2rem; }
@media (min-width: 600px) { .vertical-nav { grid-template-columns: repeat(4, 1fr); } }
.vertical-nav__card { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--fg); transition: border-color 0.12s, transform 0.12s; }
.vertical-nav__card:hover { border-color: var(--accent); transform: translateY(-1px); }
.vertical-nav__label { font-weight: 600; font-size: 1.05rem; color: var(--accent); }
.vertical-nav__count { color: var(--muted); font-size: 0.9rem; }

.jobs-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.5rem; }
.jobs-filters input, .jobs-filters select { padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--bg); color: var(--fg); }
.jobs-filters__search { flex: 1 1 220px; min-width: 200px; }

.quick-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.25rem 0 1.25rem; }
.quick-filters__chip { padding: 0.2rem 0.6rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.quick-filters__chip:hover { border-color: var(--accent); color: var(--accent); }

.jobs-listing__count { color: var(--muted); margin: 0.5rem 0 1rem; font-size: 0.95rem; }
.jobs-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.job-card { border: 1px solid var(--border); border-radius: 8px; transition: border-color 0.12s, transform 0.12s; }
.job-card:hover { border-color: var(--accent); }
.job-card--featured { border-color: var(--accent); background: rgba(0,0,0,0.02); }
.job-card__link { display: block; padding: 1rem; text-decoration: none; color: var(--fg); }
.job-card__head { display: flex; gap: 0.75rem; align-items: flex-start; }
.job-card__logo { width: 36px; height: 36px; border-radius: 4px; object-fit: contain; background: var(--bg); border: 1px solid var(--border); }
.job-card__heading { flex: 1; min-width: 0; }
.job-card__title { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.job-card__company { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.9rem; }
.job-card__meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.job-card__chip, .chip { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.78rem; background: rgba(0,0,0,0.04); color: var(--muted); border: 1px solid var(--border); }
.job-card__chip--salary, .chip--salary { color: var(--accent); border-color: var(--accent); background: transparent; font-weight: 500; }
.job-card__chip--score, .chip--score { color: var(--accent); }
@media (prefers-color-scheme: dark) { .job-card--featured { background: rgba(255,255,255,0.03); } .job-card__chip, .chip { background: rgba(255,255,255,0.05); } }

.job-detail { max-width: 70ch; }
.job-detail__head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 0.75rem; }
.job-detail__logo { width: 56px; height: 56px; border-radius: 6px; object-fit: contain; background: var(--bg); border: 1px solid var(--border); }
.job-detail__title { font-size: 1.6rem; margin: 0; line-height: 1.2; }
.job-detail__company { margin: 0.25rem 0 0; color: var(--muted); }
.job-detail__company a { color: inherit; }
.job-detail__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.job-detail__apply { margin: 1.25rem 0; }
.btn--primary { background: var(--accent); }
.job-detail__source-note { display: block; color: var(--muted); margin-top: 0.4rem; font-size: 0.85rem; }
.job-detail__description h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.job-detail__body { white-space: pre-wrap; font: inherit; line-height: 1.55; }

.company-detail__head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 0.75rem; }
.company-detail__logo { width: 56px; height: 56px; border-radius: 6px; object-fit: contain; background: var(--bg); border: 1px solid var(--border); }
.company-detail__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 1rem; }
.company-detail__about { color: var(--muted); max-width: 60ch; }

.empty { color: var(--muted); padding: 1rem 0; }

/* ===== Subscribe form ===== */
.subscribe { margin: 2rem 0 1rem; padding: 1.25rem 1rem; border: 1px solid var(--border); border-radius: 8px; }
.subscribe--vertical { border-color: var(--accent); }
.subscribe__title { font-size: 1.05rem; margin: 0 0 0.25rem; color: var(--accent); }
.subscribe__intro { color: var(--muted); margin: 0 0 0.75rem; max-width: 60ch; font-size: 0.95rem; }
.subscribe__form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.subscribe__email { flex: 1 1 220px; min-width: 200px; }
.subscribe__email input { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--bg); color: var(--fg); }
.subscribe__cats { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.subscribe__cat-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.subscribe__cat-chip input { accent-color: var(--accent); }
.subscribe__cat-chip:has(input:checked) { color: var(--accent); border-color: var(--accent); }
.subscribe__submit { padding: 0.55rem 1rem; }
.subscribe__legal { color: var(--muted); font-size: 0.8rem; margin: 0.6rem 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== Phase 3 polish ===== */
.home-secondary-nav { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 1.25rem; }
.home-secondary-nav a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--border); }
.home-secondary-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.jobs-filters__clear { padding: 0.5rem 0.7rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; align-self: center; }
.jobs-filters__clear:hover { color: var(--accent); }

.quick-filters__chip--active { color: var(--accent); border-color: var(--accent); background: rgba(0,0,0,0.02); font-weight: 500; }
@media (prefers-color-scheme: dark) { .quick-filters__chip--active { background: rgba(255,255,255,0.04); } }

.jobs-listing__feeds { color: var(--muted); font-size: 0.85rem; margin-left: 0.4rem; }
.jobs-listing__feeds a { color: var(--muted); text-decoration: none; }
.jobs-listing__feeds a:hover { color: var(--accent); }

/* Public companies index */
.companies-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }
.company-row { border: 1px solid var(--border); border-radius: 8px; transition: border-color 0.12s; }
.company-row:hover { border-color: var(--accent); }
.company-row__link { display: flex; gap: 0.9rem; align-items: center; padding: 0.85rem 1rem; text-decoration: none; color: var(--fg); }
.company-row__logo { width: 40px; height: 40px; border-radius: 6px; object-fit: contain; background: var(--bg); border: 1px solid var(--border); flex-shrink: 0; }
.company-row__logo--placeholder { background: var(--border); }
.company-row__main { flex: 1; min-width: 0; }
.company-row__name { margin: 0; font-size: 1.05rem; }
.company-row__meta { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }
.company-row__score .chip { font-size: 0.85rem; padding: 0.25rem 0.65rem; }
.company-row__score .chip--score strong { font-size: 1rem; }
.chip--unscored { color: var(--muted); }
