:root {
  --bg: #07090d;
  --surface: #111722;
  --surface-2: #171f2c;
  --line: #2b3443;
  --line-strong: #3b4a5f;
  --text: #f3f7fd;
  --muted: #a6b0bf;
  --accent: #34d1a5;
  --success: #4db37f;
  --warn: #d3a24e;
  --danger: #d96a6a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  padding: 16px;
}

h1,
h2,
p {
  margin: 0;
}

.observer-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
  margin-bottom: 12px;
}

.kicker {
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.sub {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.meta-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
}

.meta-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-value {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 700;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.watchers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.watcher-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1621;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.watcher-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.watcher-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.watcher-id a {
  color: #91c3ff;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
}

.watcher-meta {
  font-size: 0.74rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

.watcher-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.list {
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101925;
  padding: 8px 9px;
}

.log-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.log-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-family: 'IBM Plex Mono', monospace;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.success {
  background: #234d36;
  color: #deffe8;
}

.badge.warn {
  background: #5e4826;
  color: #fff2dd;
}

.badge.info {
  background: #274160;
  color: #deebff;
}

.badge.error {
  background: #5f2f35;
  color: #ffe6e6;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #05120d;
}

.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-dialog {
  position: relative;
  margin: 4vh auto;
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.watcher-modal-body {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.watcher-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101722;
  padding: 10px;
}

.watcher-group-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.watcher-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.watcher-item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c121a;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.watcher-item-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #090d13;
}

.watcher-item-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.watcher-item-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

.toasts {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 8px;
  z-index: 40;
}

.toast {
  min-width: 220px;
  max-width: 330px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px 9px;
}

.toast.warn {
  border-left-color: var(--warn);
}

.toast.error {
  border-left-color: var(--danger);
}

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

@media (max-width: 620px) {
  body {
    padding: 12px;
  }

  .observer-header {
    flex-direction: column;
  }

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

  .btn {
    width: 100%;
  }
}
