:root {
  --bg-main: #f4f2e8;
  --bg-panel: #fffdf6;
  --ink: #1f2a30;
  --ink-soft: #4e5c65;
  --line: #d7d2c2;
  --brand: #0f7a6c;
  --brand-deep: #085d53;
  --warn: #b7791f;
  --danger: #b33a2f;
  --good: #1b7a3f;
  --shadow: 0 14px 40px rgba(18, 25, 28, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 6% -8%, rgba(255, 214, 139, 0.34), transparent 58%),
    radial-gradient(900px 500px at 95% 8%, rgba(138, 227, 205, 0.24), transparent 52%),
    linear-gradient(170deg, #f8f5ea 0%, #eef4ec 52%, #eff3f6 100%);
  font-family: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.35;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(48px);
  pointer-events: none;
  opacity: 0.72;
}

.orb-a {
  width: 340px;
  height: 340px;
  background: rgba(255, 185, 91, 0.34);
  left: -84px;
  top: 16px;
}

.orb-b {
  width: 390px;
  height: 390px;
  background: rgba(46, 188, 167, 0.24);
  right: -110px;
  top: 130px;
}

.app-shell {
  width: min(1260px, 96vw);
  margin: 28px auto 56px;
  display: grid;
  gap: 18px;
}

.panel {
  background: color-mix(in srgb, var(--bg-panel) 90%, white);
  border: 1px solid color-mix(in srgb, var(--line) 88%, #f4f0e6);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.lift {
  transform: translateY(0);
  animation: panel-enter 300ms ease-out;
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  background:
    linear-gradient(130deg, rgba(10, 104, 92, 0.94) 0%, rgba(9, 87, 79, 0.94) 38%, rgba(21, 65, 96, 0.92) 100%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.05) 10px,
      transparent 10px,
      transparent 20px
    );
  color: #ecfff9;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.76rem;
  opacity: 0.82;
}

.hero h1 {
  margin: 8px 0 8px;
  font: 700 clamp(1.55rem, 2.8vw, 2.4rem) / 1.1 "Fraunces", Georgia, serif;
}

.hero-sub {
  margin: 0;
  max-width: 70ch;
  color: rgba(235, 255, 248, 0.9);
}

h2,
h3,
h4 {
  margin: 0 0 12px;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 1.26rem;
}

h3 {
  font-size: 1.1rem;
}

h4 {
  font-size: 0.98rem;
}

.section-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 10px;
}

.compact {
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 88%, #c5c0b2);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 52%, white);
  outline-offset: 1px;
}

button {
  border: 1px solid var(--brand);
  border-radius: 11px;
  padding: 9px 13px;
  cursor: pointer;
  color: #f4fffc;
  background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(7, 88, 79, 0.23);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.button-ghost {
  background: #f9fbfa;
  color: var(--brand-deep);
  border-color: color-mix(in srgb, var(--brand) 50%, #c4dbd6);
}

.toolbar,
.title-row,
.button-row,
.row-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.title-row {
  justify-content: space-between;
}

.grow {
  flex: 1;
}

.status {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.status.muted {
  opacity: 0.86;
}

.status-error {
  color: var(--danger);
}

.kv-grid {
  margin: 14px 0 0;
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kv-grid div {
  padding: 9px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--line) 90%, #c9c3b4);
  background: #fdfaf4;
}

.kv-grid dt {
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.kv-grid dd {
  margin: 5px 0 0;
  font-size: 0.87rem;
  word-break: break-all;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  position: relative;
  flex: 1;
  min-height: 16px;
  border-radius: 999px;
  background: #e6ece8;
  border: 1px solid #d4ddd6;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22b898 0%, #1a8b78 100%);
  transition: width 240ms ease;
}

#job-progress-label {
  min-width: 50px;
  text-align: right;
  font-weight: 600;
}

.metric-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-grid article {
  border: 1px solid #d8d5c7;
  border-radius: 12px;
  background: #fffefa;
  padding: 10px;
}

.metric-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #61717b;
}

.metric-value {
  margin: 4px 0 0;
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  font-weight: 700;
}

.filters {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.review-grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.5fr);
}

.question-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  max-height: 600px;
  overflow: auto;
}

.question-item {
  border: 1px solid #d6d2c2;
  border-radius: 12px;
  background: #fffefb;
  padding: 10px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.question-item:hover {
  transform: translateY(-1px);
  border-color: #c0b99f;
}

.question-item.active {
  border-color: #1b8f7b;
  box-shadow: 0 0 0 1px rgba(27, 143, 123, 0.3);
}

.question-item p {
  margin: 7px 0;
  color: #5b6870;
  font-size: 0.86rem;
}

.question-item.empty {
  cursor: default;
}

.detail-card {
  border: 1px solid #d8d3c4;
  border-radius: 14px;
  background: #fffdfa;
  padding: 12px;
}

.hidden {
  display: none !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}

.badge.subtle {
  color: #4a5963;
  background: #f0f4f7;
  border-color: #d8e0e6;
}

.badge.warn {
  color: #7f550f;
  background: #fff4df;
  border-color: #f5d6a3;
}

.badge.danger {
  color: #7d2019;
  background: #fde8e6;
  border-color: #f3b7b2;
}

.badge.good {
  color: #1f5f35;
  background: #e8f8ec;
  border-color: #bde5c7;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.mini-table th,
.mini-table td {
  text-align: left;
  border-bottom: 1px solid #e3ded0;
  padding: 6px 7px;
  font-size: 0.85rem;
}

.mini-table th {
  color: #5f6f79;
  font-weight: 600;
}

.source-events {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.event-item {
  font-size: 0.86rem;
  color: #3f4d55;
}

.panel-inline {
  margin-top: 14px;
  border: 1px dashed #d6d0be;
  border-radius: 12px;
  padding: 12px;
  background: #fcfaf4;
}

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

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

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

  .review-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(96vw, 100%);
    margin-top: 14px;
    gap: 12px;
  }

  .panel {
    padding: 12px;
    border-radius: 14px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kv-grid {
    grid-template-columns: 1fr;
  }
}
