:root {
  --bg: #f7f8fa; --surface: #ffffff; --text: #14171f; --muted: #5b6472;
  --border: #e4e7ec; --brand: #2b59ff; --brand-ink: #ffffff;
  --chip-bg: #eef1f6; --chip-ink: #37414f; --remote: #0f9d58; --salary: #7a5cff;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f14; --surface: #161a22; --text: #e8ebf1; --muted: #9aa4b2;
    --border: #262c38; --brand: #5b7cff; --brand-ink: #0d0f14;
    --chip-bg: #222834; --chip-ink: #c3cad6; --remote: #35c07a; --salary: #a48bff;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.wrap { width: 100%; max-width: 940px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1180px; }
a { color: inherit; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 22px 0; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand span { color: var(--brand); }
.tagline { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 20px 0 12px;
}
.filters input[type=search], .filters select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; min-height: 40px;
}
.filters input[type=search] { flex: 1 1 240px; }
.filters select { flex: 0 1 auto; max-width: 100%; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.btn, .btn-ghost {
  font: inherit; cursor: pointer; border-radius: 9px; padding: 9px 15px; min-height: 40px; border: 1px solid var(--border);
}
.btn { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 600; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn:hover { filter: brightness(1.05); }

.status { color: var(--muted); font-size: 13px; margin: 8px 2px 14px; }

/* Two-pane board: scrollable job list on the left, sticky detail on the right. */
.board { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 18px; align-items: start; margin-bottom: 40px; }
.board-list { min-width: 0; }
.board-detail {
  position: sticky; top: 16px; align-self: start;
  max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.detail-placeholder { color: var(--muted); text-align: center; padding: 64px 16px; }

.results { display: grid; grid-template-columns: 1fr; gap: 8px; }
.results:focus-visible { outline: none; }

.card {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.card:hover { border-color: var(--brand); }
.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card[aria-selected="true"] {
  border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}
.card-avatar {
  width: 44px; height: 44px; border-radius: 10px; background: var(--chip-bg); color: var(--chip-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.card-body { min-width: 0; }
.card-title { margin: 0 0 3px; font-size: 15.5px; line-height: 1.3; }
.card-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-company { font-weight: 600; color: var(--text); }
.card-sep { opacity: .5; }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-ink); white-space: nowrap;
}
.chip-remote { color: #fff; background: var(--remote); }
.chip-salary { color: #fff; background: var(--salary); }
.card-snippet { margin: 9px 0 0; color: var(--muted); font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Detail pane content */
.detail-head { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; }
.detail-avatar { width: 48px; height: 48px; border-radius: 10px; background: var(--chip-bg); color: var(--chip-ink); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.detail-headmain { min-width: 0; }
.detail-title { margin: 0 0 5px; font-size: 20px; line-height: 1.25; }
.detail-meta { color: var(--muted); font-size: 13.5px; }
.detail-company { color: var(--text); font-weight: 600; }
.detail-head .card-chips { margin-top: 10px; }
.detail-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 4px; }
.detail-apply { text-decoration: none; }
.detail-close { display: none; }
.detail-desc { margin-top: 14px; font-size: 14.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.detail-desc :where(h1, h2, h3, h4, h5, h6) { font-size: 15.5px; margin: 18px 0 6px; }
.detail-desc p { margin: 0 0 10px; }
.detail-desc ul, .detail-desc ol { margin: 0 0 12px; padding-left: 20px; }
.detail-desc li { margin: 3px 0; }
.detail-desc a { color: var(--brand); }
.detail-desc pre { white-space: pre-wrap; }
.detail-loading, .detail-empty { color: var(--muted); }
.detail-src { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.more-row { display: flex; justify-content: center; margin: 20px 0 8px; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 20px 0; margin-top: 20px; }
.site-footer p { margin: 4px 0; color: var(--muted); font-size: 13px; }

/* Below the two-pane breakpoint: single column; detail slides over full-screen. */
@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; }
  .board-detail {
    position: fixed; inset: 0; z-index: 60; height: 100dvh; max-height: none;
    border: 0; border-radius: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    display: none;
  }
  .board.detail-open .board-detail { display: block; }
  .board.detail-open { position: relative; }
  .detail-close { display: inline-block; order: -1; }
  .detail-actions { position: sticky; top: 0; background: var(--surface); padding-bottom: 8px; margin-top: 0; }
}

@media (max-width: 560px) {
  .card { grid-template-columns: 36px 1fr; }
  .card-avatar { width: 36px; height: 36px; }
  .filters select { flex: 1 1 45%; }
}
