:root {
  --bg: #f4f1ea;
  --panel: rgba(255, 255, 255, 0.88);
  --text: #1f2933;
  --muted: #5b6875;
  --accent: #2d6a4f;
  --border: rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(45, 106, 79, 0.18), transparent 28%),
    linear-gradient(160deg, #f7f4ee 0%, #ece6d8 100%);
}

.shell {
  width: min(880px, calc(100% - 32px));
  margin: 48px auto;
}

.panel {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(31, 41, 51, 0.12);
}

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

h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.lead {
  margin: 0 0 24px;
  line-height: 1.7;
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 0;
}

.single-column {
  grid-template-columns: minmax(180px, 320px);
  margin-bottom: 24px;
}

.meta div {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 41, 51, 0.06);
}

.meta dt {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.meta dd {
  margin: 0;
  font-size: 1.05rem;
}

a {
  color: var(--accent);
}

.auth-panel {
  max-width: 520px;
  margin-inline: auto;
}

.auth-form,
.logout-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(31, 41, 51, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

button {
  width: fit-content;
  min-width: 120px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font: inherit;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(157, 37, 37, 0.08);
  border: 1px solid rgba(157, 37, 37, 0.14);
  color: #8b2a2a;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(45, 106, 79, 0.14);
  color: var(--accent);
}

.config-block + .config-block {
  margin-top: 28px;
}

.config-block h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.config-form {
  display: grid;
  gap: 20px;
}

.config-section {
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  border-radius: 16px;
  display: grid;
  gap: 14px;
}

.config-section legend {
  padding: 0 8px;
  color: var(--accent);
}

.config-form label small {
  color: var(--muted);
}

.integration-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid rgba(31, 41, 51, 0.08);
}

.integration-action-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text);
}

.integration-action-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 120px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.button-link:hover {
  filter: brightness(1.04);
}

.button-link.disabled {
  background: rgba(91, 104, 117, 0.28);
  color: rgba(31, 41, 51, 0.72);
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 640px) {
  .shell {
    margin: 24px auto;
  }

  .panel {
    padding: 24px;
  }

  .integration-action-row {
    align-items: stretch;
    flex-direction: column;
  }
}
