:root {
  color-scheme: light;
  --ink: #17283c;
  --muted: #4a5c72;
  --line: #d5dfe9;
  --blue: #1c5396;
  --blue-hover: #143e71;
  font: 100%/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eff4f9;
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }

.shell {
  width: min(100% - 2rem, 34rem);
  margin: clamp(1.4rem, 6vh, 4.5rem) auto 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}

.brand-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: none;
  place-items: center;
  border-radius: 0.75rem;
  background: #183757;
  color: white;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-name { font-weight: 760; line-height: 1.3; }
.brand-caption, .footer { color: var(--muted); font-size: 0.875rem; }

.panel {
  padding: clamp(1rem, 4vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  box-shadow: 0 15px 40px #18375712;
}

.panel-header { margin: 0 0 1.2rem; }
.panel-header p { margin: 0.35rem 0 0; color: var(--muted); }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.55rem, 5vw, 2.1rem); }
h2 { font-size: 1.05rem; }

.badge {
  display: inline-block;
  margin: 0 0 0.65rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  background: #eaf2fb;
  color: #254f7e;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.badge.test { background: #fff1ce; color: #694800; }

#invite-panel p, #setup-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.field-item { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { margin-bottom: 0.24rem; font-size: 0.875rem; font-weight: 650; }

.card-field {
  height: 2.65rem;
  width: 100%;
  padding: 0 0.6rem;
  border: 1px solid #b9c6d4;
  border-radius: 0.45rem;
  background: #fff;
}

.card-field > *, .card-field iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

.card-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px #1c539640; }

.card-actions {
  display: grid;
  justify-items: start;
  gap: 0.85rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.consent {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.consent input { width: 1rem; height: 1rem; flex: none; margin: 0; accent-color: var(--blue); }

button {
  min-height: 2.65rem;
  padding: 0.52rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-hover); }
.secondary { border-color: #b9c6d4; background: #fff; color: var(--blue-hover); }
.secondary:hover:not(:disabled) { background: #eff4f9; }
button:disabled { background: #e5ecf3; color: #425a75; cursor: default; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.status {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-error { color: #8b301b; }
.status:empty { margin: 0; }

.saved {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #bfdccf;
  border-radius: 0.65rem;
  background: #f2faf6;
}

.saved-icon {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #dbeee3;
  color: #215b3d;
  font-weight: 800;
}

.saved p { margin: 0.3rem 0 0; color: var(--muted); }
.saved p:empty { display: none; }
.footer { margin: 1.2rem 0 0; text-align: center; }
.footer a { color: var(--blue-hover); }

@media (min-width: 42rem) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 0.85rem;
  }
  .field-wide { grid-column: auto; }
}

@media (max-width: 25rem) {
  .primary, .secondary { width: 100%; }
}
