:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #1d2621;
  --muted: #69746d;
  --line: #dbe2dc;
  --accent: #0f766e;
  --accent-dark: #0b5750;
  --warn: #a16207;
  --success: #247a3d;
  --soft: #edf7f3;
  --shadow: 0 14px 34px rgba(36, 49, 43, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.10), transparent 280px),
    var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 48px) 20px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 48px) 40px;
}

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

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

.section-heading,
.actions,
.inline,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.inline {
  align-items: end;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 15px;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover {
  background: var(--soft);
}

button.success {
  background: var(--success);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.badge {
  border-radius: 999px;
  padding: 7px 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.badge.muted {
  background: #eef1ee;
  color: var(--muted);
}

.badge.good {
  background: #e3f7e9;
  color: var(--success);
}

.badge.warn {
  background: #fff4d7;
  color: var(--warn);
}

.email-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.google-info {
  display: grid;
  gap: 10px;
}

.google-info p {
  margin: 0;
  color: var(--muted);
}

.google-info a {
  color: var(--accent-dark);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.email-subject {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf8;
  padding: 12px;
  font-weight: 800;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.log {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding-left: 20px;
}

.log li {
  color: var(--muted);
  line-height: 1.35;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  border-radius: 8px;
  background: #1d2621;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  padding: 13px 15px;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 880px) {
  .topbar,
  .section-heading,
  .inline {
    align-items: stretch;
    flex-direction: column;
  }

  .layout,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .wide {
    grid-column: auto;
  }
}
