:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-muted: #eef4f1;
  --text: #1c2523;
  --muted: #63716d;
  --border: #d7dfdb;
  --accent: #0d6f68;
  --accent-strong: #084f4a;
  --amber: #aa6b12;
  --danger: #9c1f2e;
  --shadow: 0 18px 48px rgba(28, 37, 35, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(13, 111, 104, 0.08), transparent 36%),
    linear-gradient(310deg, rgba(170, 107, 18, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent-strong);
  font-weight: 700;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  padding: 48px 0 28px;
}

.header-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
}

h2 {
  font-size: 1rem;
}

.lede {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.header-link,
.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
}

.header-link,
.primary-button {
  border: 1px solid transparent;
  background: var(--accent);
  color: #ffffff;
}

.header-link:hover,
.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--surface-muted);
}

.ghost-button {
  min-height: 36px;
  padding-inline: 12px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 18px;
  padding-bottom: 48px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.pill {
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.form-grid,
.actions-grid {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(13, 111, 104, 0.22);
  outline-offset: 2px;
}

.state-list {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--border);
}

.state-list div {
  display: grid;
  gap: 4px;
  background: var(--surface);
  padding: 16px 20px;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.message-field {
  grid-column: 1 / -1;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.log-list {
  display: grid;
  gap: 12px;
  min-height: 140px;
  max-height: 420px;
  margin: 0;
  padding: 20px 20px 20px 44px;
  overflow: auto;
}

.log-list:empty::before {
  content: "No smoke events yet.";
  color: var(--muted);
}

.log-entry {
  padding-left: 4px;
}

.log-entry strong {
  display: block;
}

.log-entry span {
  color: var(--muted);
  font-size: 0.88rem;
}

.log-entry.error strong {
  color: var(--danger);
}

@media (max-width: 760px) {
  .site-header {
    padding-top: 32px;
  }

  .header-grid,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .header-link {
    width: 100%;
  }
}
