:root {
  --bg: #f4efe7;
  --panel: #fffdf8;
  --line: #d8cfc2;
  --text: #1d2421;
  --muted: #5d655f;
  --brand: #0f5b50;
  --danger: #ab3d2f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(183, 128, 47, 0.14), transparent 30%),
    linear-gradient(180deg, #fbf8f2, var(--bg));
}
a { color: var(--brand); text-decoration: none; }
button, .button-link {
  border: 0; border-radius: 999px; background: var(--brand); color: #fff;
  padding: .8rem 1.2rem; font: inherit; cursor: pointer; display: inline-flex; justify-content: center;
}
.ghost-button { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.topbar, .page, .auth-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.topbar { display:flex; justify-content:space-between; gap:1rem; padding:1.2rem 0; align-items:start; }
.brand { font-size:1.6rem; font-weight:700; color:var(--text); }
.eyebrow { margin:.2rem 0 0; color:var(--muted); font-size:.92rem; text-transform:uppercase; letter-spacing:.08em; }
.topnav { display:flex; gap:.8rem; align-items:center; flex-wrap:wrap; justify-content:end; }
.page { padding-bottom:3rem; }
.hero,.section-header { display:flex; justify-content:space-between; gap:1rem; align-items:end; margin-bottom:1.2rem; }
.hero h1,.section-header h1 { margin:.2rem 0; font-size:clamp(1.8rem,3vw,3rem); }
.hero-actions { display:flex; gap:.8rem; flex-wrap:wrap; }
.stats-grid,.two-col,.form-grid,.detail-grid,.toolbar { display:grid; gap:1rem; }
.stats-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); margin-bottom:1rem; }
.two-col { grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); }
.card { background:var(--panel); border:1px solid var(--line); border-radius:24px; padding:1.2rem; box-shadow:0 12px 30px rgba(47,42,34,.06); }
.stat-card span { display:block; color:var(--muted); }
.stat-card strong { display:block; margin-top:.5rem; font-size:2.2rem; }
.list { display:flex; flex-direction:column; gap:.8rem; }
.list-row { display:flex; justify-content:space-between; gap:1rem; padding-bottom:.8rem; border-bottom:1px solid #ece4d8; }
.align-start { align-items:start; }
.badge,.pill { border-radius:999px; padding:.35rem .7rem; font-size:.88rem; background:#e8e2d6; }
.flash { width:min(1180px, calc(100% - 2rem)); margin:0 auto 1rem; border-radius:18px; padding:.95rem 1rem; }
.flash-success { background:#ddeedd; color:#256a39; }
.flash-error { background:#f6d8d5; color:var(--danger); }
.auth-shell { min-height:100vh; display:grid; place-items:center; }
.auth-card { width:min(460px,100%); padding:2rem; background:rgba(255,253,248,.95); border:1px solid var(--line); border-radius:28px; box-shadow:0 22px 60px rgba(47,42,34,.08); }
.installer-card { width:min(1100px,100%); display:grid; grid-template-columns:1.1fr .9fr; gap:1.5rem; align-items:stretch; }
.installer-copy { padding:2.5rem; border-radius:28px; background:linear-gradient(180deg, rgba(15,91,80,.94), rgba(8,57,49,.97)); color:#fff; box-shadow:0 22px 60px rgba(19,42,37,.18); }
.installer-copy .eyebrow { color:rgba(255,255,255,.72); }
.installer-copy h1 { font-size:clamp(2rem,4vw,3.5rem); margin:.3rem 0 1rem; }
.installer-checklist { margin:1.5rem 0 0; padding-left:1.2rem; line-height:1.8; }
.installer-form { width:100%; }
.stack { display:flex; flex-direction:column; gap:1rem; }
.form-grid { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.detail-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.toolbar { grid-template-columns:2fr 1fr auto; }
label, .detail-grid span { display:flex; flex-direction:column; gap:.4rem; color:var(--muted); }
.detail-grid strong { color:var(--text); }
input,select,textarea { width:100%; padding:.8rem .9rem; border-radius:14px; border:1px solid var(--line); background:#fff; font:inherit; color:var(--text); }
textarea { min-height:120px; resize:vertical; }
.full-span { grid-column:1 / -1; }
.divider { height:1px; background:var(--line); }
table { width:100%; border-collapse:collapse; }
th,td { padding:.8rem .6rem; border-bottom:1px solid #ece4d8; text-align:left; vertical-align:top; }
.actions { display:flex; gap:.8rem; align-items:center; flex-wrap:wrap; }
.link-button { background:none; padding:0; color:var(--brand); }
.danger-text { color:var(--danger); }
.inline-checkbox { flex-direction:row; align-items:center; }
.letter-preview pre { white-space:pre-wrap; font-family:Georgia,serif; line-height:1.6; background:#faf4eb; padding:1rem; border-radius:16px; }
.template-block { border:1px solid #ece4d8; border-radius:16px; padding:1rem; background:#fff; }
.top-gap { margin-top:1rem; }
@media (max-width: 720px) {
  .topbar,.hero,.section-header { flex-direction:column; align-items:stretch; }
  .toolbar,.installer-card { grid-template-columns:1fr; }
}
