:root {
  --ink: #182028;
  --muted: #5f6c77;
  --line: rgba(24, 32, 40, 0.12);
  --paper: rgba(255, 255, 255, 0.86);
  --accent: #0e8f74;
  --accent-soft: rgba(14, 143, 116, 0.12);
  --warm: #f2efe7;
  --danger: #ab3f2f;
  --shadow: 0 18px 60px rgba(24, 32, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(245, 206, 160, 0.5), transparent 28%),
    linear-gradient(180deg, #f7f3eb 0%, #ece6da 100%);
}

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

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.hero,
.panel {
  backdrop-filter: blur(16px);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 36px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
.meta-label {
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 0.96;
  max-width: 10ch;
}

.lede {
  max-width: 56rem;
  margin: 18px 0 0;
  font-size: 1.14rem;
  line-height: 1.6;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.hero-meta div,
.watcher-card,
.event {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.hero-meta div {
  padding: 16px 18px;
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel {
  padding: 28px;
  margin-bottom: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill {
  background: rgba(24, 32, 40, 0.07);
  color: var(--ink);
}

.status-pill[data-state="idle"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill[data-state="error"],
.status-pill[data-state="manual_review_needed"] {
  background: rgba(171, 63, 47, 0.12);
  color: var(--danger);
}

.watcher-form,
.watcher-grid,
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.watcher-form label,
.watcher-stats div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watcher-form .wide {
  grid-column: 1 / -1;
}

.watcher-form input,
.watcher-form select,
.watcher-form textarea,
button {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.watcher-form input,
.watcher-form select,
.watcher-form textarea {
  padding: 14px 16px;
}

.watcher-form .checkbox {
  flex-direction: row;
  align-items: center;
}

button {
  cursor: pointer;
  padding: 14px 18px;
  color: var(--ink);
  background: var(--accent-soft);
  border-color: transparent;
  transition: transform 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button.ghost {
  background: rgba(24, 32, 40, 0.06);
  border-color: var(--line);
}

button.danger {
  color: var(--danger);
}

.workflow {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.watcher-grid,
.discovery-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.watcher-card {
  padding: 20px;
}

.discovery-intro {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.discovery-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-field input {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.discovery-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.discovery-summary {
  margin-bottom: 18px;
  color: var(--muted);
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.discovery-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.discovery-card h3 {
  margin-bottom: 8px;
}

.discovery-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.discovery-meta {
  margin: 0 0 12px;
  color: var(--muted);
}

.discovery-links,
.discovery-opportunities {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.discovery-links a,
.discovery-opportunities a {
  color: var(--accent);
  text-decoration: none;
}

.discovery-opportunity {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(14, 143, 116, 0.06);
  border: 1px solid rgba(14, 143, 116, 0.14);
}

.watcher-top,
.watcher-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.watcher-top {
  align-items: start;
}

.watcher-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.watcher-stats dt {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.watcher-stats dd,
.watcher-error,
.watcher-notes {
  margin: 0;
  word-break: break-word;
}

.watcher-error {
  min-height: 1.3em;
  color: var(--danger);
}

.watcher-notes {
  color: var(--muted);
  line-height: 1.5;
}

.watcher-actions {
  margin-top: 18px;
  flex-wrap: wrap;
}

.events {
  display: grid;
  gap: 12px;
}

.event {
  padding: 16px 18px;
}

.event time {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

  .hero,
  .panel {
    border-radius: 22px;
    padding: 22px;
  }

  .hero-meta,
  .watcher-form,
  .watcher-stats,
  .discovery-toolbar {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .watcher-top {
    flex-direction: column;
    align-items: flex-start;
  }
}
