:root {
  --bg: #f4f7fb;
  --bg-accent: #e7eef9;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: #f7f9fc;
  --border: rgba(16, 24, 40, 0.08);
  --border-strong: rgba(16, 24, 40, 0.14);
  --text: #102033;
  --muted: #5d6b7f;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --success: #1d4ed8;
  --warning: #a16207;
  --error: #b42318;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.08), transparent 32%),
    radial-gradient(circle at right, rgba(15, 118, 110, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.search-surface,
.files-panel,
.job-row,
.empty-state {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar,
.search-surface,
.files-panel,
.job-row,
.empty-state {
  border-radius: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 20px;
  padding: 24px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  color: var(--accent-strong);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  max-width: 13ch;
}

.subcopy {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.65;
}

.topbar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-chip {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 244, 250, 0.96));
  border: 1px solid rgba(16, 24, 40, 0.06);
}

.stat-chip span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 18px;
  margin-top: 18px;
}

.search-surface,
.files-panel {
  padding: 20px;
}

.search-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.search-form label,
.site-picker {
  display: grid;
  gap: 9px;
}

.search-form span,
.site-picker legend {
  font-size: 0.92rem;
  font-weight: 700;
}

.search-form input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  font: inherit;
  color: var(--text);
}

.search-form input:focus,
.site-option input:focus + span {
  outline: none;
  border-color: rgba(29, 78, 216, 0.3);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
}

.site-picker {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.site-picker legend {
  padding: 0;
}

.site-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-option {
  position: relative;
}

.site-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.site-option span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.site-option input:checked + span {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, 0.24);
}

.site-option span:hover,
.primary-action:hover,
.secondary-action:hover,
.job-link:hover,
.file-item:hover {
  transform: translateY(-1px);
}

.action-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 2px;
}

.primary-action,
.secondary-action,
.job-link,
.file-item {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.secondary-action {
  background: #eaf1ff;
  color: var(--success);
}

.notice,
.inline-note {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 16px;
  line-height: 1.5;
}

.notice.warning {
  background: rgba(161, 98, 7, 0.1);
  color: var(--warning);
}

.notice.error {
  background: rgba(180, 35, 24, 0.1);
  color: var(--error);
}

.inline-note {
  background: var(--surface-muted);
  color: var(--muted);
}

.panel-heading h2 {
  font-size: 1.5rem;
}

.file-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.file-item strong {
  display: block;
  word-break: break-word;
}

.file-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.file-item span {
  white-space: nowrap;
  color: var(--success);
  font-weight: 800;
}

.empty-files {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-muted);
  color: var(--muted);
}

.empty-files p,
.results-copy,
.description,
.empty-state p {
  margin: 0;
}

.results-section {
  margin-top: 22px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.results-header h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.results-copy {
  max-width: 38ch;
  color: var(--muted);
  line-height: 1.55;
  text-align: right;
}

.results-list {
  display: grid;
  gap: 12px;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 20px;
  align-items: start;
}

.job-main {
  min-width: 0;
}

.job-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.job-title-row h3 {
  font-size: 1.18rem;
}

.company {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.site-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: capitalize;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.job-meta strong {
  color: var(--text);
}

.description {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.job-actions {
  display: flex;
  align-items: start;
}

.job-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(29, 78, 216, 0.14);
  background: #f5f8ff;
  color: var(--success);
  text-decoration: none;
  font-weight: 800;
}

.empty-state {
  padding: 34px 22px;
  text-align: center;
}

.empty-state p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

code {
  padding: 0.16rem 0.4rem;
  border-radius: 0.45rem;
  background: rgba(16, 24, 40, 0.06);
}

@media (max-width: 980px) {
  .topbar,
  .workspace,
  .search-form {
    grid-template-columns: 1fr;
  }

  .topbar-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .topbar,
  .search-surface,
  .files-panel,
  .job-row,
  .empty-state {
    border-radius: 20px;
  }

  .topbar,
  .search-surface,
  .files-panel,
  .job-row {
    padding: 16px;
  }

  .topbar-stats {
    grid-template-columns: 1fr;
  }

  .results-header,
  .job-row,
  .job-title-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: start;
  }

  .results-copy {
    text-align: left;
  }

  .job-actions {
    width: 100%;
  }

  .job-link,
  .primary-action,
  .secondary-action {
    width: 100%;
    justify-content: center;
  }

  .file-item {
    align-items: start;
    flex-direction: column;
  }
}
