:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #182024;
  --muted: #65727a;
  --line: #d8e0e4;
  --accent: #126c59;
  --accent-strong: #0b4f42;
  --warn: #9f3a1d;
  --shadow: 0 18px 45px rgba(32, 45, 54, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

h2 {
  font-size: 20px;
}

.status-pill {
  min-width: 132px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #edf2f1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.status-pill.connected {
  background: #e3f2ec;
  border-color: #9fcabf;
  color: var(--accent-strong);
}

.status-pill.error {
  background: #f8e8df;
  border-color: #e6b39c;
  color: var(--warn);
}

.auth-strip,
.profile-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-strip {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.workspace {
  display: grid;
}

.profile-form {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

#updated-at {
  color: var(--muted);
  font-size: 13px;
}

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

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

.list-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  padding: 10px 11px;
}

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

input:focus,
textarea:focus {
  outline: 2px solid rgba(18, 108, 89, 0.2);
  border-color: var(--accent);
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

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

button.secondary {
  background: #fff;
  color: var(--accent-strong);
}

button.secondary:hover {
  background: #edf5f2;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-strip,
  .field-grid,
  .list-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }
}
