:root {
  --bg: #f7f6f1;
  --surface: #ffffff;
  --border: rgba(20, 20, 20, 0.08);
  --border-strong: rgba(20, 20, 20, 0.16);
  --ink: #141414;
  --ink-soft: #6b6b78;
  --ink-softer: #9b9ba8;
  --accent: #5850ec;
  --accent-soft: rgba(88, 80, 236, 0.10);
  --accent-deep: #3d35c4;
  --good: #16a34a;
  --good-soft: rgba(22, 163, 74, 0.10);
  --warn: #ea580c;
  --warn-soft: rgba(234, 88, 12, 0.10);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at top, #ffffff 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ─── Powered-by Crustdata block ─── */
.poweredby {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: color 0.15s;
}
.poweredby:hover { color: var(--ink); }
.poweredby-text { font-weight: 500; }
.poweredby-logo {
  height: 18px;
  width: auto;
  display: block;
}
.poweredby-mini .poweredby-logo { height: 16px; }

/* ─── Masthead ─── */
.masthead-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.poweredby { margin-bottom: 28px; }

/* ─── Top nav tabs (Feed | Insights) ─── */
.tabs {
  display: inline-flex;
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
}
.tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--ink);
  color: #fff;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 6px 14px;
  background: var(--good-soft);
  color: var(--good);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 8.5vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  color: var(--ink);
}

.subtitle {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(15px, 1.7vw, 17px);
  color: var(--ink-soft);
  max-width: 640px;
  line-height: 1.5;
  margin: 0;
  letter-spacing: -0.005em;
}

/* ─── Filters ─── */
.filters {
  max-width: 1080px;
  margin: 36px auto 0;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-family: var(--sans);
}
.filter-group {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}
.seg {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.seg:hover { color: var(--ink); }
.seg.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.filter-divider {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  margin: 0 2px;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 28px 9px 14px;
  cursor: pointer;
  outline: none;
  border-radius: 100px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236b6b78' d='M5 6L0 0h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s, color 0.15s;
}
.select:hover { border-color: var(--border-strong); color: var(--ink); }
.select:focus { border-color: var(--accent); color: var(--ink); }
.select.has-selection {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ─── Feed ─── */
.feed {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.loading, .empty {
  text-align: center;
  padding: 80px 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
}

/* ─── Day section ─── */
.day-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.day-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.day-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.2vw, 44px);
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.05;
}
.day-sub {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-softer);
  white-space: nowrap;
}
.day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─── Job row ─── */
.row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.row:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  border-color: var(--border-strong);
}

.row-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
}
.co-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg);
  object-fit: contain;
  flex-shrink: 0;
}
.co-logo.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink-soft);
  background: var(--bg);
}

.row-head-text { min-width: 0; }
.job-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 4px;
}
.job-co {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  white-space: nowrap;
}
.row-time {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-softer);
  letter-spacing: 0;
}
.row-time.fresh {
  color: var(--good);
  font-weight: 600;
}
.row-time-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: 1px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.row-cta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-softer);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.row:hover .row-cta { color: var(--accent); }

/* ─── Tag row (under title) ─── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0 58px;
}
.tag {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.tag-category {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag-salary {
  background: var(--good-soft);
  color: var(--good);
}
.tag-workplace {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag-location {
  background: rgba(20, 20, 20, 0.05);
  color: var(--ink-soft);
}

.preview {
  margin: 12px 0 0 58px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-family: var(--sans);
}

/* ─── Footer ─── */
.footer {
  margin-top: 64px;
  padding: 28px 24px 40px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}
.footer-note a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-note { font-size: 12px; color: var(--ink-softer); }

/* ─── Insights view ─── */
.insights {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 20px 18px;
}
.kpi-num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 48px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.kpi-lbl {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 10px;
}
.kpi-sub {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-softer);
  margin-top: 4px;
}
.kpi-sub.up { color: var(--good); font-weight: 600; }
.kpi-sub.down { color: var(--warn); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 26px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.card-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}
.card-sub {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-softer);
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 56px;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
}
.bar-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  height: 10px;
  background: rgba(20,20,20,0.04);
  border-radius: 100px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.6s ease;
}
.bar-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.top-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.top-row:last-child { border-bottom: none; }
.top-rank {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  color: var(--ink-softer);
}
.top-main { min-width: 0; }
.top-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 1px;
}
.top-tail {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--good);
  white-space: nowrap;
}
.top-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.top-link:hover .top-title { color: var(--accent); }

.donut-row {
  display: flex;
  align-items: center;
  gap: 24px;
}
.donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.donut-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13.5px;
}
.donut-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.donut-item-name { color: var(--ink); font-weight: 500; }
.donut-item-pct { color: var(--ink-soft); font-weight: 600; }

/* ─── Tablet ─── */
@media (max-width: 820px) {
  .masthead-inner { padding: 26px 18px 8px; }
  .poweredby { margin-bottom: 22px; }
  .title { font-size: clamp(40px, 9vw, 64px); }
  .live-pill { margin-top: 14px; font-size: 11px; padding: 5px 12px; }
  .filters { margin-top: 22px; padding: 0 14px; }
  .feed { padding: 26px 14px; gap: 32px; }

  .day-title { font-size: clamp(24px, 5vw, 32px); }

  .row { padding: 14px; border-radius: 14px; }
  .row-head {
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
  }
  .co-logo { width: 42px; height: 42px; border-radius: 10px; }
  .job-title { font-size: 15.5px; line-height: 1.3; }
  .job-co { font-size: 12.5px; }

  .row-cta { display: none; }
  .row-time { font-size: 11px; }

  .tags { margin: 10px 0 0 54px; gap: 5px; }
  .tag { font-size: 11px; padding: 3px 9px; }
  .preview { margin: 10px 0 0 54px; font-size: 12.5px; line-height: 1.5; }
}

