* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
}

.hero, .panel {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.hero p {
  margin: 0;
  color: #9ca3af;
  max-width: 760px;
}

.boost-box {
  min-width: 280px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.boost-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #60a5fa;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.controls {
  display: grid;
  gap: 16px;
}

.bucket-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-wrap {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-wrap input {
  width: 100%;
  padding: 12px 14px;
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 12px;
  outline: none;
}

.search-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.tab,
button {
  border: 1px solid #334155;
  background: #1e293b;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.tab.active,
button.primary {
  background: #2563eb;
  border-color: #2563eb;
}

button.secondary {
  background: #111827;
}

button.small {
  padding: 8px 10px;
  font-size: 0.9rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.breadcrumb-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

code {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 8px 10px;
}

.grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 18px;
}

.panel-head,
.job-head,
.result-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.panel-head h2,
.result-section-head h3 {
  margin: 0;
}

.result-section + .result-section {
  margin-top: 18px;
}

.result-section-head {
  margin: 4px 0 12px;
  color: #cbd5e1;
}

.result-section-head span {
  color: #94a3b8;
  font-size: 0.92rem;
}

.status-pill,
.badge,
.inline-kind {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid #334155;
}

.inline-kind {
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.45);
}

.badge.running { background: #1d4ed8; }
.badge.success { background: #15803d; }
.badge.error { background: #b91c1c; }
.badge.queued, .badge.scanning { background: #7c3aed; }

.browser-list,
.stack,
.result-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.browser-item,
.job-card,
.history-card {
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 16px;
}

.browser-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.card-directory {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-color: rgba(96, 165, 250, 0.18);
}

.card-file {
  background: linear-gradient(180deg, rgba(20, 83, 45, 0.22), rgba(11, 18, 32, 0.95));
  border-color: rgba(34, 197, 94, 0.16);
}

.job-card,
.history-card {
  background: #0b1220;
}

.browser-main {
  min-width: 0;
  flex: 1 1 auto;
}

.browser-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.browser-title,
.job-title {
  font-weight: 700;
  word-break: break-word;
}

.browser-meta,
.job-meta {
  color: #94a3b8;
  font-size: 0.92rem;
  margin-top: 4px;
  word-break: break-word;
}

.browser-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.right-actions {
  margin-left: auto;
  justify-content: flex-end;
  align-self: center;
  flex: 0 0 auto;
}

.progress {
  height: 12px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.empty {
  padding: 22px;
  border: 1px dashed #334155;
  border-radius: 14px;
  color: #94a3b8;
}

.empty.error {
  color: #fca5a5;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .browser-item {
    flex-direction: column;
    align-items: stretch;
  }

  .right-actions {
    margin-left: 0;
    justify-content: flex-start;
  }
}
