:root {
  color-scheme: light;
  --bg: #f2f4f8;
  --panel: #ffffff;
  --text: #162033;
  --muted: #5b677d;
  --border: #d6dce7;
  --primary: #1a73e8;
  --primary-ink: #ffffff;
  --shadow: 0 16px 40px rgba(15, 30, 60, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #eef3fb 0%, var(--bg) 100%);
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
}

code,
pre,
textarea,
input {
  font-family: Consolas, "Courier New", monospace;
}

.wrap {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(242, 244, 248, 0.85);
  border-bottom: 1px solid rgba(214, 220, 231, 0.9);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.site-header nav {
  display: flex;
  gap: 16px;
}

.brand {
  font-weight: 700;
  color: var(--text);
}

main.wrap {
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-tight {
  grid-template-columns: 1.2fr 0.8fr;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

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

.compact-stack {
  gap: 14px;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.search-form {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfcff;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--primary);
  color: var(--primary-ink);
  cursor: pointer;
  font-weight: 600;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
}

.button-secondary {
  background: #edf3ff;
  color: #0d57b8;
}

.button-danger {
  background: #d14343;
  color: #ffffff;
}

label {
  display: grid;
  gap: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 14px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

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

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.alert.success {
  background: #edf9f1;
  border-color: #b7e3c5;
  color: #1f6b39;
}

.alert.error {
  background: #fff2f2;
  border-color: #f0c2c2;
  color: #9f2a2a;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-badge.good {
  background: #edf9f1;
  border-color: #b7e3c5;
  color: #1f6b39;
}

.status-badge.warn {
  background: #fff6e8;
  border-color: #f0d2a0;
  color: #9a6410;
}

.status-badge.bad {
  background: #fff2f2;
  border-color: #f0c2c2;
  color: #9f2a2a;
}

.status-badge.neutral {
  background: #eef2f7;
  border-color: #d6dce7;
  color: #41516d;
}

.compact-table th,
.compact-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.domains-table td {
  min-width: 0;
}

.domain-name {
  font-weight: 700;
  margin-bottom: 4px;
}

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

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 24px;
  background: #fbfcff;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.meta-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.meta-grid dt {
  color: var(--muted);
  font-weight: 600;
}

.meta-grid dd {
  margin: 0;
}

.message-body {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfcff;
  white-space: pre-wrap;
  overflow-x: auto;
}

.html-body {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfcff;
  overflow: auto;
}

.mail-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.attachment-list {
  display: grid;
  gap: 12px;
  padding-left: 20px;
}

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

  .search-form {
    flex-direction: column;
  }

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

  .panel-head {
    flex-direction: column;
  }

  .action-stack,
  .button-row,
  .inline-form {
    width: 100%;
  }

  .inline-form button,
  .button-link {
    width: 100%;
  }
}