@media (max-width: 820px) {
  .insights { padding: 26px 14px 18px; gap: 20px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 16px; border-radius: 14px; }
  .kpi-num { font-size: clamp(28px, 8vw, 38px); }
  .card { padding: 18px 18px; border-radius: 14px; }
  .card-title { font-size: 22px; }
  .card-grid-2 { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 110px 1fr 44px; gap: 10px; }
  .bar-label { font-size: 12.5px; }
  .bar-value { font-size: 12px; }
  .donut { width: 110px; height: 110px; }
}

/* ─── Phone ─── */
@media (max-width: 480px) {
  body { background: radial-gradient(ellipse at top, #ffffff 0%, var(--bg) 50%); }

  .masthead-inner { padding: 22px 14px 6px; }
  .poweredby-text { display: none; }
  .poweredby { margin-bottom: 16px; }
  .title { font-size: clamp(34px, 11vw, 48px); line-height: 0.95; }
  .subtitle { font-size: 14px; line-height: 1.45; }

  .filters {
    margin-top: 18px;
    padding: 0 10px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-divider { display: none; }
  .seg { padding: 7px 12px; font-size: 12.5px; }
  .select { padding: 8px 26px 8px 12px; font-size: 12.5px; }

  .feed { padding: 22px 12px 16px; gap: 28px; }
  .day-section { gap: 12px; }
  .day-title { font-size: 26px; }
  .day-sub { font-size: 10.5px; letter-spacing: 0.1em; }

  .row { padding: 13px; border-radius: 12px; }
  .row-head { gap: 11px; grid-template-columns: 36px 1fr auto; }
  .co-logo { width: 36px; height: 36px; border-radius: 8px; }
  .co-logo.placeholder { font-size: 15px; }
  .job-title { font-size: 14.5px; }
  .job-co { font-size: 12px; }
  .row-time { font-size: 10.5px; }
  .row-time-dot { width: 5px; height: 5px; margin-right: 4px; }

  .tags { margin: 9px 0 0 47px; gap: 4px; }
  .tag { font-size: 10.5px; padding: 3px 8px; border-radius: 100px; }
  .preview { margin: 9px 0 0 47px; font-size: 12px; line-height: 1.45; }

  .footer { margin-top: 40px; padding: 18px 14px 24px; }
  .footer-inner { font-size: 12px; }

  .tabs { margin-top: 16px; padding: 3px; }
  .tab { padding: 7px 16px; font-size: 12.5px; }

  .insights { padding: 22px 12px 16px; gap: 16px; }
  .kpi-grid { gap: 8px; }
  .kpi { padding: 14px; }
  .kpi-lbl { font-size: 10.5px; }
  .card { padding: 16px; }
  .card-title { font-size: 19px; }
  .bar-row { grid-template-columns: 90px 1fr 40px; gap: 8px; }
  .top-row { padding: 9px 0; }
  .top-title { font-size: 13px; }
  .top-tail { font-size: 12.5px; }
  .donut-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .donut { width: 130px; height: 130px; align-self: center; }
}

/* ---------- Job description accordion ---------- */

.job-desc {
  margin-top: 10px;
  border-top: 1px solid #ece9e0;
  padding-top: 10px;
}
.job-desc[open] { padding-bottom: 4px; }
.job-desc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  padding: 6px 2px;
  font-size: 13px;
  font-weight: 600;
  color: #5e5b54;
  user-select: none;
}
.job-desc-summary::-webkit-details-marker { display: none; }
.job-desc-summary:hover { color: #1a1816; }
.job-desc-chev {
  font-size: 14px;
  transition: transform 0.18s ease;
  color: #8e8a82;
}
.job-desc[open] .job-desc-chev { transform: rotate(180deg); }
.job-desc-body {
  padding: 10px 4px 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #2a2824;
  max-height: 480px;
  overflow-y: auto;
}
.job-desc-body p { margin: 0 0 0.7em; }
.job-desc-body ul, .job-desc-body ol { margin: 0.4em 0 0.8em; padding-left: 22px; }
.job-desc-body li { margin: 0.2em 0; }
.job-desc-body h1, .job-desc-body h2, .job-desc-body h3, .job-desc-body h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0.9em 0 0.3em;
  color: #1a1816;
}
.job-desc-body a {
  color: #c2410c;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.job-desc-body strong { color: #1a1816; }

/* ---------- CSV download button + insights window toggle ---------- */

.seg-download {
  background: transparent;
  color: #5e5b54;
  border: 1px solid #d8d4c8;
  font-weight: 600;
}
.seg-download:hover { background: #f4f0e6; color: #1a1816; }

.insights-window {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.insights-window-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8e8a82;
}
.insights-window-toggle {
  display: inline-flex;
  border: 1px solid #d8d4c8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.insights-win-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #5e5b54;
  cursor: pointer;
}
.insights-win-btn:hover { color: #1a1816; }
.insights-win-btn.active {
  background: #1a1816;
  color: #fff;
}
