:root {
  color-scheme: light;
  --bg: #f4efe7;
  --bg-accent: #efe4d2;
  --panel: rgba(255, 251, 246, 0.9);
  --panel-strong: #fffdf9;
  --border: rgba(73, 52, 33, 0.16);
  --text: #24180c;
  --muted: #685947;
  --accent: #d66b2d;
  --accent-strong: #aa3e00;
  --success: #1f7a55;
  --warning: #8b5a00;
  --danger: #9e2f2f;
  --shadow: 0 18px 50px rgba(64, 36, 8, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 107, 45, 0.2), transparent 28%),
    radial-gradient(circle at right, rgba(108, 142, 191, 0.16), transparent 24%),
    linear-gradient(180deg, #f9f3ea 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 420px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-copy {
  padding: 32px;
  border-radius: var(--radius-xl);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  line-height: 0.96;
}

.lead {
  margin: 18px 0 0;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(36, 24, 12, 0.95), rgba(93, 53, 18, 0.92)),
    var(--panel);
  color: #f7ede3;
}

.hero-stat {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(247, 237, 227, 0.16);
}

.hero-stat:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hero-stat span {
  color: rgba(247, 237, 227, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  grid-template-areas:
    "controls history"
    "results results";
}

.control-panel {
  grid-area: controls;
}

.history-panel {
  grid-area: history;
}

.results-panel {
  grid-area: results;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.lookup-form,
.checks-grid {
  display: grid;
  gap: 20px;
}

.mode-row {
  display: grid;
}

.mode-toggle {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(36, 24, 12, 0.04);
  cursor: pointer;
}

.mode-toggle input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  margin: 0;
}

.mode-toggle span {
  font-weight: 700;
}

.mode-toggle small {
  color: var(--muted);
}

.input-group {
  display: grid;
  gap: 10px;
}

.input-group span,
.checks-grid legend,
.panel-head h2 {
  font-weight: 700;
}

.input-group input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--panel-strong);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.input-group input:focus {
  border-color: rgba(214, 107, 45, 0.9);
  box-shadow: 0 0 0 4px rgba(214, 107, 45, 0.14);
  transform: translateY(-1px);
}

.action-row,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

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

.primary-button,
.secondary-button,
.ghost-button {
  padding: 14px 18px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #ff924f);
  color: white;
  box-shadow: 0 16px 28px rgba(214, 107, 45, 0.25);
}

.secondary-button {
  background: rgba(36, 24, 12, 0.08);
  color: var(--text);
}

.chip-button {
  background: rgba(36, 24, 12, 0.06);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 700;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  padding-inline: 0;
}

.preset-row,
.preset-buttons,
.results-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preset-copy,
.panel-subtitle,
.result-meta,
.history-meta {
  color: var(--muted);
}

.checks-grid {
  border: 0;
  padding: 0;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.check-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
}

.check-card input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  margin: 0 0 4px;
}

.check-card span {
  font-weight: 700;
}

.check-card small,
.result-list {
  font-family: "IBM Plex Mono", monospace;
}

.history-list,
.results-grid {
  display: grid;
  gap: 14px;
}

.history-item,
.result-card {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.56);
}

.history-item {
  display: grid;
  gap: 6px;
}

.history-domain {
  font-weight: 700;
}

.empty-state {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  color: var(--muted);
}

.results-grid {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.result-card {
  display: grid;
  gap: 14px;
}

.debug-banner {
  margin-top: 16px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(108, 142, 191, 0.22);
  background: rgba(108, 142, 191, 0.1);
  color: #24415f;
  font-size: 0.95rem;
}

.insights-panel {
  margin-top: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.45);
}

.insights-list {
  display: grid;
  gap: 12px;
}

.insight-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(36, 24, 12, 0.04);
}

.insight-card[data-severity="critical"] {
  border-color: rgba(158, 47, 47, 0.28);
  background: rgba(158, 47, 47, 0.08);
}

.insight-card[data-severity="warning"] {
  border-color: rgba(139, 90, 0, 0.28);
  background: rgba(139, 90, 0, 0.08);
}

.insight-card[data-severity="info"] {
  border-color: rgba(31, 122, 85, 0.24);
  background: rgba(31, 122, 85, 0.07);
}

.insight-title {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.insight-body {
  margin: 0;
  color: var(--muted);
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

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

.result-meta {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.status-pill,
.loading-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill[data-status="success"] {
  background: rgba(31, 122, 85, 0.12);
  color: var(--success);
}

.status-pill[data-status="warning"] {
  background: rgba(139, 90, 0, 0.12);
  color: var(--warning);
}

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

.loading-indicator {
  background: rgba(36, 24, 12, 0.08);
  color: var(--text);
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  word-break: break-word;
}

.result-list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(36, 24, 12, 0.05);
}

.resolver-list {
  display: grid;
  gap: 10px;
}

.resolver-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(36, 24, 12, 0.03);
  overflow: hidden;
}

.resolver-card summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 700;
}

.resolver-card summary::-webkit-details-marker {
  display: none;
}

.resolver-meta {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.resolver-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.resolver-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resolver-stats span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(36, 24, 12, 0.06);
  font-size: 0.8rem;
  color: var(--muted);
}

.raw-json {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: #20170f;
  color: #f7ede3;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "controls"
      "history"
      "results";
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-inline: 14px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 20px;
  }

  .action-row {
    align-items: stretch;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .preset-buttons {
    width: 100%;
  }
}
