:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1d2b2a;
  --muted: #5a6b6a;
  --green-900: #2f5b4f;
  --green-800: #356658;
  --green-100: #e7efea;
  --warn: #9f1239;
  --warn-bg: rgba(159, 18, 57, 0.06);
  --success-bg: rgba(47, 91, 79, 0.08);
  --line: rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  --radius-lg: 3px;
  --radius-md: 3px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(47, 91, 79, 0.14), transparent 44%),
    radial-gradient(circle at 90% 15%, rgba(47, 91, 79, 0.10), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.container {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 0 12px;
  background: rgba(246, 243, 238, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.app-header .container {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 3px;
  background: var(--green-900);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-title {
  font-weight: 800;
  letter-spacing: -0.2px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 20px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.top-nav {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
  display: inline-flex;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}

.nav-btn {
  border: 0;
  background: transparent;
  width: 44px;
  height: 34px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  color: var(--green-900);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.06s ease;
}

.nav-btn:hover { background: rgba(47, 91, 79, 0.08); }
.nav-btn:active { transform: translateY(1px); }

.nav-btn svg {
  width: 18px;
  height: 18px;
}

.page {
  padding: 18px 0 44px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

h1 {
  margin: 12px 0 6px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 34px;
  letter-spacing: -0.4px;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}

.stack {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.card--soft {
  background: #ffffff;
}

.card--warn,
.card--attention {
  background: linear-gradient(180deg, var(--warn-bg), rgba(255, 255, 255, 0.92));
  border-color: rgba(159, 18, 57, 0.12);
}

.card--success {
  background: #ffffff;
  border-color: rgba(47, 91, 79, 0.12);
}

.card-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}

.card h2 {
  margin: 0 0 8px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 24px;
  line-height: 1.08;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.invite-note {
  margin-top: 10px !important;
  padding: 10px 12px;
  border-radius: 3px;
  background: rgba(47, 91, 79, 0.06);
  border: 1px solid rgba(47, 91, 79, 0.12);
  font-size: 13px !important;
  color: var(--green-900) !important;
  line-height: 1.5;
}

.invite-form {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

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

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.field input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.95);
}

.field input:focus-visible {
  outline: 2px solid rgba(47, 91, 79, 0.22);
  outline-offset: 2px;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 2px;
  padding: 11px 14px;
  font-weight: 750;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.06s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
  user-select: none;
  min-height: 44px;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--green-900);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.9);
}

.btn-danger {
  color: var(--warn);
  border-color: rgba(159, 18, 57, 0.16);
}

.btn-danger:hover {
  background: rgba(159, 18, 57, 0.06);
}

.inline-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 3px;
  background: rgba(47, 91, 79, 0.08);
  color: var(--green-900);
  font-size: 13px;
  font-weight: 700;
}

.status-message.is-error {
  background: rgba(180, 35, 24, 0.08);
  color: #b42318;
}

@media (max-width: 700px) {
  .container {
    width: min(100%, calc(100% - 24px));
  }

  h1 {
    font-size: 28px;
  }

  .inline-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ── Invite consent gates ────────────────────────────────────────────────────
   Shown to the sender before an invitation is sent and to the recipient before
   it is accepted. Terms of Service cl. 4.6–4.7; Privacy Policy cl. 7.4–7.5.
   ─────────────────────────────────────────────────────────────────────────── */
.consent-block {
  margin: 4px 0 2px;
  padding: 14px 16px 12px;
  border: 1px solid rgba(27, 66, 57, 0.22);
  border-radius: 3px;
  background: rgba(47, 91, 79, 0.045);
}

.consent-legend {
  padding: 0 6px;
  margin-left: -6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--green-900, #1B4239);
}

.consent-intro {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted, #5C6D69);
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text, #14211F);
  cursor: pointer;
}

.consent-check:last-of-type { margin-bottom: 0; }

.consent-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--green-900, #1B4239);
  cursor: pointer;
  flex-shrink: 0;
}

.consent-check input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--green-700, #35705F);
  outline-offset: 2px;
}

.consent-foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted, #5C6D69);
}

.consent-block a {
  color: var(--green-800, #27564A);
  font-weight: 700;
}

/* Make it obvious why the action button is unavailable */
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
