:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --card-bg: rgba(255, 255, 255, 0.85);
  --border: rgba(148, 163, 184, 0.3);
  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.15);
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  background-attachment: fixed;
  color: var(--text);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: 0.92;
  z-index: -1;
}

.app-header,
.app-footer {
  text-align: center;
  padding: 2rem 1rem;
}

.app-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.app-header p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
  margin-inline: auto;
}

.app-main {
  max-width: 1200px;
  margin: 0 auto 4rem;
  display: grid;
  gap: 2rem;
  padding: 0 1.5rem 3rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 18px 40px -25px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(12px);
}

#checker-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-weight: 600;
}

textarea {
  resize: vertical;
  min-height: 160px;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-size: 1rem;
  line-height: 1.5;
  background: rgba(248, 250, 252, 0.9);
  color: var(--text);
  transition: border-color 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

button {
  cursor: pointer;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: none;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 25px -12px rgba(37, 99, 235, 0.6);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-light);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px -20px rgba(15, 23, 42, 0.4);
}

.results-card {
  overflow: hidden;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.status-indicator {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
}

.status-indicator.running {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.12);
}

.status-indicator.success {
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
}

.status-indicator.error {
  color: var(--error);
  background: rgba(220, 38, 38, 0.12);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th,
td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  vertical-align: top;
}

th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge.ok {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.badge.warn {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}

.badge.error {
  background: rgba(220, 38, 38, 0.12);
  color: var(--error);
}

.screenshot-thumb {
  width: 240px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.55);
}

.placeholder td {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
}

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

  .results-card {
    overflow: visible;
  }

  table {
    min-width: unset;
  }

  .screenshot-thumb {
    width: 100%;
  }
}
