@property --brand-primary {
  syntax: '<color>';
  inherits: true;
  initial-value: #0D6E66;
}
@property --brand-accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #B84A1B;
}

:root {
  /* Socly design system — tokens follow association palette */
  --brand-primary: #0D6E66;
  --brand-accent: #B84A1B;
  --brand-socly: #0B4875;
  --brand-primary-deep: color-mix(in srgb, var(--brand-primary) 72%, black);
  --brand-primary-ink: #0D6E66;
  --brand-accent-ink: #B84A1B;
  --brand-accent-muted: #9A4A28;
  --brand-accent-on-dark: #B84A1B;
  --brand-on-primary: #FFFFFF;
  --brand-on-primary-deep: #FFFFFF;
  --brand-on-accent: #FFFFFF;
  --brand-ink: color-mix(in srgb, var(--brand-primary) 48%, #050a09);
  --brand-paper: color-mix(in srgb, var(--brand-primary) 6%, #ffffff);
  --brand-mist: color-mix(in srgb, var(--brand-primary) 16%, #ffffff);
  --ink: var(--brand-ink);
  --muted: color-mix(in srgb, var(--brand-primary) 22%, #667774);
  --surface: color-mix(in srgb, var(--brand-primary) 10%, #eef2f1);
  --card: #ffffff;
  /* Mix against a solid grey so light brand palettes still show field borders */
  --line: color-mix(in srgb, var(--brand-primary-ink) 22%, #c5cdca);
  --danger: #A61B1B;
  --ok: #0F6B4C;
  --shadow: 0 24px 60px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  --shadow-soft: 0 10px 28px color-mix(in srgb, var(--brand-primary) 12%, transparent);
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --heading-1-size: clamp(1.85rem, 2.6vw, 2.45rem);
  --heading-2-size: clamp(1.25rem, 2.2vw, 1.55rem);
  --heading-3-size: 1.15rem;
  --heading-4-size: 1rem;
  --heading-5-size: 0.92rem;
  --heading-6-size: 0.78rem;
  accent-color: var(--brand-primary);
}

* { box-sizing: border-box; }

/* —— Standard headings (use h1–h6 or .h1–.h6 everywhere) —— */
h1, .h1,
.page-title {
  font-family: var(--font-display);
  font-size: var(--heading-1-size);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}
h2, .h2,
.section-title {
  font-family: var(--font-display);
  font-size: var(--heading-2-size);
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}
h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--heading-3-size);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 0.3rem;
  color: var(--brand-primary-deep);
}
h4, .h4 {
  font-family: var(--font-body);
  font-size: var(--heading-4-size);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
  color: var(--ink);
}
h5, .h5 {
  font-family: var(--font-body);
  font-size: var(--heading-5-size);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  margin: 0 0 0.2rem;
  color: var(--muted);
}
h6, .h6 {
  font-family: var(--font-body);
  font-size: var(--heading-6-size);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.2rem;
  color: var(--muted);
}
.h1-brand,
.setup-title {
  color: var(--brand-primary-ink);
}
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  transition: --brand-primary 0.9s ease, --brand-accent 0.9s ease;
}
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -8%, color-mix(in srgb, var(--brand-primary) 22%, white), transparent 62%),
    radial-gradient(900px 480px at 100% 0%, color-mix(in srgb, var(--brand-accent) 14%, white), transparent 55%),
    linear-gradient(180deg, var(--brand-paper) 0%, var(--surface) 48%, color-mix(in srgb, var(--brand-primary) 12%, var(--surface)) 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

a { color: var(--brand-primary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; color: var(--brand-primary-deep); }

/* —— App shell (aligned with auth) —— */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  padding: 1.05rem 1rem 0.9rem;
  background:
    radial-gradient(520px 340px at 12% -8%, color-mix(in srgb, var(--brand-accent) 36%, transparent), transparent 68%),
    radial-gradient(420px 280px at 100% 30%, color-mix(in srgb, var(--brand-primary) 22%, transparent), transparent 70%),
    linear-gradient(165deg, var(--brand-primary) 0%, var(--brand-primary-deep) 48%, color-mix(in srgb, var(--brand-primary-deep) 72%, #000) 100%);
  color: var(--brand-paper);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.sidebar-brand {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--brand-paper) 14%, transparent);
  position: relative;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
}
.sidebar-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.sidebar-close {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-paper) 12%, transparent);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 1;
}
.sidebar-backdrop {
  display: none;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 2.75rem;
  padding: 0.35rem clamp(1.25rem, 3vw, 2.25rem);
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.topbar-menu { display: none; }
.topbar-brand { display: none; }
.topbar-spacer { flex: 1; min-width: 0; pointer-events: none; }
@media (min-width: 961px) {
  .topbar {
    display: none;
  }
  .main {
    padding-top: 1.15rem;
  }
}
.btn-logout {
  color: #fff !important;
  border-color: rgba(255,255,255,0.28) !important;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
}
.sidebar-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  object-fit: contain;
  padding: 6px;
  flex-shrink: 0;
}
.sidebar-mark,
.topbar-mark,
.footer-mark,
.auth-mark,
.setup-mark,
.install-mark,
.tessera-mark,
.socly-mark {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.sidebar-mark {
  height: 1.85rem;
  max-width: min(100%, 170px);
  margin: 0 auto;
  object-position: center;
}
.sidebar-for {
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  color: color-mix(in srgb, var(--brand-paper) 70%, var(--brand-accent));
  font-size: 0.74rem;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}
.sidebar-for .per {
  flex-shrink: 0;
  font-weight: 500;
  opacity: 0.85;
}
.assoc-lockup-sidebar {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: baseline;
  justify-content: center;
  gap: 0.28em;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.assoc-lockup-sidebar .assoc-name {
  display: block !important;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand-accent-on-dark);
  font-weight: 700;
}
.assoc-lockup-sidebar .assoc-legal {
  display: inline !important;
  flex: 0 0 auto;
  font-size: 0.78em;
  font-weight: 600;
  opacity: 0.75;
  line-height: 1;
  white-space: nowrap;
}
.sidebar-assoc-logo,
.assoc-logo.sidebar-assoc-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 9rem);
  max-height: 3.75rem;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  background: #fff;
  padding: 0.25rem;
  box-shadow: 0 4px 12px color-mix(in srgb, #000 22%, transparent);
  flex-shrink: 0;
}
.sidebar-lockup { min-width: 0; flex: 1; }
.nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand-paper) 35%, transparent) transparent;
}
.nav .nav-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--brand-paper) 45%, transparent);
  margin: 0.4rem 0.85rem 0.55rem;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: color-mix(in srgb, var(--brand-paper) 92%, var(--brand-accent));
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  margin-bottom: 0.3rem;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav a:hover, .nav a.active {
  background: color-mix(in srgb, var(--brand-paper) 14%, transparent);
  transform: translateX(3px);
  text-decoration: none;
  color: #fff;
}
.nav a.active {
  box-shadow: inset 3px 0 0 var(--brand-accent);
}
.sidebar-deadlines {
  flex: 0 0 auto;
  margin: 0.55rem 0 0.85rem;
  padding: 0.7rem 0.75rem 0.65rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-paper) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-paper) 14%, transparent);
  overflow: hidden;
  min-height: 0;
}
.sidebar-deadlines.is-expanded {
  overflow: visible;
}
.sidebar-deadlines.is-expanded .sidebar-deadlines-list {
  min-height: 0;
  max-height: 14rem;
  overflow-y: auto;
}
.sidebar-deadlines-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.sidebar-deadlines-title {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: color-mix(in srgb, var(--brand-paper) 72%, transparent);
}
.sidebar-deadlines-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--brand-paper) 82%, var(--brand-accent));
  text-decoration: none;
  white-space: nowrap;
}
.sidebar-deadlines-link:hover {
  color: #fff;
  text-decoration: underline;
}
.sidebar-deadlines-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  min-height: 3.35rem;
}
.sidebar-deadline-item {
  margin: 0;
  opacity: 1;
  transition: opacity 0.22s ease;
}
.sidebar-deadline-item.is-fading { opacity: 0; }
.sidebar-deadline-item[hidden] {
  display: none !important;
}
.sidebar-deadline-link {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.38rem 0.2rem;
  border-radius: 10px;
  text-decoration: none;
  color: color-mix(in srgb, var(--brand-paper) 94%, transparent);
}
.sidebar-deadline-link:hover {
  background: color-mix(in srgb, var(--brand-paper) 10%, transparent);
  text-decoration: none;
  color: #fff;
}
.sidebar-deadline-title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-deadline-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--brand-paper) 68%, transparent);
}
.sidebar-deadline-badge {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sidebar-deadline-item.is-overdue .sidebar-deadline-badge { color: #ffb4a8; }
.sidebar-deadline-item.is-soon .sidebar-deadline-badge { color: #ffd27a; }
.sidebar-deadline-item.is-valid .sidebar-deadline-badge { color: #9be7bf; }
.sidebar-deadlines-more {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--brand-paper) 82%, var(--brand-accent));
  text-decoration: none;
}
.sidebar-deadlines-more:hover {
  color: #fff;
  text-decoration: underline;
}
.sidebar-deadlines-more[hidden] {
  display: none !important;
}
.sidebar-footer {
  margin-top: 0;
  flex: 0 0 auto;
  padding: 0.7rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.sidebar-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sidebar-icon-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
  text-decoration: none;
}
.sidebar-logout-form {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.sidebar-logout-form .btn {
  width: 100%;
}
.sidebar-settings-icon,
.sidebar-back-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  background: currentColor;
  opacity: 0.92;
}
.sidebar-settings-icon {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 13a7.8 7.8 0 0 0 .1-2l2-1.2-2-3.4-2.3.6a7.7 7.7 0 0 0-1.7-1L15 3.5h-4l-.5 2.5a7.7 7.7 0 0 0-1.7 1L6.5 6.4l-2 3.4 2 1.2a7.8 7.8 0 0 0 0 2l-2 1.2 2 3.4 2.3-.6a7.7 7.7 0 0 0 1.7 1l.5 2.5h4l.5-2.5a7.7 7.7 0 0 0 1.7-1l2.3.6 2-3.4-2-1.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 13a7.8 7.8 0 0 0 .1-2l2-1.2-2-3.4-2.3.6a7.7 7.7 0 0 0-1.7-1L15 3.5h-4l-.5 2.5a7.7 7.7 0 0 0-1.7 1L6.5 6.4l-2 3.4 2 1.2a7.8 7.8 0 0 0 0 2l-2 1.2 2 3.4 2.3-.6a7.7 7.7 0 0 0 1.7 1l.5 2.5h4l.5-2.5a7.7 7.7 0 0 0 1.7-1l2.3.6 2-3.4-2-1.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sidebar-back-icon {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3Cpath d='M9 12h12'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3Cpath d='M9 12h12'/%3E%3C/svg%3E") center / contain no-repeat;
}
a.sidebar-brand-home {
  color: inherit;
  text-decoration: none;
}
a.sidebar-brand-home:hover {
  text-decoration: none;
  opacity: 0.92;
}
.sidebar-update {
  margin-bottom: 0.75rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 35%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--brand-accent) 12%, rgba(255, 255, 255, 0.06));
}
.sidebar-update[hidden] {
  display: none !important;
}
.sidebar-update-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  list-style: none;
}
.sidebar-update-summary::-webkit-details-marker {
  display: none;
}
.sidebar-update-pill {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}
.sidebar-update-dismiss {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.sidebar-update-dismiss:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
}
.sidebar-update-body {
  padding: 0 0.65rem 0.65rem;
}
.sidebar-update-copy,
.sidebar-update-hint {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0.88;
  color: #fff;
}
.sidebar-update-hint {
  opacity: 0.72;
}
.sidebar-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.sidebar-update-actions form {
  margin: 0;
}
.alert-dismissible {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  justify-content: space-between;
}
.alert-dismissible .alert-body {
  flex: 1;
  min-width: 0;
}
.alert-dismiss {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.15rem -0.15rem 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
}
.alert-dismiss:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}
.alert-dismissible.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  position: relative;
}
.main {
  padding: 1.35rem clamp(1.25rem, 3vw, 2.25rem) 2.5rem;
  flex: 1;
}
.app-footer {
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(8px);
  padding: 0.85rem clamp(1.25rem, 3vw, 2.25rem);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.app-footer-actions,
.auth-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  justify-content: flex-end;
}
.report-problem-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.report-problem-btn:hover,
.report-problem-btn:focus-visible {
  color: var(--ink);
}
.report-problem-icon {
  flex: 0 0 auto;
  opacity: 0.85;
}
.report-problem-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink);
}
.report-problem-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.report-problem-field textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.report-problem-status {
  margin: 0;
  min-height: 1.2em;
}
.report-problem-status.is-error {
  color: #a11;
}
.app-footer-brand,
.auth-footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}
.topbar-mark {
  height: 2.1rem;
  max-width: 210px;
}
.footer-mark {
  display: inline-block;
  height: 1.35rem;
  max-width: 150px;
  vertical-align: middle;
}
.tessera-mark {
  height: 1.45rem;
  max-width: 170px;
}
.app-footer .socly,
.auth-footer .socly,
.brand-socly,
.socly,
.topbar-product.socly {
  color: var(--brand-socly);
  font-weight: 700;
}
.app-footer strong { color: var(--ink); }
.footer-operator {
  font-size: 0.78rem;
  opacity: 0.85;
  overflow-wrap: anywhere;
}

/* —— Page chrome —— */
.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header .titles { min-width: 0; flex: 1; }
.page-title-brand {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  line-height: 1.1;
  min-width: 0;
}
.page-title-brand .assoc-lockup {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-title-brand .title-lead {
  color: var(--brand-primary-deep);
}
.page-title-brand .title-lead-mobile {
  display: none;
}
.page-title-brand .title-assoc {
  color: var(--brand-accent-ink);
}
.assoc-lockup {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: baseline;
  gap: 0.28em;
  vertical-align: baseline;
  white-space: nowrap;
  line-height: 1.15;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.assoc-lockup .assoc-name {
  display: inline-block !important;
  color: inherit;
  font-weight: inherit;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.assoc-lockup .assoc-legal {
  display: inline !important;
  flex: 0 0 auto;
  font-size: 0.78em;
  font-weight: 600;
  opacity: 0.65;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0 !important;
  padding: 0;
  vertical-align: baseline !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
  white-space: nowrap;
}
.assoc-lockup-inline {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: baseline;
  white-space: nowrap;
}
.assoc-lockup-topbar {
  margin-top: 0.1rem;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.assoc-lockup-topbar .assoc-name {
  color: var(--brand-accent-ink);
  font-weight: 700;
  font-size: 0.92rem;
  max-width: 100%;
}
.assoc-lockup-title {
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.assoc-lockup-title .assoc-name {
  color: var(--brand-accent-ink);
  font-family: var(--font-display);
  font-size: inherit;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 100%;
}
.assoc-lockup-auth .assoc-name {
  color: var(--brand-accent-on-dark);
  font-weight: 700;
}
.assoc-lockup-auth .assoc-legal {
  color: color-mix(in srgb, var(--brand-paper) 78%, var(--brand-accent-on-dark));
  opacity: 1;
}
.assoc-lockup-footer {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: baseline;
  vertical-align: baseline;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.assoc-lockup-footer .assoc-name {
  font-weight: 600;
  max-width: 100%;
}
.assoc-lockup-footer .assoc-legal {
  display: inline !important;
  font-size: 0.78em;
  font-weight: 600;
  opacity: 0.65;
  margin: 0 !important;
  vertical-align: baseline !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
}
.assoc-lockup-tessera .assoc-name {
  font-weight: 700;
}
.sidebar-lockup .assoc-lockup .assoc-name {
  color: var(--brand-accent-on-dark);
  font-weight: 700;
}

/* —— Configuration accordions —— */
.config-accordions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.config-accordion {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--brand-paper) 78%, white);
  box-shadow: var(--shadow-soft);
  overflow: clip;
}
.config-accordion-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.15rem;
  position: relative;
  padding-right: 2.75rem;
}
.config-accordion-summary::-webkit-details-marker { display: none; }
.config-accordion-summary::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--brand-primary-deep);
  border-bottom: 2px solid var(--brand-primary-deep);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.2s ease;
}
.config-accordion[open] > .config-accordion-summary::after {
  transform: translateY(-35%) rotate(225deg);
}
.config-accordion-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--brand-primary-deep);
  font-weight: 700;
}
.config-accordion-lede {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
.config-accordion-body {
  padding: 0 1.15rem 1.2rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

/* —— Configuration: macro-area navigation (2-column layout) —— */
.config-layout {
  display: grid;
  grid-template-columns: minmax(13rem, 18rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.config-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: sticky;
  top: 1rem;
}
.config-nav-item {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.config-nav-item:hover {
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 18%, var(--line));
}
.config-nav-item:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.config-nav-item[aria-selected="true"] {
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 34%, var(--line));
  box-shadow: var(--shadow-soft);
}
.config-nav-icon {
  flex: 0 0 auto;
  display: inline-flex;
  width: 1.9rem;
  height: 1.9rem;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary-deep);
}
.config-nav-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.config-nav-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--brand-primary-deep);
}
.config-nav-lede {
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--muted);
}
/* Treasury accounts first inside “Cash, access & privacy”. */
.config-accordions > #treasury-accounts { order: 1; }
.config-accordions > #users { order: 2; }
.config-accordions > #legal { order: 3; }
.config-accordions > #people { order: 4; }
@media (max-width: 900px) {
  .config-layout {
    grid-template-columns: 1fr;
  }
  .config-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .config-nav-item {
    flex: 1 1 12rem;
  }
  .config-nav-lede {
    display: none;
  }
}
.setup-name-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7.5rem, 10.5rem);
  grid-auto-flow: row dense;
  gap: 0.85rem;
  align-items: start;
}
.setup-name-pair .setup-runts-block,
.setup-name-pair .setup-field-currency,
.setup-name-pair .setup-full-name-preview {
  grid-column: 1 / -1;
}
.setup-name-pair .setup-runts-block {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  max-width: none;
  padding: 0.85rem 0.95rem 0.9rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 14%, #fff) 0%, color-mix(in srgb, var(--brand-accent) 6%, #fff) 100%);
  border: 2px solid color-mix(in srgb, var(--brand-primary) 62%, var(--line));
  border-radius: 16px;
  box-shadow:
    inset 5px 0 0 var(--brand-primary),
    0 10px 24px color-mix(in srgb, var(--brand-primary) 14%, transparent);
}
.setup-runts-callout {
  display: none;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
}
.setup-runts-block.is-found .setup-runts-callout {
  display: flex;
}
.setup-runts-callout-icon {
  flex: 0 0 auto;
  font-size: 1.25rem;
  line-height: 1.25;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}
.setup-runts-callout-icon-ok {
  display: none;
  color: var(--brand-primary);
  font-weight: 800;
}
.setup-runts-callout-ok {
  display: none;
}
.setup-runts-block.is-found .setup-runts-callout-icon-ok {
  display: inline;
}
.setup-runts-block.is-found .setup-runts-callout-ok {
  display: block;
}
.setup-runts-callout-text {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brand-primary-deep);
}
.setup-name-pair .setup-runts-block .setup-field-runts {
  margin: 0;
  gap: 0.3rem;
}
.setup-name-pair .setup-field-name-de {
  grid-column: 1 / -1;
}
/* The German denomination is rendered hidden unless the seat is in South Tyrol. */
.setup-name-pair .setup-field-name-de[hidden] {
  display: none !important;
}
/* RUNTS-first step: manual name/legal/currency fields stay behind a link. */
.setup-name-pair .setup-manual-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7.5rem, 10.5rem);
  gap: 0.85rem;
  align-items: start;
}
.setup-name-pair .setup-manual-fields[hidden] {
  display: none !important;
}
.setup-runts-manual-link {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 0.15rem 0 0;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  color: var(--brand-primary-deep);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}
.setup-runts-manual-link:hover {
  color: var(--brand-primary);
}
.setup-runts-manual-link[hidden] {
  display: none !important;
}
.setup-bilingual-hint,
.setup-field-name-de .setup-field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}
.setup-runts-row {
  display: block;
  width: 100%;
  max-width: none;
}
.setup-runts-hint {
  margin: 0.15rem 0 0;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--brand-primary-deep);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.setup-runts-attempts {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.setup-runts-block.is-exhausted {
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--muted) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  box-shadow: none;
}
.setup-runts-unavailable {
  margin: 0;
}
.setup-runts-unavailable-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
}
.setup-runts-block.is-exhausted .setup-runts-panel {
  display: none !important;
}
.setup-runts-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  margin-top: 0.25rem;
  max-width: none;
  width: 100%;
}
.setup-runts-actions .setup-scrape-btn {
  white-space: normal;
  font-size: 0.88rem;
  padding: 0.65rem 0.9rem;
  width: 100%;
  max-width: none;
  justify-content: center;
}
/* Smooth “breathing” pulse: nudges the user to press the fetch button.
   Uses an opacity-animated ring so it also works under prefers-reduced-motion
   and does not depend on color-mix() support in keyframes. */
.setup-scrape-btn.is-attention,
.setup-scrape-retry.is-attention {
  position: relative;
  animation: setup-cta-attention 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform, filter;
}
.setup-scrape-btn.is-attention::after,
.setup-scrape-retry.is-attention::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 4px var(--brand-primary);
  opacity: 0;
  pointer-events: none;
  animation: setup-cta-ring 2.2s ease-in-out infinite;
}
@keyframes setup-cta-attention {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-1px) scale(1.03);
    filter: brightness(1.32);
  }
}
@keyframes setup-cta-ring {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.72; }
}
@media (prefers-reduced-motion: reduce) {
  /* !important is required because the global reduced-motion reset sets
     animation-duration/iteration-count with !important. */
  .setup-scrape-btn.is-attention,
  .setup-scrape-retry.is-attention {
    animation: setup-cta-soft 2.2s ease-in-out infinite !important;
  }
  /* Keep the visual hint without movement: brightness + ring still “breathe”. */
  .setup-scrape-btn.is-attention::after,
  .setup-scrape-retry.is-attention::after {
    animation: setup-cta-ring 2.2s ease-in-out infinite !important;
  }
}
@keyframes setup-cta-soft {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.32); }
}
.setup-name-pair .setup-runts-lock-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary-deep);
}
.setup-name-pair .sf-field.is-runts-locked .sf-field__control {
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  cursor: not-allowed;
  pointer-events: none;
}
.setup-name-pair .sf-field.is-runts-locked .sf-field__label {
  color: var(--brand-primary-deep);
}
.setup-name-pair .sf-field.is-runts-locked .sf-field__control:disabled {
  opacity: 0.9;
}
.geo-foreign-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  width: 100%;
  grid-column: 1 / -1;
}
.geo-foreign-hint {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.82rem;
}
.geo-birth-place,
.geo-address {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
}
.geo-birth-place > .geo-foreign-bar,
.geo-address > .geo-foreign-bar {
  margin-bottom: 0.15rem;
  grid-column: 1 / -1;
}
.member-form .geo-birth-place,
.member-form .geo-birth-host,
.member-form .geo-address-host {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
[data-geo-scope].is-geo-foreign [data-postal-code],
[data-geo-scope].is-geo-foreign [data-province-input],
.geo-address.is-geo-foreign [data-postal-code],
.geo-address.is-geo-foreign [data-province-input] {
  opacity: 0.85;
}
[data-geo-scope].is-geo-foreign [data-city-suggest],
[data-geo-scope].is-geo-foreign [data-province-suggest],
[data-geo-scope].is-geo-foreign [data-address-suggest],
[data-geo-scope].is-geo-foreign [data-birth-place-suggest],
.geo-address.is-geo-foreign [data-city-suggest],
.geo-address.is-geo-foreign [data-province-suggest],
.geo-address.is-geo-foreign [data-address-suggest] {
  display: none !important;
}
.setup-legal-meaning {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: right;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--muted);
}
/* The legal-form meaning belongs under “Denominazione sociale”, not in the
   legal-name column: keep it in column 1, row 2 so it never pushes the select. */
.setup-name-pair .setup-legal-meaning {
  grid-column: 1;
  grid-row: 2;
  margin: -0.55rem 0 0;
  text-align: left;
}
@media (max-width: 700px) {
  .setup-name-pair .setup-legal-meaning {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 0;
  }
}
.setup-runts-block.is-found .setup-runts-progress,
.setup-runts-block.is-found .setup-runts-elapsed,
.setup-runts-block.is-found .setup-scrape-spinner,
.setup-runts-block.is-found .setup-runts-hint,
.setup-runts-block.is-found .setup-runts-actions {
  display: none !important;
}
.setup-runts-block.is-found .setup-runts-status {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 400;
}
.setup-runts-block.is-found .setup-runts-status strong {
  font-weight: 700;
}
.setup-runts-result {
  display: grid;
  gap: 0.45rem;
  /* Scroll only via the setup form — avoid nested scrollbars. */
  max-height: none;
  overflow: visible;
}
.setup-runts-followup {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.setup-runts-acc {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #fff 88%, var(--brand-paper));
  overflow: hidden;
}
.setup-runts-acc-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand-primary-deep);
  user-select: none;
}
.setup-runts-acc-summary::-webkit-details-marker {
  display: none;
}
.setup-runts-acc-mark::before {
  content: "▶";
  display: inline-block;
  font-size: 0.7rem;
  color: color-mix(in srgb, var(--brand-primary) 70%, var(--muted));
}
.setup-runts-acc[open][data-runts-acc="fields"] > .setup-runts-acc-summary .setup-runts-acc-mark::before {
  content: "✓";
  font-size: 0.78rem;
  color: var(--brand-primary);
}
.setup-runts-acc[open]:not([data-runts-acc="fields"]) > .setup-runts-acc-summary .setup-runts-acc-mark::before {
  content: "▼";
  font-size: 0.65rem;
}
.setup-runts-acc-body {
  padding: 0 0.7rem 0.65rem;
}
.setup-runts-found {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}
.setup-runts-found strong {
  font-weight: 800;
}
.setup-runts-docs,
.setup-runts-legal,
.setup-runts-fields,
.setup-runts-people {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--line));
  background: color-mix(in srgb, var(--brand-paper) 55%, #fff);
}
.setup-runts-fields-list,
.setup-runts-people-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.setup-runts-field-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr);
  gap: 0.45rem 0.75rem;
  align-items: baseline;
}
.setup-runts-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.setup-runts-field-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.setup-runts-person-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
}
.setup-runts-person-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.setup-runts-chip.is-muted {
  background: color-mix(in srgb, var(--line) 35%, #fff);
  color: var(--muted);
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  font-weight: 600;
}
.setup-runts-docs-heading {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.setup-runts-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.setup-runts-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: color-mix(in srgb, #fff 78%, var(--brand-paper));
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.setup-runts-doc-meta {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}
.setup-runts-doc-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.setup-runts-doc-file {
  font-size: 0.76rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setup-runts-doc-open {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  color: var(--brand-primary-deep);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.setup-runts-doc-open:hover {
  background: color-mix(in srgb, var(--brand-primary) 14%, #fff);
}
@media (max-width: 560px) {
  .setup-runts-doc-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .setup-runts-doc-open {
    margin-left: auto;
  }
}
.setup-runts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.setup-runts-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary-deep);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
}
.setup-runts-note {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.4;
  font-weight: 600;
  color: color-mix(in srgb, var(--ink) 82%, #8a6a12);
  background: color-mix(in srgb, #f6e7b2 55%, #fff);
  border: 1px solid color-mix(in srgb, #d4b45a 35%, var(--line));
}
.setup-runts-note.is-fail {
  color: color-mix(in srgb, var(--ink) 75%, #8b2e2e);
  background: color-mix(in srgb, #f3d0d0 45%, #fff);
  border-color: color-mix(in srgb, #c97070 40%, var(--line));
}
.setup-runts-note.is-warn {
  font-weight: 700;
  border-color: color-mix(in srgb, #c99a2e 50%, var(--line));
  background: color-mix(in srgb, #f6e7b2 70%, #fff);
}
.setup-runts-warn {
  margin: 0 0 0.45rem;
  font-weight: 600;
}
.setup-runts-doc-dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  max-width: min(960px, 96vw);
  width: 100%;
  background: transparent;
}
.setup-runts-doc-dialog::backdrop {
  background: color-mix(in srgb, #0b1c24 62%, transparent);
  backdrop-filter: blur(5px);
}
.setup-runts-doc-shell {
  background: var(--card, #fff);
  border-radius: 18px;
  box-shadow: 0 24px 60px color-mix(in srgb, #000 28%, transparent);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(90vh, 920px);
  overflow: hidden;
}
.setup-runts-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line, #d7dee7);
}
.setup-runts-doc-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink, #1a1a1a);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setup-runts-doc-frame-wrap {
  min-height: 0;
  overflow: auto;
  background: #edf1f4;
}
.setup-runts-doc-frame {
  display: block;
  width: 100%;
  height: min(78vh, 820px);
  border: 0;
  background: #fff;
}
.setup-locale-grid {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.setup-locale-grid > legend.setup-field-label {
  grid-column: 1 / -1;
  font-weight: 700;
  margin-bottom: 0.15rem;
  padding: 0;
}
.setup-locale-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, white);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.setup-locale-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.setup-locale-card img {
  display: block;
  border-radius: 3px;
  box-shadow: 0 1px 3px color-mix(in srgb, #000 18%, transparent);
}
.setup-locale-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand-primary) 42%, var(--line));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-primary) 14%, transparent);
  transform: translateY(-1px);
}
[data-setup-wizard].is-runts-busy .setup-form input:not([data-setup-runts-input]),
[data-setup-wizard].is-runts-busy .setup-form select,
[data-setup-wizard].is-runts-busy .setup-form textarea,
[data-setup-wizard].is-runts-busy .setup-form button:not([data-setup-runts-btn]) {
  pointer-events: none;
  opacity: 0.55;
}
.setup-runts-row input {
  margin: 0;
  width: 100%;
  max-width: 100%;
}
.setup-name-pair .setup-field-name {
  grid-column: 1;
  grid-row: 1;
}
.setup-name-pair .setup-field-legal {
  grid-column: 2;
  grid-row: 1;
}
.setup-name-pair .setup-field-currency {
  max-width: 18rem;
}
.setup-runts-block.is-looking .setup-scrape-btn {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
  box-shadow: none;
}
.setup-runts-live {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: color-mix(in srgb, white 72%, var(--brand-paper));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
  max-height: none;
  overflow: visible;
  min-height: 0;
}
.setup-runts-block.is-found .setup-runts-live {
  grid-template-columns: 1fr;
  padding: 0.55rem 0.65rem;
}
.setup-runts-live[hidden] { display: none !important; }
.setup-runts-live-copy { display: grid; gap: 0.4rem; min-width: 0; }
.setup-runts-status strong {
  color: var(--ink);
  font-weight: 800;
}
.setup-runts-status.is-error {
  color: var(--danger, #9b1c1c);
}
.setup-runts-status.is-warn {
  color: var(--warn, #9a6700);
}
.setup-runts-elapsed {
  margin: 0;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.setup-runts-progress {
  height: 0.45rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--line));
  overflow: hidden;
}
.setup-runts-progress[hidden] { display: none !important; }
.setup-runts-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--brand-primary);
  transition: width 0.28s ease;
}
.setup-runts-progress.is-indeterminate .setup-runts-progress-bar {
  width: 38%;
  animation: setup-runts-indet 1.15s ease-in-out infinite;
}
@keyframes setup-runts-indet {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}
.setup-runts-block.is-looking .setup-scrape-spinner { display: block; }
.setup-runts-block:not(.is-looking) .setup-scrape-spinner { display: none; }
.setup-name-pair .setup-full-name-preview {
  margin: 0;
  line-height: 1.45;
}
.setup-full-name-value {
  color: var(--ink);
  font-weight: 800;
}
.setup-field-legal select {
  font-weight: 700;
  letter-spacing: 0.02em;
}
@media (max-width: 700px) {
  .setup-name-pair {
    grid-template-columns: 1fr;
  }
  .setup-name-pair .setup-field-name,
  .setup-name-pair .setup-field-legal,
  .setup-name-pair .setup-runts-block,
  .setup-name-pair .setup-field-currency {
    grid-column: 1 / -1;
    grid-row: auto;
    max-width: none;
  }
  .setup-name-pair .setup-runts-block .setup-field-runts {
    flex-basis: auto;
    width: auto;
    max-width: none;
  }
  .setup-runts-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(5.5rem, 7.5rem);
    max-width: none;
  }
  .setup-runts-actions {
    max-width: none;
  }
}
.page-lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 42rem;
}
.section-lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.panel, .stat, .table-wrap, .form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.panel, .form-card { padding: 1.35rem 1.45rem; margin-bottom: 1.25rem; }
.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.charts-treasury {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .charts-treasury {
    grid-template-columns: 1fr;
  }
}
.chart-panel {
  margin-bottom: 0;
}
.chart-panel-wide {
  grid-column: 1 / -1;
}
.chart-frame {
  position: relative;
  height: 280px;
}
.chart-frame-donut {
  height: 260px;
  max-width: 360px;
  margin: 0 auto;
}
.empty-state.compact {
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  padding: 1.2rem 1.25rem;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -10%;
  top: -20%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  pointer-events: none;
}

/* Contesto dashboard: stesso sfondo chiaro per tutti i box del modulo */
.stats-context-members .stat {
  background: color-mix(in srgb, var(--brand-primary) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 24%, var(--line));
}
.stats-context-members .stat::after {
  background: color-mix(in srgb, var(--brand-primary) 16%, transparent);
}
.stats-context-treasury .stat {
  background: color-mix(in srgb, #c9842a 9%, #ffffff);
  border-color: color-mix(in srgb, #c9842a 22%, var(--line));
}
.stats-context-treasury .stat::after {
  background: color-mix(in srgb, #c9842a 15%, transparent);
}
.stats-context-deadlines .stat {
  background: color-mix(in srgb, var(--brand-accent) 9%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-accent) 22%, var(--line));
}
.stats-context-deadlines .stat::after {
  background: color-mix(in srgb, var(--brand-accent) 15%, transparent);
}
.stats-context-documents .stat {
  background: color-mix(in srgb, var(--brand-socly) 8%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-socly) 20%, var(--line));
}
.stats-context-documents .stat::after {
  background: color-mix(in srgb, var(--brand-socly) 14%, transparent);
}
.stats-context-org .stat {
  background: color-mix(in srgb, #6b5b95 9%, #ffffff);
  border-color: color-mix(in srgb, #6b5b95 22%, var(--line));
}
.stats-context-org .stat::after {
  background: color-mix(in srgb, #6b5b95 15%, transparent);
}

.stat .label { color: var(--muted); font-size: 0.85rem; font-weight: 600; position: relative; z-index: 1; }
.stat .value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-top: 0.4rem;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

label { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; color: var(--muted); font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], input[type="color"], input[type="tel"],
input[type="search"], select, textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 1rem;
  margin-bottom: 0.95rem;
  color: var(--ink);
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
/* Specialty / member fields share the same visible chrome as setup */
.member-form input[type="text"],
.member-form input[type="email"],
.member-form input[type="password"],
.member-form input[type="number"],
.member-form input[type="date"],
.member-form input[type="tel"],
.member-form input[type="search"],
.member-form select,
.member-form textarea,
.geo-address input,
.geo-birth-place input,
.phone-field input,
.phone-field select {
  border-color: var(--line);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand-primary) 35%, white);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 0; border-radius: 999px;
  padding: 0.72rem 1.2rem;
  min-height: 2.75rem;
  font: inherit; font-weight: 700;
  cursor: pointer;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--brand-primary-deep);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-primary) 32%, transparent);
  text-decoration: none;
  color: var(--brand-on-primary-deep);
}
.btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-primary) 45%, white);
  outline-offset: 2px;
}
.btn:disabled,
.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}
.btn-ghost:disabled,
.btn-ghost[disabled],
.btn-ghost[aria-busy="true"] {
  background: color-mix(in srgb, var(--ink) 4%, white);
  color: var(--muted);
  border-color: color-mix(in srgb, var(--ink) 12%, var(--line));
}
.btn-ghost:disabled:hover,
.btn-ghost[disabled]:hover,
.btn-ghost[aria-busy="true"]:hover {
  background: color-mix(in srgb, var(--ink) 4%, white);
  border-color: color-mix(in srgb, var(--ink) 12%, var(--line));
  color: var(--muted);
  transform: none;
  box-shadow: none;
}
.btn-accent { background: var(--brand-accent); color: var(--brand-on-accent); }
.btn-accent:hover {
  background: color-mix(in srgb, var(--brand-accent) 82%, black);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-accent) 32%, transparent);
  color: var(--brand-on-accent);
}
.btn-accent:focus-visible {
  outline-color: color-mix(in srgb, var(--brand-accent) 45%, white);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  color: var(--brand-primary-deep);
  box-shadow: none;
}
.btn-danger { background: var(--danger); }
.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 85%, black);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--danger) 28%, transparent);
}
.config-danger-zone {
  margin-top: 2.25rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--danger) 6%, white);
  display: grid;
  gap: 0.75rem;
}
.config-danger-title {
  margin: 0;
  color: var(--danger);
  font-size: 1.05rem;
  font-weight: 700;
}
.config-danger-text {
  margin: 0;
  color: color-mix(in srgb, var(--danger) 70%, var(--ink));
  line-height: 1.5;
}
.config-reset-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: min(440px, 92vw);
  width: 100%;
  background: transparent;
  z-index: 1000;
  overflow: visible;
}
.config-reset-dialog::backdrop {
  background: color-mix(in srgb, var(--danger) 35%, transparent);
  backdrop-filter: blur(4px);
}
.config-reset-shell {
  background: var(--card);
  border-radius: 20px;
  padding: 1.35rem 1.4rem 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.85rem;
  border: 0;
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--danger) 22%, transparent);
}
.config-reset-text {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  font-weight: 600;
}
.config-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}
.btn-block { width: 100%; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.88rem; min-height: 2.25rem; }
.btn[hidden],
a.btn[hidden],
button.btn[hidden] { display: none !important; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

table { width: 100%; border-collapse: collapse; min-width: 36rem; }
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.table-wrap.embedded { box-shadow: none; border: 0; border-radius: 0; }
th, td { text-align: left; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: color-mix(in srgb, var(--brand-paper) 80%, white);
}
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--brand-primary) 4%, white); }
td .muted { font-size: 0.88rem; margin-top: 0.15rem; }

.badge {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--brand-primary) 14%, white);
  color: var(--brand-primary-deep);
}
.badge-due { background: color-mix(in srgb, var(--brand-accent) 16%, white); color: var(--brand-accent-ink); }
.badge-ok { background: color-mix(in srgb, var(--ok) 14%, white); color: var(--ok); }
.badge-warn { background: #fff4eb; color: var(--brand-accent-ink); }
.badge-muted {
  background: color-mix(in srgb, var(--ink) 8%, white);
  color: color-mix(in srgb, var(--ink) 62%, #6b7280);
}

.alert {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warn {
  background: #fff8e8;
  color: #7a5a00;
  border: 1px solid #f0d48a;
}
.setup-incomplete-list {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}
.setup-incomplete-list a {
  font-weight: 700;
}
.org-hide-vacant-toggle {
  margin-right: 0.5rem;
}
.org-chart.hide-vacant .org-node--vacant,
.org-chart.hide-vacant .org-node--add {
  display: none !important;
}
@media print {
  .org-chart.hide-vacant .org-node--vacant,
  .org-chart.hide-vacant .org-node--add {
    display: none !important;
  }
}

.member-list-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.member-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  flex-wrap: nowrap;
  min-height: 2rem;
}
.row-action-form {
  display: inline-flex;
  margin: 0;
}
.row-action-slot {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  visibility: hidden;
  pointer-events: none;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 1px solid var(--line, #d7dee7);
  border-radius: 10px;
  background: var(--card, #fff);
  color: var(--brand-primary-deep, var(--brand-primary, #0D6E66));
  cursor: pointer;
  text-decoration: none;
  position: relative;
  flex: 0 0 2rem;
  box-shadow: none;
  transform: none;
}
a.btn-icon:hover,
button.btn-icon:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 8%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 28%, var(--line, #d7dee7));
  color: var(--brand-primary-deep, var(--brand-primary, #0D6E66));
  text-decoration: none;
  transform: none;
  box-shadow: none;
}
.btn-icon.is-primary {
  background: var(--brand-primary, #0D6E66);
  border-color: var(--brand-primary, #0D6E66);
  color: #fff;
}
.btn-icon.is-primary:hover:not(:disabled) {
  background: var(--brand-primary-deep, #0a5a54);
  border-color: var(--brand-primary-deep, #0a5a54);
  color: #fff;
}
.btn-icon.is-danger {
  color: var(--danger, #b42318);
  border-color: color-mix(in srgb, var(--danger, #b42318) 35%, var(--line, #d7dee7));
}
.btn-icon.is-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger, #b42318) 8%, #fff);
  color: var(--danger, #b42318);
}
.btn-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-icon[aria-label]::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  background: var(--ink, #1a1a1a);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 40;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.18);
}
.btn-icon[aria-label]:hover::after,
.btn-icon[aria-label]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
.member-row-actions.row-actions,
.doc-row-actions .row-actions {
  width: auto;
}
.members-filter {
  padding: 0.95rem 1.1rem;
}
.members-filter-row {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) repeat(3, minmax(7.5rem, 1fr));
  gap: 0.75rem 0.85rem;
  align-items: end;
}
.members-filter-q {
  min-width: 0;
}
.members-filter-row .sf-field {
  margin: 0;
}
.members-filter-row .sf-field__label,
.members-filter-row .field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
}
@media (max-width: 960px) {
  .members-filter-row {
    grid-template-columns: 1fr 1fr;
  }
  .members-filter-q {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .members-filter {
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
  }
  .members-filter-row {
    grid-template-columns: 1fr;
  }

  .members-table-wrap {
    overflow: visible;
  }
  .members-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 0 !important;
  }
  .members-table thead {
    display: none;
  }
  .members-table tbody {
    display: grid;
    gap: 0.75rem;
  }
  .members-table tr {
    display: grid;
    gap: 0.45rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand-paper) 55%, #fff);
    box-shadow: var(--shadow-soft);
  }
  .members-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0;
    border: 0;
    font-size: 0.95rem;
    min-width: 0;
  }
  .members-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
    max-width: 42%;
  }
  .members-table td:first-child {
    display: block;
    padding-bottom: 0.35rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid var(--line);
  }
  .members-table td:first-child::before {
    display: none;
  }
  .members-table .member-list-name {
    font-weight: 800;
    font-size: 1.05rem;
  }
  .members-table .member-list-meta {
    margin-top: 0.15rem;
  }
  .members-table td:last-child {
    display: block;
    padding-top: 0.35rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--line);
  }
  .members-table td:last-child::before {
    display: none;
  }
  .members-table .member-row-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .members-table .member-row-actions .btn:not(.btn-icon) {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
  .members-table .member-row-actions .btn-icon,
  .members-table .member-row-actions .row-action-slot {
    flex: 0 0 2rem;
  }
}
.member-anomaly-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
  color: #d4a017;
  cursor: help;
  outline: none;
  z-index: 1;
}
.member-anomaly-mark.is-static { cursor: default; z-index: 0; }
.member-anomaly-mark:hover,
.member-anomaly-mark:focus-visible {
  z-index: 2147483647;
}
.member-anomaly-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  z-index: 2147483647;
  min-width: 12rem;
  max-width: min(22rem, 70vw);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #3d3208;
  color: #fff8e8;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  white-space: normal;
}
.member-anomaly-mark:hover .member-anomaly-tooltip,
.member-anomaly-mark:focus-visible .member-anomaly-tooltip {
  opacity: 1;
  visibility: visible;
}
/* Evita che overflow della tabella tagli il popup sotto header/menu */
.panel:has(.member-anomaly-mark:hover) .table-wrap,
.panel:has(.member-anomaly-mark:focus-within) .table-wrap {
  overflow: visible;
}
.member-anomaly-banner-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.member-anomaly-list {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}
.member-anomaly-list li { margin: 0.2rem 0; }
.member-gdpr-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.member-gdpr-badges .badge { font-size: 0.72rem; }
.detail-item-wide { grid-column: 1 / -1; }
.members-summary-stats { margin-bottom: 1rem; }
.members-bulk-bar {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0 1rem;
  opacity: 0;
  pointer-events: none;
  transition:
    grid-template-rows 0.28s ease,
    opacity 0.22s ease,
    margin-bottom 0.28s ease;
}
.members-bulk-bar.is-open {
  grid-template-rows: 1fr;
  margin-bottom: 0.75rem;
  opacity: 1;
  pointer-events: auto;
}
.members-bulk-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  min-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition:
    padding 0.28s ease,
    border-color 0.22s ease,
    background-color 0.22s ease;
}
.members-bulk-bar.is-open .members-bulk-bar-inner {
  padding: 0.75rem 1rem;
  border-color: var(--line);
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
}
.members-bulk-count { font-weight: 700; min-width: 1.25rem; }
.members-bulk-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }
@media (prefers-reduced-motion: reduce) {
  .members-bulk-bar,
  .members-bulk-bar-inner {
    transition: none;
  }
}
.members-col-check { width: 2.25rem; }
tr.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
tr.clickable-row:hover,
tr.clickable-row:focus-visible {
  background-color: color-mix(in srgb, var(--brand-primary) 5%, transparent);
  outline: none;
}
tr.clickable-row:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}
.member-row-actions.row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
}
.member-inline-form { display: inline; margin: 0; }
.member-scheda-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 0.35fr) minmax(0, 0.65fr);
  gap: 1.15rem;
  align-items: start;
}
.member-scheda-sidebar {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1.1rem;
  padding: 1.15rem 1.2rem 1.25rem;
}
.member-scheda-identity {
  text-align: center;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}
.member-scheda-avatar {
  position: relative;
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
}
.member-scheda-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.member-scheda-avatar.is-empty {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 12%, white), color-mix(in srgb, var(--brand-accent) 10%, white));
}
.member-scheda-status-badge {
  position: absolute;
  left: 50%;
  bottom: 0.55rem;
  transform: translateX(-50%);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 12%, transparent);
}
.member-scheda-name {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}
.member-scheda-meta {
  margin: 0;
  font-size: 0.9rem;
}
.member-scheda-contacts {
  display: grid;
  gap: 0.45rem;
}
.member-scheda-contact {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  background: color-mix(in srgb, var(--brand-paper, #f7f3f0) 55%, #fff);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.92rem;
  word-break: break-word;
}
.member-scheda-contact:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 35%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
}
.member-scheda-contact.is-empty {
  font-weight: 500;
  border-style: dashed;
  margin: 0;
}
.member-scheda-contact-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--brand-primary);
}
.member-scheda-side-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}
.member-consent-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.member-consent-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.3;
}
.member-consent-checklist li.is-ok {
  background: color-mix(in srgb, var(--ok) 10%, #fff);
  color: var(--ok);
}
.member-consent-checklist li.is-missing {
  background: color-mix(in srgb, var(--brand-accent, #e8a317) 12%, #fff);
  color: var(--brand-accent-ink, #7a4a00);
}
.member-consent-mark {
  flex: 0 0 auto;
  font-weight: 800;
}
.member-scheda-side-actions {
  display: grid;
  gap: 0.45rem;
}
.member-scheda-side-actions .btn {
  width: 100%;
  justify-content: center;
}
.member-scheda-side-payment {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.member-scheda-main {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}
.member-scheda-card .panel-header {
  align-items: center;
}
.member-scheda-facts {
  display: grid;
  gap: 0.85rem;
}
.member-scheda-fact .label {
  font-size: 0.78rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 58%, transparent);
  margin-bottom: 0.2rem;
}
.member-scheda-fact .value {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
}
.member-scheda-fact.is-anomaly {
  outline: 1px solid color-mix(in srgb, #d4a017 45%, var(--line));
  background: #fff8e8;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}
.member-scheda-notes {
  margin: 1.1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.member-scheda-enrollment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
}
.member-enrollment-preview {
  margin-top: 1rem;
}
.member-enrollment-preview img {
  max-width: min(100%, 28rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.member-enrollment-dropzone {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.member-enrollment-dropzone-ui {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
  padding: 1.1rem 1.15rem;
  border-radius: 16px;
  border: 1.5px dashed color-mix(in srgb, var(--brand-primary) 42%, var(--line));
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--brand-primary) 8%, transparent), transparent 55%),
    color-mix(in srgb, var(--brand-paper, #f7f3f0) 40%, #fff);
}
.member-enrollment-dropzone-ui.is-dragover {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
}
.member-enrollment-dropzone-ui .sf-field {
  margin: 0.2rem 0 0;
}
.detail-item.is-anomaly {
  outline: 1px solid color-mix(in srgb, #d4a017 45%, var(--line));
  background: #fff8e8;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}
@media (max-width: 960px) {
  .member-scheda-layout {
    grid-template-columns: 1fr;
  }
  .member-scheda-sidebar {
    position: static;
  }
}

.error-reassure {
  max-width: 36rem;
  margin: 0 auto;
}
.error-reassure .lede {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 1.2rem;
}
.error-reassure-block {
  margin: 0 0 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--line));
}
.error-reassure-block .h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand-primary-deep);
}
.error-reassure-block p {
  margin: 0;
  line-height: 1.5;
}
.error-reassure-block a {
  font-weight: 700;
  color: var(--brand-primary-deep);
}
.error-reassure-ref {
  margin: 1rem 0 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  align-items: center;
}
.error-reassure-hint {
  margin: 0 0 1.2rem;
  font-size: 0.86rem;
}
.error-tech-details {
  margin-top: 1.4rem;
}
.error-tech-card {
  max-width: 42rem;
}
.error-tech-list {
  display: grid;
  gap: 0.75rem;
  margin: 0.85rem 0 0;
}
.error-tech-list > div {
  display: grid;
  grid-template-columns: minmax(7rem, 9.5rem) 1fr;
  gap: 0.55rem 1rem;
  align-items: start;
}
.error-tech-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.error-tech-list dd {
  margin: 0;
  word-break: break-word;
}
.error-tech-list code,
.error-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-primary-deep);
}
.error-code {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
@media (max-width: 640px) {
  .error-tech-list > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

.filter-bar {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--muted);
}
.empty-state strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.detail-item .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; margin-bottom: 0.25rem; }
.detail-item .value { font-size: 1.02rem; }

/* —— Auth shell —— */
.auth-shell { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; }
.auth-main {
  display: grid;
  /* Focus on the login form (right): brand column stays supporting. */
  grid-template-columns: minmax(16rem, 0.62fr) minmax(24rem, 1.38fr);
  min-height: calc(100vh - 72px);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  color: var(--brand-paper);
  background:
    radial-gradient(600px 400px at 18% 12%, color-mix(in srgb, var(--brand-accent) 36%, transparent), transparent 68%),
    radial-gradient(480px 320px at 100% 40%, color-mix(in srgb, var(--brand-primary) 24%, transparent), transparent 70%),
    linear-gradient(165deg, var(--brand-primary) 0%, var(--brand-primary-deep) 48%, color-mix(in srgb, var(--brand-primary-deep) 72%, #000) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: auto -20% -30% 40%;
  height: 70%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-accent) 30%, transparent), transparent 65%);
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}
.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 26rem;
  flex: 0 0 auto;
}
.auth-assoc-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 11rem);
  max-height: 7.5rem;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 1.35rem;
  padding: 0.65rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 32px color-mix(in srgb, #000 28%, transparent);
}
.auth-mark {
  display: block;
  height: clamp(4.25rem, 9vw, 6.25rem);
  width: auto;
  max-width: min(100%, 420px);
  margin: 0 0 1.25rem;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.28));
}
.auth-logo {
  width: 72px; height: 72px; border-radius: 18px; margin-bottom: 1.75rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28); background: #fff; object-fit: contain; padding: 8px;
}
.auth-product {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.4rem;
}
.auth-product .socly {
  color: var(--brand-socly);
  font-weight: 700;
  font-size: clamp(3.2rem, 8vw, 4.6rem);
  display: block;
}
.auth-product-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.auth-product-line .assoc-lockup {
  white-space: nowrap;
}
.auth-product .per {
  color: color-mix(in srgb, var(--brand-paper) 72%, var(--brand-accent));
  font-weight: 500;
}
.auth-product .assoc { color: var(--brand-accent-on-dark); }
.auth-product .assoc-new {
  color: var(--brand-accent-on-dark);
  font-weight: 700;
}
.auth-footer .footer-new {
  color: var(--brand-accent-ink);
  font-weight: 700;
}
.auth-motto {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 560; margin: 0 0 0.85rem; color: #E7F7F3;
}
.auth-desc {
  margin: 0; color: color-mix(in srgb, var(--brand-paper) 78%, transparent);
  line-height: 1.55; font-size: 1.02rem; max-width: 32rem;
}
.auth-setup-prep-lede {
  margin: 0 0 0.35rem;
  max-width: 26rem;
}
.auth-setup-prep {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 26rem;
  margin: 0.85rem 0 1rem;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 16px;
  background: color-mix(in srgb, #fff 10%, transparent);
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  backdrop-filter: blur(6px);
}
.auth-setup-prep-ready {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--brand-paper) 72%, transparent);
}
.auth-setup-prep-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}
.auth-setup-prep-list li {
  position: relative;
  padding: 0 0 0 1.35rem;
  color: #E7F7F3;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
}
.auth-setup-prep-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1rem;
  color: color-mix(in srgb, var(--brand-paper) 92%, transparent);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}
.auth-setup-prep-demo {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, #fff 16%, transparent);
  color: color-mix(in srgb, var(--brand-paper) 78%, transparent);
  font-size: 0.88rem;
  line-height: 1.45;
}
.auth-news-slot {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 34rem;
  margin: 0.75rem 0;
  min-height: 5.5rem;
  align-self: stretch;
}
.auth-news-slot > .auth-news-card {
  width: 100%;
}
.auth-news-error {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: color-mix(in srgb, var(--brand-paper) 62%, transparent);
  word-break: break-word;
}
.auth-news-unavailable {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--brand-paper) 72%, transparent);
  text-align: center;
}
.auth-news-card--empty {
  background: color-mix(in srgb, #000 18%, transparent);
  opacity: 0.5;
}
.auth-news-slot.is-empty {
  opacity: 0.5;
}
.auth-news-slot.is-empty .auth-news-card--empty {
  opacity: 1; /* opacity already on slot */
}
.auth-news-card--empty .auth-news-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.25rem;
  padding: 1rem 1.1rem;
}
.auth-news-card {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, #000 24%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-paper) 16%, transparent);
  box-shadow: 0 18px 40px color-mix(in srgb, #000 22%, transparent);
}
.auth-news-hero {
  min-height: 118px;
  background-size: cover;
  background-position: center;
  background-color: color-mix(in srgb, var(--brand-primary-deep) 55%, #000);
}
.auth-news-body {
  padding: 0.85rem 1rem 1rem;
}
.auth-news-date {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-bottom: 0.25rem;
}
.auth-news-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--brand-paper);
}
.auth-news-excerpt {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--brand-paper) 82%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.auth-news-link {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-accent-on-dark);
  text-decoration: none;
}
.auth-news-link:hover { text-decoration: underline; }
.auth-updates-line { margin: 0; }
.auth-updates-dialog {
  color: var(--ink, #1a1a1a);
}
.auth-updates-shell {
  max-width: min(460px, 92vw);
}
.auth-updates-meta {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 14%, var(--line, #d7dee7));
  display: grid;
  gap: 0.55rem;
}
.auth-updates-meta > div {
  display: grid;
  gap: 0.1rem;
}
.auth-updates-meta dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted, #667085);
}
.auth-updates-meta dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ink, #1a1a1a);
  word-break: break-word;
}
.auth-updates-meta code {
  font-size: 0.85em;
  font-weight: 700;
}
.auth-updates-meta a {
  color: var(--brand-primary, #0D6E66);
  text-decoration: none;
}
.auth-updates-meta a:hover {
  text-decoration: underline;
}
.auth-check-updates {
  background: none;
  border: none;
  padding: 0;
  color: color-mix(in srgb, var(--brand-paper) 78%, transparent);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.auth-check-updates:hover { color: var(--brand-paper); }
.auth-check-updates:disabled { opacity: 0.55; cursor: wait; }
.auth-updates-dialog .auth-updates-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.auth-asterisk {
  opacity: 0.42;
  font-weight: 500;
}
.auth-brand-meta {
  position: relative; z-index: 1; margin-top: 0; font-size: 0.9rem;
  color: color-mix(in srgb, var(--brand-paper) 65%, transparent);
  display: grid;
  gap: 0.85rem;
  flex: 0 0 auto;
}
.auth-footer-sep {
  opacity: 0.55;
}
.auth-footer-terms {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  opacity: 0.85;
}
.auth-footer-terms:hover {
  opacity: 1;
  color: var(--ink);
}
.auth-terms-body {
  font-size: 0.92rem;
  line-height: 1.5;
  max-height: min(62vh, 30rem);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand-primary) 45%, transparent) color-mix(in srgb, var(--line) 55%, transparent);
}
.auth-terms-body::-webkit-scrollbar { width: 10px; }
.auth-terms-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand-primary) 45%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.auth-terms-body::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 999px;
}
.terms-doc {
  display: grid;
  gap: 0.85rem;
}
.terms-doc-meta {
  margin: 0;
  font-weight: 700;
}
.terms-doc-version {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.terms-doc-intro {
  margin: 0;
}
.terms-doc-section {
  display: grid;
  gap: 0.3rem;
}
.terms-doc-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--brand-primary-deep);
}
.terms-doc-text {
  margin: 0;
}
.terms-doc-section-strong {
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 7%, #fff);
  border-radius: 12px;
}
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  background: color-mix(in srgb, var(--brand-paper) 70%, white);
}
.auth-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(1.65rem, 3.2vw, 2.4rem);
}
.auth-card h1 { margin-bottom: 0.45rem; }
.auth-card .lede { color: var(--muted); margin: 0 0 1.4rem; line-height: 1.5; }
.auth-card .auth-setup-lede { white-space: pre-line; }
.auth-secondary-form { margin-top: 0.75rem; }
.btn-quiet {
  background: transparent;
  color: color-mix(in srgb, var(--ink) 58%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  box-shadow: none;
  font-weight: 600;
  opacity: 0.9;
}
.btn-quiet:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--ink) 4%, white);
  border-color: color-mix(in srgb, var(--ink) 18%, var(--line));
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  box-shadow: none;
}
.auth-links {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin: -0.25rem 0 1.1rem; font-size: 0.92rem;
}

.auth-lang {
  margin: 0 0 1.5rem;
  padding: 1.05rem 1.15rem 1.1rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--brand-primary) 10%, white), color-mix(in srgb, var(--brand-accent) 8%, white));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand-primary) 10%, transparent);
}
.auth-lang-rotate {
  margin: 0 0 0.85rem;
  min-height: 2rem;
  position: relative;
  padding-left: 1.85rem;
}
.auth-lang-rotate::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12rem;
  width: 1.35rem;
  height: 1.35rem;
  background: var(--brand-primary);
  opacity: 0.92;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.8 3.8 5.8 3.8 9S14.5 18.2 12 21c-2.5-2.8-3.8-5.8-3.8-9S9.5 5.8 12 3z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.8 3.8 5.8 3.8 9S14.5 18.2 12 21c-2.5-2.8-3.8-5.8-3.8-9S9.5 5.8 12 3z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.auth-lang-rotate-item {
  /* keep all items in the same layout slot so fades are smooth */
  display: inline;
  position: absolute;
  left: 1.85rem;
  right: 0;
  top: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 420ms ease, transform 420ms ease;
  visibility: hidden;
  font-family: var(--font-display);
  font-size: var(--heading-2-size);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--brand-primary-deep);
}
.auth-lang-rotate-item.is-active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.auth-locale-grid {
  margin: 0;
  width: 100%;
}
.auth-lang select {
  width: 100%;
  margin-bottom: 0;
  font-weight: 700;
  font-size: 1.02rem;
  border-color: color-mix(in srgb, var(--brand-primary) 35%, var(--line));
  background: rgba(255, 255, 255, 0.92);
}
.auth-lang select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 16%, transparent);
}
.auth-footer {
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
  padding: 1rem 1.5rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem;
  justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 0.88rem;
}
.auth-footer .socly { color: var(--brand-socly); font-weight: 700; }
.auth-footer strong { color: var(--ink); font-weight: 700; }

.install-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.install-shell {
  width: min(880px, 100%);
  display: grid;
  gap: 1rem;
}
.install-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.install-top img,
.install-mark {
  height: 64px;
  width: auto;
  max-width: 300px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: left center;
}
.install-top .mark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand-socly);
  margin: 0;
}
.install-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  animation: rise 0.45s ease both;
}
.hero-mark {
  font-family: var(--font-display);
  font-size: 2.1rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.04em;
}
.heart {
  color: #E11D48;
  display: inline;
  margin: 0 0.15em;
  font-style: normal;
}
.steps { display: flex; gap: 0.4rem; margin: 1rem 0 1.5rem; flex-wrap: wrap; }
.step-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--brand-primary) 10%, white);
  color: var(--brand-primary-deep);
}
.step-pill.active { background: var(--brand-primary); color: var(--brand-on-primary); }

.checkbox-row { display: flex; gap: 0.55rem; align-items: flex-start; margin-bottom: 0.75rem; }
.checkbox-row input { width: auto; margin: 0.15rem 0 0; flex-shrink: 0; }
.checkbox-row label, .checkbox-row { color: var(--ink); }
.checkbox-row-lg {
  align-items: center;
  gap: 0.65rem;
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
}
.checkbox-row-lg input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--brand-primary, #0D6E66);
}
.checkbox-row-lg span { font-size: inherit; }
[data-treasury-member-fields] { margin-bottom: 0.85rem; }
.treasury-currency-hint { margin: 0.35rem 0 0; font-size: 0.88rem; }
.ack-list {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.ack-list .member-profile-block-title {
  margin-bottom: 0.15rem;
}
.ack-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-paper) 70%, white);
}
.ack-item .ack-row {
  flex: 1 1 14rem;
  margin: 0;
  min-width: 0;
}
.ack-row span { line-height: 1.35; }
.ack-item .btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.ack-optional {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.ack-optional-lede {
  margin: 0;
  font-size: 0.88rem;
}
.ack-optional-list {
  display: grid;
  gap: 0.45rem;
}
.ack-optional-row {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #fff 88%, var(--brand-paper));
}
.ack-trace {
  margin: 0.35rem 0 0;
  padding: 0.65rem 0.8rem;
  font-size: 0.88rem;
  line-height: 1.4;
  border-left: 3px solid color-mix(in srgb, var(--brand-primary) 45%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.tessera-partial-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.doc-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: min(720px, 94vw);
  width: 100%;
  background: transparent;
  overflow: visible;
}
.doc-dialog::backdrop {
  background: color-mix(in srgb, var(--brand-primary-deep) 50%, transparent);
  backdrop-filter: blur(4px);
}
.doc-shell {
  background: var(--card);
  border: 0;
  border-radius: 20px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.85rem;
  max-height: min(82vh, 760px);
}
.doc-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.doc-body {
  overflow: auto;
  max-height: min(52vh, 480px);
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-paper) 55%, white);
  line-height: 1.55;
  white-space: normal;
  font-size: 0.95rem;
}
.doc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.legal-langs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}
.legal-doc-editor {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.legal-doc-runts-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, #2563eb 10%, #eff6ff);
  border: 1px solid color-mix(in srgb, #2563eb 28%, transparent);
  color: #1e3a8a;
}
.legal-doc-runts-banner-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: color-mix(in srgb, #2563eb 18%, white);
  color: #1d4ed8;
}
.legal-doc-runts-banner-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}
.legal-doc-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.legal-doc-tablist {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.legal-doc-tablist::-webkit-scrollbar {
  display: none;
}
.legal-doc-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.legal-doc-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.legal-doc-tab[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--line));
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
  color: var(--brand-primary-deep, var(--brand-primary));
}
.legal-doc-tab-check {
  color: #15803d;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
}
.legal-doc-tab.is-translated {
  border-color: color-mix(in srgb, #16a34a 40%, var(--line));
}
.legal-doc-translate-btn {
  white-space: nowrap;
}
.legal-doc-expand-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--brand-primary);
  cursor: pointer;
  flex: 0 0 auto;
}
.legal-doc-expand-btn:hover {
  color: var(--brand-accent);
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--line));
  background: color-mix(in srgb, var(--brand-primary) 6%, white);
}
.legal-doc-expand-icon {
  display: block;
}
.legal-doc-panel textarea {
  width: 100%;
  min-height: 6.5rem;
  max-height: 9rem;
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
}
.legal-doc-translate-btn.is-busy {
  opacity: 0.85;
  pointer-events: none;
  position: relative;
  padding-left: 1.85rem;
}
.legal-doc-translate-btn.is-busy::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 50%;
  width: 0.85rem;
  height: 0.85rem;
  margin-top: -0.425rem;
  border: 2px solid color-mix(in srgb, var(--brand-primary) 30%, transparent);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: legal-doc-spin 0.7s linear infinite;
}
@keyframes legal-doc-spin {
  to { transform: rotate(360deg); }
}
.legal-doc-editor.is-expanded {
  position: fixed;
  inset: 0.85rem;
  z-index: 10050;
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  width: auto;
  max-width: none;
}
.legal-doc-editor.is-expanded .legal-doc-panel:not([hidden]) {
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.legal-doc-editor.is-expanded .legal-doc-panel textarea {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  resize: none;
}
body.legal-doc-expanded {
  overflow: hidden;
}
body.legal-doc-expanded::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(15, 23, 42, 0.45);
}
@media (max-width: 720px) {
  .legal-doc-tab-label {
    display: none;
  }
  .legal-doc-translate-btn {
    font-size: 0.78rem;
    padding-inline: 0.55rem;
  }
}
.legal-langs textarea {
  min-height: 10rem;
  font-family: inherit;
  line-height: 1.45;
}
@media (max-width: 960px) {
  .legal-langs { grid-template-columns: 1fr; }
}
.member-profile-grid {
  display: grid;
  gap: 1.1rem;
}
.member-profile-block {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: color-mix(in srgb, #fff 92%, var(--brand-primary) 8%);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.member-profile-block[hidden],
[data-guardian-field][hidden] {
  display: none !important;
}
.member-profile-block > * {
  min-width: 0;
}
.member-profile-block-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--brand-primary-deep);
}
.member-profile-identity {
  display: grid;
  gap: 1.1rem;
  min-width: 0;
  width: 100%;
}
.member-profile-identity--split {
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 11.5rem);
  align-items: start;
}
.member-profile-block--base {
  align-content: start;
}
.member-profile-block--photo {
  align-content: start;
}
.member-profile-block--photo .photo-field {
  margin: 0;
  max-width: none;
}
.member-form .member-profile-block--photo .photo-field {
  max-width: none;
}
@media (max-width: 820px) {
  .member-profile-identity--split {
    grid-template-columns: 1fr;
  }
}
/* Shared 50/50 + 80/20 grid rhythm for member profile blocks */
.member-form .member-field-row--identity-names,
.member-form .member-field-row--identity-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
  align-items: start;
}
.member-form .member-field-row--contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  width: 100%;
  align-items: start;
}
.member-form .member-field-row--birth {
  display: grid;
  grid-template-columns: minmax(11.5rem, 15.5rem) minmax(0, 1fr);
  gap: 0.85rem;
  width: 100%;
  align-items: start;
}
.member-form .member-field-row--birth-fiscal {
  display: flex;
  flex-wrap: nowrap;
  align-items: start;
  gap: 0.85rem;
}
.member-field-row--birth > .field-block,
.member-field-row--birth > .geo-birth-host {
  min-width: 0;
  width: 100%;
}
.member-form .member-field-row--birth-fiscal > .field-block--birth-date {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
}
.member-form .member-field-row--birth-fiscal > .field-block[data-field="fiscal_code"] {
  flex: 1 1 14rem;
  width: auto;
  min-width: 13.5rem;
  max-width: none;
}
.member-form .member-field-row--birth-fiscal > .geo-birth-host {
  flex: 0 0 16rem;
  width: 16rem;
  min-width: 16rem;
  max-width: 16rem;
  margin-bottom: 0.25rem;
}
.member-form .member-field-row--birth-fiscal .geo-birth-place,
.member-form .member-field-row--birth-fiscal .member-geo-birth {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
}
.member-form .member-field-row--birth-fiscal .geo-field-label-row {
  display: flex;
  align-items: center;
  min-height: 1.25rem;
  margin: 0 0 0.4rem;
  gap: 0.45rem;
}
.member-form .member-field-row--birth-fiscal .geo-field-text-label {
  display: inline;
  margin: 0;
  line-height: 1.25;
  font-size: 0.9rem;
  font-weight: 600;
}
.member-form .member-field-row--birth-fiscal .geo-foreign-pill {
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.1;
}
.member-form .field-block--birth-date {
  max-width: none;
}
.birth-date-row,
.sf-field__birth-row {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
  justify-items: start;
}
.birth-date-row input[type="date"],
.member-form .birth-date-row input[type="date"],
.sf-field__birth-row input[type="date"] {
  width: 100%;
  max-width: 14rem;
  min-width: 0;
  margin-bottom: 0;
}
.member-form .member-field-row--birth-fiscal .birth-date-row,
.member-form .member-field-row--birth-fiscal .sf-field__birth-row {
  width: 100%;
}
.member-form .member-field-row--birth-fiscal .birth-date-row input[type="date"],
.member-form .member-field-row--birth-fiscal .sf-field__birth-row input[type="date"] {
  width: 100%;
  max-width: 14rem;
}
.birth-age {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
  color: var(--brand-primary-deep);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}
.birth-age[hidden] {
  display: none !important;
}
.member-field-row--fiscal {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}
.member-field-row--fiscal .field-block {
  max-width: none;
  width: 100%;
}
.member-field-row--fiscal .cf-row,
.member-form .member-field-row--birth-fiscal .cf-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  width: 100%;
}
.member-field-row--fiscal .cf-row .btn,
.member-form .member-field-row--birth-fiscal .cf-row .btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  justify-content: center;
}
.geo-field-label-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
  width: 100%;
  min-width: 0;
}
.geo-field-label-row--split {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.geo-field-label-row--split .geo-field-text-label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.geo-field-label-row--split .geo-foreign-inline {
  flex: 0 0 auto;
  margin: 0;
  margin-left: 0.25rem;
  max-width: 100%;
}
.geo-field-text-label {
  min-width: 0;
  font-weight: 650;
  color: var(--brand-primary-deep);
  font-size: 0.9rem;
}
.member-form .member-geo-birth .geo-field-text-label {
  color: var(--brand-primary-deep);
}
.geo-foreign-inline {
  margin: 0;
  flex-shrink: 0;
  line-height: 1;
}
.geo-foreign-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  background: color-mix(in srgb, #fff 88%, var(--brand-paper));
  color: var(--brand-primary-deep);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.geo-foreign-pill:hover {
  border-color: color-mix(in srgb, var(--brand-accent) 45%, var(--line));
  background: color-mix(in srgb, var(--brand-accent) 10%, white);
}
.geo-foreign-pill.is-active,
.geo-foreign-pill[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--brand-accent) 55%, var(--line));
  background: color-mix(in srgb, var(--brand-accent) 18%, white);
  color: var(--brand-accent-ink);
}
.member-form .geo-birth-host,
.member-form .geo-birth-host .geo-birth-place,
.member-form .geo-birth-host .member-geo-birth {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.member-form .member-geo-birth .geo-foreign-inline,
.member-form .geo-address-member .geo-foreign-inline {
  margin: 0;
}
.member-form .geo-address-member {
  width: 100%;
  gap: 0.85rem;
}
.member-form .geo-address-member.geo-layout-rows .geo-address-row,
.member-form .geo-address-member.geo-layout-rows .setup-address-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(5.5rem, 1fr);
  gap: 0.85rem;
  align-items: start;
  width: 100%;
}
.member-form .geo-address-member .setup-field-grow .geo-field-label-row--split {
  overflow: hidden;
}
.member-form .geo-address-member .setup-field,
.member-form .geo-address-member .setup-field input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.member-form .geo-address-member .setup-field-cap,
.member-form .geo-address-member .setup-field-num {
  max-width: none;
}
.member-field-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
  min-width: 0;
}
.member-field-row.is-full {
  grid-template-columns: 1fr;
}
.member-field-row > .field-block,
.member-field-row > .geo-address,
.member-field-row .geo-address {
  min-width: 0;
}
.member-field-row .field-block input,
.member-field-row .field-block select,
.member-field-row .field-block textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.member-form .member-field-row--identity-names > .field-block,
.member-form .member-field-row--identity-meta > .field-block,
.member-form .member-field-row--identity-meta > .field-block--gender,
.member-form .member-field-row--identity-meta > .field-block--language {
  width: auto;
  min-width: 0;
  max-width: none;
  margin-left: 0;
  flex: none;
}
.member-form .member-field-row--identity-meta > .field-block--gender select,
.member-form .member-field-row--identity-meta > .field-block--language select {
  width: 100%;
  max-width: 100%;
}
.member-field-row .cf-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
}
.member-field-row .cf-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.member-field-row .cf-row .btn {
  flex: 0 0 auto;
}
.member-form .member-field-row--fiscal .cf-row,
.member-form .member-field-row--birth-fiscal .cf-row {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.member-form .member-field-row--fiscal .cf-row input[data-fiscal-code],
.member-form .member-field-row--fiscal .cf-row input,
.member-form .member-field-row--birth-fiscal .cf-row input[data-fiscal-code],
.member-form .member-field-row--birth-fiscal .cf-row input {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-bottom: 0;
  box-sizing: border-box;
}
.member-form .member-field-row--fiscal .cf-row .setup-input-validity,
.member-form .member-field-row--birth-fiscal .cf-row .setup-input-validity {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
}
.member-form .member-field-row--fiscal .cf-row .setup-input-validity > input,
.member-form .member-field-row--birth-fiscal .cf-row .setup-input-validity > input {
  width: 100% !important;
  min-width: 0 !important;
}
.member-form .member-field-row--fiscal .cf-row .btn,
.member-form .member-field-row--birth-fiscal .cf-row .btn {
  flex: 0 0 auto !important;
  width: auto !important;
  white-space: nowrap;
}
.member-form .member-geo-birth {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  width: 100%;
  min-width: 0;
}
.member-form .member-geo-birth input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.geo-address-row-inline {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(4.5rem, 6rem) minmax(5rem, 7rem) !important;
}
@media (max-width: 960px) {
  .member-field-row:not(.member-field-row--identity-names):not(.member-field-row--identity-meta):not(.member-field-row--contact):not(.member-field-row--birth) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .member-form .member-field-row--birth-fiscal {
    flex-wrap: wrap;
  }
  .member-form .member-field-row--birth-fiscal > .field-block--birth-date {
    flex: 0 0 auto;
    width: auto;
  }
  .member-form .member-field-row--birth-fiscal > .geo-birth-host {
    flex: 0 0 16rem;
    width: 16rem;
    min-width: 16rem;
    max-width: 16rem;
  }
  .member-form .member-field-row--birth-fiscal > .field-block[data-field="fiscal_code"] {
    flex: 1 1 14rem;
    width: auto;
    max-width: none;
  }
  .geo-address-row-inline {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 640px) {
  .member-field-row,
  .member-field-row.is-full,
  .member-field-row--identity-names,
  .member-field-row--identity-meta,
  .member-form .member-field-row--identity-names,
  .member-form .member-field-row--identity-meta,
  .member-form .member-field-row--birth,
  .member-form .member-field-row--contact,
  .member-field-row--contact,
  .member-field-row--birth,
  .member-form .geo-address-member.geo-layout-rows .geo-address-row,
  .member-form .geo-address-member.geo-layout-rows .setup-address-row {
    grid-template-columns: 1fr !important;
  }
  .member-form .field-block--birth-date {
    max-width: none;
  }
  .member-form .member-field-row--birth-fiscal {
    display: grid;
    grid-template-columns: 1fr !important;
  }
  .member-form .member-field-row--birth-fiscal > .field-block--birth-date,
  .member-form .member-field-row--birth-fiscal > .field-block[data-field="fiscal_code"],
  .member-form .member-field-row--birth-fiscal > .geo-birth-host {
    flex: none;
    width: 100%;
    max-width: none;
  }
  .member-form .member-field-row--fiscal .cf-row,
  .member-form .member-field-row--birth-fiscal .cf-row {
    flex-wrap: wrap;
  }
  .member-form .member-field-row--fiscal .cf-row input[data-fiscal-code],
  .member-form .member-field-row--fiscal .cf-row input,
  .member-form .member-field-row--birth-fiscal .cf-row input[data-fiscal-code],
  .member-form .member-field-row--birth-fiscal .cf-row input,
  .member-field-row--fiscal .cf-row input {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
  .member-form .member-field-row--fiscal .cf-row .btn,
  .member-form .member-field-row--birth-fiscal .cf-row .btn,
  .member-field-row--fiscal .cf-row .btn {
    width: 100%;
  }
  .geo-address-row-inline {
    grid-template-columns: 1fr !important;
  }
}
.photo-field { margin-bottom: 0.5rem; max-width: min(100%, 22rem); }
.member-form .photo-field {
  max-width: min(100%, 22rem);
}
.photo-upload {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  flex-wrap: nowrap;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  width: 100%;
  max-width: 22rem;
}
.photo-upload--card {
  flex-direction: column;
  align-items: stretch;
  max-width: none;
  gap: 0.45rem;
}
.photo-upload--card .photo-preview-btn,
.photo-upload--card .photo-placeholder,
.photo-upload--card .photo-preview {
  width: 6.75rem;
  max-width: 100%;
  aspect-ratio: 1;
  height: auto;
  min-height: 0;
  margin-inline: auto;
}
.photo-upload--card .photo-preview-btn {
  width: 6.75rem;
}
.photo-upload--card .photo-controls {
  width: 100%;
  gap: 0.25rem;
}
.photo-upload--card .photo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}
.photo-upload--card .photo-actions .btn,
.photo-upload--card .photo-actions .file-btn {
  width: 100%;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
}
.photo-upload--card [data-photo-hint] {
  font-size: 0.75rem;
  line-height: 1.25;
  margin: 0;
}
.photo-preview-btn {
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  flex-shrink: 0;
  border-radius: 14px;
  line-height: 0;
}
.photo-preview-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-primary) 45%, white);
  outline-offset: 2px;
}
.photo-preview, .photo-placeholder {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--brand-primary) 10%, white);
  border: 1px solid var(--line);
}
.photo-lightbox {
  border: 0;
  padding: 0;
  margin: auto;
  max-width: min(92vw, 42rem);
  background: transparent;
}
.photo-lightbox::backdrop {
  background: color-mix(in srgb, var(--brand-primary-deep) 55%, transparent);
  backdrop-filter: blur(3px);
}
.photo-lightbox-shell {
  position: relative;
  padding: 0.75rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.photo-lightbox-img {
  display: block;
  width: 100%;
  max-height: min(78vh, 36rem);
  object-fit: contain;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-primary) 6%, white);
}
.photo-lightbox-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, #000 55%, transparent);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-close:hover {
  background: color-mix(in srgb, #000 72%, transparent);
}
.photo-placeholder {
  position: relative;
  overflow: hidden;
  background-color: #dcdfe4;
  background-image: none;
}
.photo-ph-layer {
  position: absolute;
  inset: 0;
  display: block;
  background-color: #dcdfe4;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.55s ease, transform 0.55s ease;
  pointer-events: none;
  z-index: 1;
  will-change: opacity, transform;
}
.photo-ph-layer.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .photo-ph-layer {
    transition: none;
    transform: none;
  }
  .photo-ph-layer.is-active {
    transform: none;
  }
}
.photo-controls {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.photo-controls .photo-actions {
  margin-bottom: 0;
}
.photo-controls .muted,
.photo-controls [data-photo-hint] {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  max-width: 12rem;
}
.photo-controls input[type="file"] {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.member-photo-hero {
  margin: 0 0 1.25rem;
}
.member-photo-hero img {
  width: 120px;
  height: 120px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

/* —— Standard field modules (.sf-field) —— */
.sf-field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  margin-bottom: 0.25rem;
}
.sf-field__label,
.sf-field .field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-weight: 700;
  color: var(--brand-primary-deep);
}
.sf-field__control,
.sf-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.sf-field select,
.sf-field textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.sf-field__hint {
  margin: 0;
  font-size: 0.86rem;
}
.sf-field--checkbox,
.sf-field--radio {
  gap: 0.35rem;
}
.sf-field__radio-list {
  display: grid;
  gap: 0.35rem;
}
.sf-field__choice-cards {
  margin-top: 0.15rem;
}
.sf-field--filter {
  margin-bottom: 0;
}
.sf-field--inline {
  display: inline-grid;
  margin-bottom: 0;
}
.sf-field--photo {
  gap: 0.45rem;
}
.setup-field.sf-field {
  margin-bottom: 0.75rem;
}

.member-form .field-block {
  margin-bottom: 0.25rem;
}
.member-form .field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}
.field-icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  background: var(--brand-primary);
  mask: no-repeat center / contain;
  -webkit-mask: no-repeat center / contain;
  opacity: 0.9;
}
.field-icon[data-icon="camera"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 8h3l2-2h6l2 2h3v12H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 8h3l2-2h6l2 2h3v12H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.field-icon[data-icon="upload"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 16V5'/%3E%3Cpath d='M8 9l4-4 4 4'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 16V5'/%3E%3Cpath d='M8 9l4-4 4 4'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E"); }
.field-icon[data-icon="user"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 19c1.8-3.2 4-4.5 7-4.5s5.2 1.3 7 4.5'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 19c1.8-3.2 4-4.5 7-4.5s5.2 1.3 7 4.5'/%3E%3C/svg%3E"); }
.field-icon[data-icon="users"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Ccircle cx='17' cy='9' r='2.5'/%3E%3Cpath d='M3 19c1.5-2.8 3.4-4 6-4s4.5 1.2 6 4'/%3E%3Cpath d='M14 19c.8-1.6 1.9-2.4 3.5-2.4 1.2 0 2.2.5 3 1.4'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Ccircle cx='17' cy='9' r='2.5'/%3E%3Cpath d='M3 19c1.5-2.8 3.4-4 6-4s4.5 1.2 6 4'/%3E%3Cpath d='M14 19c.8-1.6 1.9-2.4 3.5-2.4 1.2 0 2.2.5 3 1.4'/%3E%3C/svg%3E"); }
.field-icon[data-icon="map-pin"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s7-5.2 7-11a7 7 0 1 0-14 0c0 5.8 7 11 7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s7-5.2 7-11a7 7 0 1 0-14 0c0 5.8 7 11 7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E"); }
.field-icon[data-icon="calendar"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.field-icon[data-icon="hash"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 4l-2 16M17 4l-2 16M4 9h16M3 15h16'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 4l-2 16M17 4l-2 16M4 9h16M3 15h16'/%3E%3C/svg%3E"); }
.field-icon[data-icon="building"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 21V5l8-2 8 2v16'/%3E%3Cpath d='M9 21v-6h6v6M9 9h.01M15 9h.01M9 13h.01M15 13h.01'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 21V5l8-2 8 2v16'/%3E%3Cpath d='M9 21v-6h6v6M9 9h.01M15 9h.01M9 13h.01M15 13h.01'/%3E%3C/svg%3E"); }
.field-icon[data-icon="home"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 11l8-7 8 7v9a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 11l8-7 8 7v9a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.field-icon[data-icon="mail"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 7 9-7'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 7 9-7'/%3E%3C/svg%3E"); }
.field-icon[data-icon="at"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Cpath d='M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7.1'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Cpath d='M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7.1'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.field-icon[data-icon="phone"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M7 3h3l1 4-2 1a12 12 0 0 0 5 5l1-2 4 1v3a2 2 0 0 1-2 2A14 14 0 0 1 5 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M7 3h3l1 4-2 1a12 12 0 0 0 5 5l1-2 4 1v3a2 2 0 0 1-2 2A14 14 0 0 1 5 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); }
.field-icon[data-icon="spark"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5z'/%3E%3C/svg%3E"); }
.field-icon[data-icon="globe"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.8 3.8 5.8 3.8 9S14.5 18.2 12 21c-2.5-2.8-3.8-5.8-3.8-9S9.5 5.8 12 3z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.8 3.8 5.8 3.8 9S14.5 18.2 12 21c-2.5-2.8-3.8-5.8-3.8-9S9.5 5.8 12 3z'/%3E%3C/svg%3E"); }
.field-icon[data-icon="doc"] { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M7 3h7l5 5v13H7z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M7 3h7l5 5v13H7z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E"); }
.btn .field-icon { background: currentColor; }
.field-hint { margin: -0.55rem 0 0.85rem; font-size: 0.86rem; min-height: 1.1em; }
[data-camera-error]:not([hidden]) {
  color: var(--danger);
  margin: 0.15rem 0 0;
}
.input-emphasis {
  border-color: color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--brand-paper) 55%, white));
}
.input-valid { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)) !important; }
.input-invalid { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)) !important; }
.field-hint.is-error { color: var(--danger); font-weight: 600; }

.password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.password-input-wrap input[type="password"],
.password-input-wrap input[type="text"] {
  width: 100%;
  padding-right: 2.85rem;
  margin-bottom: 0;
  box-sizing: border-box;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
  outline: none;
}
.password-toggle-icon--hide { display: none; }
.password-toggle.is-visible .password-toggle-icon--show { display: none; }
.password-toggle.is-visible .password-toggle-icon--hide { display: block; }
.password-field--bare {
  display: block;
  margin-bottom: 0.95rem;
}
.password-field--bare .password-input-wrap input {
  margin-bottom: 0;
}
.password-field {
  display: grid;
  gap: 0.45rem;
}
.password-field > span:first-child {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}
.setup-field.password-field > span:first-child {
  font-weight: 600;
  color: inherit;
  font-size: inherit;
}
.setup-equal-row .password-field .password-input-wrap,
.setup-equal-row .password-field .password-input-wrap input {
  min-width: 0;
  width: 100%;
}
.cf-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: start;
}
.cf-row input { margin-bottom: 0.35rem; }
.suggest-wrap { position: relative; }
.suggest-wrap.is-loading input,
.suggest-wrap.is-loading .setup-input-validity > input {
  padding-right: 2.7rem;
}
.suggest-spinner {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -0.575rem;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--brand-primary) 25%, #d5ddd9);
  border-top-color: var(--brand-primary);
  display: none;
  pointer-events: none;
  z-index: 3;
  animation: setup-scrape-spin 0.7s linear infinite;
}
.suggest-wrap.is-loading .suggest-spinner {
  display: block;
}
.suggest-status {
  padding: 0.8rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
}
.suggest-status.is-loading {
  color: var(--brand-primary-deep);
}
.suggest-status.is-empty {
  color: color-mix(in srgb, #9a5b00 75%, var(--ink));
}
.suggest-list button.is-disabled,
.suggest-list button:disabled {
  opacity: 0.75;
  cursor: default;
  font-weight: 650;
  color: var(--muted);
}
.suggest-field,
.geo-field.suggest-field {
  position: relative;
  z-index: 1;
}
.suggest-field:focus-within,
.suggest-field.is-open,
.geo-field.suggest-field:focus-within,
.geo-field.suggest-field.is-open {
  z-index: 120;
}
.suggest-list {
  position: absolute;
  z-index: 130;
  left: 0; right: 0; top: calc(100% + 0.2rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
}
.suggest-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.75rem 0.9rem;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}
.suggest-list button:hover,
.suggest-list button.active {
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
}
.geo-force-panel {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #c47a12 45%, var(--line));
  background: color-mix(in srgb, #f0a202 10%, #fffaf0);
}
.geo-force-panel[hidden] {
  display: none !important;
}
.geo-force-panel.is-forced {
  border-color: color-mix(in srgb, #1a7a3c 40%, var(--line));
  background: color-mix(in srgb, #1a7a3c 8%, #fff);
}
.geo-inline-warn {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 600;
  color: color-mix(in srgb, #9a5b00 80%, var(--ink));
}
.geo-force-panel.is-forced .geo-inline-warn {
  color: color-mix(in srgb, #1a7a3c 70%, var(--ink));
}
.geo-force-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.geo-force-actions .btn {
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  border: 1px solid color-mix(in srgb, #c47a12 35%, var(--line));
  background: #fff;
  color: color-mix(in srgb, #9a5b00 70%, var(--ink));
}
.geo-force-actions .btn:hover {
  background: color-mix(in srgb, #f0a202 12%, #fff);
  color: inherit;
}
input.is-geo-forced,
.setup-field input.is-geo-forced {
  border-color: color-mix(in srgb, #c47a12 55%, var(--line)) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, #f0a202 18%, transparent);
}
.photo-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.45rem; }
.file-btn {
  cursor: pointer;
  position: relative;
}
.camera-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: min(560px, 94vw);
  width: 100%;
  background: transparent;
  overflow: visible;
}
.camera-dialog::backdrop {
  background: color-mix(in srgb, var(--brand-primary-deep) 50%, transparent);
  backdrop-filter: blur(4px);
}
.camera-shell {
  background: var(--card);
  border: 0;
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.camera-shell video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-primary) 82%, black);
  margin: 0.75rem 0 1rem;
}
.form-actions { margin-top: 0.5rem; }

.member-wizard {
  position: relative;
  overflow: visible;
}
.wizard-steps {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.member-wizard[data-total-steps="2"] .wizard-steps,
.member-wizard[data-total-steps="3"] .wizard-steps {
  grid-template-columns: unset;
}
.wizard-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.wizard-step.is-active,
.wizard-step.is-done {
  opacity: 1;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.wizard-step.is-active {
  transform: none;
}
.wizard-index {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  color: var(--brand-primary-deep);
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
}
.wizard-step.is-active .wizard-index,
.wizard-step.is-done .wizard-index {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.wizard-copy {
  display: none;
}
.wizard-copy strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.wizard-copy small {
  color: var(--muted);
  font-size: 0.82rem;
}
.wizard-progress {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  margin: 0 0 1.35rem;
  overflow: hidden;
}
.wizard-progress span {
  display: block;
  height: 100%;
  width: 33.333%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: inherit;
  transition: width 0.35s ease;
}
.wizard-panel[hidden] { display: none !important; }
.wizard-panel.is-active {
  animation: wizard-in 0.28s ease;
}
@keyframes wizard-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.wizard-panel-head { margin-bottom: 1rem; }
.wizard-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15.5rem, 17.5rem);
  gap: 1.1rem 1.35rem;
  align-items: start;
  width: 100%;
}
.wizard-panel-main {
  min-width: 0;
  width: 100%;
}
.wizard-panel-side {
  position: sticky;
  top: 1rem;
  width: 100%;
  min-width: 0;
}
.wizard-panel-side--spacer {
  visibility: hidden;
  pointer-events: none;
  min-height: 1px;
}
.wizard-panel-body--tessera .wizard-panel-side,
.wizard-panel-body--photo .wizard-panel-side {
  visibility: visible;
  pointer-events: auto;
}
.wizard-panel-side--photo .member-profile-block--photo-side {
  margin: 0;
}
.wizard-panel-side--photo .photo-upload--card {
  gap: 0.65rem;
}
.wizard-panel-side--photo .photo-upload--card .photo-preview-btn,
.wizard-panel-side--photo .photo-upload--card .photo-placeholder,
.wizard-panel-side--photo .photo-upload--card .photo-preview {
  width: 100%;
  max-width: none;
  max-height: none;
  min-height: 12rem;
  aspect-ratio: 1;
  margin-inline: 0;
}
.wizard-panel-side--photo .photo-upload--card .photo-actions .btn,
.wizard-panel-side--photo .photo-upload--card .photo-actions .file-btn {
  min-height: 2.35rem;
  font-size: 0.88rem;
}
@media (max-width: 900px) {
  .wizard-panel-body {
    grid-template-columns: 1fr;
  }
  .wizard-panel-side--spacer {
    display: none;
  }
  .wizard-panel-body--tessera .wizard-panel-side,
  .wizard-panel-body--photo .wizard-panel-side {
    order: -1;
    position: static;
    width: min(100%, 17.5rem);
    margin: 0 auto;
  }
}
.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.wizard-actions-right {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.wizard-error {
  margin: 0.75rem 0 0;
  color: var(--danger);
}
.tessera-step-layout {
  display: flow-root;
}
.tessera-preview,
.wizard-panel-side.tessera-preview {
  float: none;
  width: 100%;
  margin: 0;
  perspective: 960px;
}
.tessera-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.586 / 1;
  border-radius: 14px;
  transform: rotateY(-8deg) rotateX(5deg) translateZ(0);
  transform-style: preserve-3d;
  box-shadow:
    0 1px 0 color-mix(in srgb, white 22%, transparent) inset,
    0 -1px 0 color-mix(in srgb, black 35%, transparent) inset,
    0 8px 14px color-mix(in srgb, black 18%, transparent),
    0 22px 36px color-mix(in srgb, var(--brand-primary-deep) 35%, transparent),
    0 36px 56px color-mix(in srgb, black 16%, transparent);
  overflow: hidden;
  isolation: isolate;
}
.tessera-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--brand-primary) 88%, white), var(--brand-primary-deep) 55%, color-mix(in srgb, var(--brand-primary-deep) 70%, #000));
}
.tessera-card-mark {
  position: absolute;
  right: -8%;
  bottom: -18%;
  width: 78%;
  height: 92%;
  z-index: 0;
  background-image: var(--tessera-logo);
  background-repeat: no-repeat;
  background-position: center right;
  background-size: contain;
  opacity: 0.18;
  filter: grayscale(0.15) contrast(1.05);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.tessera-card-shine {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, color-mix(in srgb, white 28%, transparent) 0%, transparent 38%, transparent 62%, color-mix(in srgb, var(--brand-accent) 22%, transparent) 100%);
  mix-blend-mode: soft-light;
  z-index: 2;
}
.tessera-card-face {
  position: relative;
  z-index: 3;
  height: 100%;
  padding: 0.7rem 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: color-mix(in srgb, var(--brand-paper) 94%, white);
}
.tessera-card-top {
  display: flex;
  align-items: flex-start;
  min-height: 1.7rem;
}
.tessera-brand {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
  min-width: 0;
  max-width: 100%;
}
.tessera-brand .assoc-lockup-tessera,
.tessera-brand .assoc-lockup {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  gap: 0.12rem !important;
  max-width: 100%;
  white-space: normal !important;
}
.tessera-brand .assoc-name {
  display: block !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.15;
  color: inherit;
}
.tessera-brand .assoc-legal {
  display: block !important;
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.78;
  line-height: 1.2;
  white-space: normal !important;
  max-width: 100%;
}
.tessera-brand .tessera-mark {
  height: 1.25rem;
  max-width: 7.5rem;
  object-fit: contain;
}
.tessera-card-main {
  display: grid;
  grid-template-columns: 4.35rem 1fr;
  gap: 0.65rem;
  align-items: end;
  flex: 1;
  min-height: 0;
}
.tessera-photo {
  width: 4.35rem;
  height: 5.1rem;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(160deg, color-mix(in srgb, white 18%, transparent), color-mix(in srgb, black 22%, transparent));
  border: 1px solid color-mix(in srgb, white 28%, transparent);
  box-shadow: 0 4px 10px color-mix(in srgb, black 28%, transparent);
  flex-shrink: 0;
}
.tessera-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tessera-photo-img[hidden] {
  display: none !important;
}
.tessera-photo-placeholder {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  opacity: 0.95;
  overflow: hidden;
}
.tessera-photo-placeholder .photo-ph-layer {
  background-position: center bottom;
  background-size: cover;
}
.guardian-required-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #9b1c48;
  background: color-mix(in srgb, var(--brand-primary, #e11d74) 16%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary, #e11d74) 45%, #fff);
}
.is-guardian-required [data-guardian-select] {
  border-color: color-mix(in srgb, var(--brand-primary, #e11d74) 70%, #c4c4c4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #e11d74) 18%, transparent);
}
.payment-treasury-note {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}
.tessera-photo-placeholder[hidden] {
  display: none !important;
}
.tessera-photo.is-empty {
  opacity: 0.85;
}
.tessera-meta {
  text-align: left;
  display: grid;
  gap: 0.14rem;
  align-content: end;
  min-width: 0;
  padding-bottom: 0.1rem;
}
.tessera-name {
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  opacity: 0.92;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tessera-number {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.1;
}
.tessera-type {
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  opacity: 0.95;
}
.tessera-type strong {
  font-weight: 800;
}
.tessera-step-fields {
  display: grid;
  gap: 0.95rem;
}
.tessera-step-fields .grid-2 {
  margin: 0;
}
.member-field-row--tessera-meta {
  display: grid;
  grid-template-columns:
    minmax(5.5rem, 6.75rem)
    minmax(7.5rem, 0.9fr)
    minmax(9.5rem, 1.35fr)
    minmax(7.5rem, 0.95fr);
  gap: 0.75rem;
  align-items: start;
  width: 100%;
}
.member-field-row--tessera-meta > .field-block {
  min-width: 0;
  margin-bottom: 0;
}
.member-field-row--tessera-meta .field-block--member-number input {
  width: 100%;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: center;
}
.tessera-payment-panel {
  display: grid;
  gap: 0.95rem;
}
.member-profile-block.payment-summary {
  margin: 0;
}
.tessera-choice-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.tessera-choice-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.75rem 0.55rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.tessera-choice-card > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tessera-choice-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 11px;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 10%, white);
}
.tessera-choice-card-title {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.tessera-choice-card:hover {
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, transparent);
}
.tessera-choice-card.is-selected,
.tessera-choice-card:has(> input:checked) {
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 48%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 20%, transparent);
}
.tessera-choice-card.is-selected .tessera-choice-card-title,
.tessera-choice-card:has(> input:checked) .tessera-choice-card-title {
  color: var(--brand-primary-deep);
}
.tessera-partial-amount {
  max-width: 14rem;
}
.guardian-search {
  margin-bottom: 0.45rem;
}
.guardian-quick {
  margin-top: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem 0.65rem;
  background: color-mix(in srgb, #fff 90%, var(--brand-paper));
}
.guardian-quick > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand-primary-deep);
  padding: 0.35rem 0;
}
.guardian-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  margin-top: 0.45rem;
}
@media (max-width: 560px) {
  .guardian-quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .tessera-card {
    transform: rotateY(-4deg) rotateX(3deg);
  }
  .member-field-row--tessera-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .member-field-row--tessera-meta .field-block--member-number {
    max-width: 8rem;
  }
}
@media (max-width: 560px) {
  .member-field-row--tessera-meta,
  .tessera-choice-cards {
    grid-template-columns: 1fr;
  }
  .member-field-row--tessera-meta .field-block--member-number {
    max-width: none;
  }
}
.payment-summary {
  display: grid;
  gap: 0.95rem;
  margin: 0;
}
.member-profile-block.payment-summary {
  border-color: color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  background:
    radial-gradient(110% 80% at 100% 0%, color-mix(in srgb, var(--brand-primary) 10%, transparent), transparent 55%),
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--brand-primary) 6%, #fff) 0%,
      color-mix(in srgb, var(--brand-paper, #f7f3f0) 70%, #fff) 100%
    );
  color: var(--ink);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-primary-deep, #7a1048) 8%, transparent);
}
.payment-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  min-width: 0;
}
.payment-summary-titles {
  display: grid;
  gap: 0.2rem;
  flex: 1 1 12rem;
  min-width: 0;
}
.payment-summary-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 55%, var(--brand-primary));
}
.payment-summary-type {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--brand-primary-deep, var(--ink));
}
.payment-summary-status {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.payment-summary-status[hidden] {
  display: none !important;
}
.payment-summary-status.is-paid {
  background: color-mix(in srgb, var(--ok) 14%, white);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
}
.payment-summary-status.is-partial {
  background: color-mix(in srgb, var(--brand-accent, #e8a317) 16%, white);
  color: var(--brand-accent-ink, #7a4a00);
  border: 1px solid color-mix(in srgb, var(--brand-accent, #e8a317) 36%, transparent);
}
.payment-summary-status.is-unpaid {
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  color: var(--brand-primary-deep, #9b1c48);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 32%, transparent);
}
.payment-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.payment-summary-metric {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
.payment-summary-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
}
.payment-summary-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}
.payment-summary-metric--paid .payment-summary-value {
  color: var(--ok);
}
.payment-summary-metric--due {
  background: color-mix(in srgb, var(--brand-accent, #e8a317) 10%, #fff);
  border-color: color-mix(in srgb, var(--brand-accent, #e8a317) 34%, var(--line));
}
.payment-summary-metric--due .payment-summary-value.stat-negative {
  color: var(--brand-accent-ink, #7a4a00);
}
.payment-summary-metric--due.is-settled {
  background: color-mix(in srgb, var(--ok) 8%, #fff);
  border-color: color-mix(in srgb, var(--ok) 28%, var(--line));
}
.payment-summary-metric--due .payment-summary-value.stat-positive {
  color: var(--ok);
}
.payment-summary-method {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: color-mix(in srgb, var(--ink) 72%, var(--brand-primary));
}
.payment-summary-method[hidden] {
  display: none !important;
}

@media (max-width: 960px) {
  .wizard-actions, .wizard-actions-right { width: 100%; }
  .wizard-actions-right .btn, .wizard-actions > .btn { flex: 1 1 auto; }
  .payment-summary-metrics { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) and (min-width: 961px) {
  .payment-summary-metrics { grid-template-columns: 1fr; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(-4%, 3%, 0) scale(1.05); }
}

/* Progressive page enter — enabled by JS (html.enter-anim) when motion is OK */
html.enter-anim .will-enter:not(.is-entered) {
  opacity: 0;
  transform: translateY(14px);
}
html.enter-anim .will-enter.is-entered {
  animation: rise 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--enter-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  html.enter-anim .will-enter:not(.is-entered),
  html.enter-anim .will-enter.is-entered {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* —— Responsive / corporate mobile shell —— */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .cf-row { grid-template-columns: 1fr; }
  .photo-actions .btn { width: 100%; }

  .topbar {
    padding: 0.35rem 0.9rem;
  }
  .topbar-menu {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }
  .topbar-menu-bars,
  .topbar-menu-bars::before,
  .topbar-menu-bars::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: var(--brand-primary-deep);
    border-radius: 2px;
    position: relative;
  }
  .topbar-menu-bars::before,
  .topbar-menu-bars::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .topbar-menu-bars::before { top: -6px; }
  .topbar-menu-bars::after { top: 6px; }
  .topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .topbar-brand .assoc-lockup-topbar {
    display: none !important;
  }
  .topbar-mark {
    height: 1.85rem;
    max-width: min(42vw, 9.5rem);
    width: auto;
    object-fit: contain;
  }
  .topbar-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
    padding: 3px;
    flex-shrink: 0;
    box-shadow: var(--shadow-soft);
  }
  .topbar-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
  }
  .topbar-product {
    font-family: var(--font-display);
    color: var(--brand-socly);
    font-size: 1.05rem;
  }
  .topbar-assoc {
    color: var(--brand-accent-ink);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55vw;
  }
  .page-title-brand {
    flex-wrap: wrap;
  }
  .page-title-brand .title-lead-desktop,
  .page-title-brand .assoc-lockup-title {
    display: none !important;
  }
  .page-title-brand .title-lead-mobile {
    display: inline;
  }
  .page-header .titles {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .page-lede {
    max-width: 100%;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: color-mix(in srgb, var(--brand-primary-deep) 48%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: min(20rem, 88vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .app-shell.is-nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 24px 0 48px rgba(0, 0, 0, 0.28);
  }
  .app-shell.is-nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .app-shell.is-nav-open {
    overflow: hidden;
  }
  body.nav-open {
    overflow: hidden;
  }

  .main {
    padding: 1rem 0.95rem 1.75rem;
  }
  .panel, .form-card {
    padding: 1.1rem 1rem;
    border-radius: 16px;
  }
  .page-header {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 1.1rem;
  }
  .page-header .actions {
    width: 100%;
  }
  .page-header .actions .btn {
    flex: 1 1 auto;
  }
  .page-title {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }
  .stat .value {
    font-size: 1.45rem;
    word-break: break-word;
  }
  .chart-frame { height: 240px; }
  .chart-frame-donut { height: 220px; }

  .grid-2, .grid-3, .detail-grid {
    grid-template-columns: 1fr;
  }

  .auth-main {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .auth-brand {
    min-height: auto;
    padding: 0.95rem 1.1rem 0.75rem;
    justify-content: flex-start;
    gap: 0;
  }
  .auth-mark {
    height: 2.85rem;
    max-width: min(100%, 11.5rem);
    margin: 0 0 0.45rem;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.22));
  }
  .auth-assoc-logo {
    max-width: min(100%, 7.5rem);
    max-height: 3.25rem;
    margin: 0 0 0.55rem;
    padding: 0.35rem;
    border-radius: 10px;
  }
  .auth-product {
    margin: 0 0 0.25rem;
    gap: 0.2rem;
  }
  .auth-product-line {
    font-size: 1.05rem;
    line-height: 1.2;
  }
  .auth-motto {
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.3;
  }
  .auth-news-slot,
  .auth-setup-prep {
    display: none;
  }
  .auth-desc,
  .auth-brand-meta {
    display: none;
  }
  .auth-setup-prep-lede {
    display: none;
  }
  .auth-panel {
    padding: 0.85rem 1rem 1.1rem;
    align-items: flex-start;
  }
  .auth-card {
    padding: 1.15rem 1.1rem 1.25rem;
    border-radius: 18px;
  }
  .auth-lang {
    margin: 0 0 1rem;
    padding: 0.75rem 0.85rem 0.85rem;
  }
  .auth-lang-rotate {
    margin: 0 0 0.55rem;
    min-height: 1.55rem;
  }
  .auth-lang-rotate-item {
    font-size: 1.05rem;
  }
  .auth-card .lede {
    margin: 0 0 0.95rem;
    font-size: 0.92rem;
  }
  .auth-links { flex-direction: column; align-items: flex-start; }
  .auth-footer {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.72rem;
    line-height: 1.25;
  }
  .auth-footer-assoc,
  .auth-footer-meta {
    display: none;
  }
  .auth-footer-version {
    display: inline;
  }
  .auth-footer-brand,
  .auth-footer nav {
    min-width: 0;
    white-space: nowrap;
  }
  .auth-footer nav {
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
  }
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .install-wrap { padding: 1rem; }
  .nav a:hover, .nav a.active { transform: none; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  /* Mobile: solo i 3 KPI prioritari (primi 3 nella griglia) */
  .stats .stat:nth-child(n + 4) { display: none; }
  /* Mobile: un solo grafico (il primario del contesto) */
  .charts .chart-panel:not(.chart-panel-primary) { display: none; }
  [data-photo-hint] { display: none; }
  .stat { padding: 1rem 1.05rem; }
  table { min-width: 30rem; }
  th, td { padding: 0.75rem 0.7rem; font-size: 0.92rem; }
  .filter-bar .panel-header {
    flex-direction: column;
  }
  .filter-bar .panel-header .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .topbar-assoc { max-width: 42vw; }
  .sidebar-lockup .product { font-size: 1.15rem; }
  .main .page-header .actions,
  .main .panel-header .actions {
    width: 100%;
  }
  .main .page-header .actions .btn,
  .main .panel-header .actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* —— Setup wizard —— */
html:has(.setup-body) {
  height: 100%;
  overflow: hidden;
}
.setup-body {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 10% -10%, color-mix(in srgb, var(--brand-primary) 22%, transparent), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, color-mix(in srgb, var(--brand-accent) 18%, transparent), transparent 55%),
    linear-gradient(165deg, var(--brand-paper), color-mix(in srgb, var(--brand-primary) 8%, white) 45%, color-mix(in srgb, var(--brand-accent) 6%, white));
}
.setup-page {
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}
.setup-shell {
  display: grid;
  place-items: center;
  align-content: center;
  padding: 0.85rem 1.25rem 0.6rem;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.setup-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 100%;
}
.setup-stage {
  width: min(640px, 100%);
  max-height: 100%;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
/* Compact step header: leave more room to the scrollable form area. */
.setup-card.setup-step {
  padding: clamp(1rem, 2.4vw, 1.5rem);
}
.setup-card.setup-step .setup-title {
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  margin: 0.15rem 0 0.45rem;
}
.setup-card.setup-step .setup-copy {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  line-height: 1.42;
}
.setup-card.setup-step .setup-card-bar {
  margin-bottom: 0.3rem;
}
/* First-run empty lists: point the eye at the primary action (top right). */
@keyframes first-cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-primary) 42%, transparent); }
  55% { box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--brand-primary) 0%, transparent); }
}
.btn.is-first-cta {
  animation: first-cta-pulse 1.9s ease-out 4;
}
@media (prefers-reduced-motion: reduce) {
  .btn.is-first-cta { animation: none; }
}
.setup-ambient {
  position: absolute;
  inset: -18% -10%;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--brand-primary) 18%, transparent), transparent 55%),
    radial-gradient(circle at 78% 70%, color-mix(in srgb, var(--brand-accent) 14%, transparent), transparent 50%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
  animation: setup-ambient-drift 16s ease-in-out infinite alternate;
}
.setup-card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.88);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, var(--line));
  border-radius: 28px;
  padding: clamp(1.15rem, 3vw, 1.85rem);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--brand-primary) 14%, transparent);
  backdrop-filter: blur(10px);
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
}
.setup-card.setup-greeting,
.setup-card.setup-thanks {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand-primary) 45%, transparent) color-mix(in srgb, var(--line) 55%, transparent);
}
.setup-card.setup-greeting::-webkit-scrollbar,
.setup-card.setup-thanks::-webkit-scrollbar {
  width: 10px;
}
.setup-card.setup-greeting::-webkit-scrollbar-thumb,
.setup-card.setup-thanks::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand-primary) 45%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.setup-card.setup-greeting::-webkit-scrollbar-track,
.setup-card.setup-thanks::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 999px;
}
.setup-card > .setup-form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.setup-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  /* Always visible: visitors must see that there is more content below. */
  scrollbar-color: color-mix(in srgb, var(--brand-primary) 45%, transparent) color-mix(in srgb, var(--line) 55%, transparent);
  padding-right: 0.15rem;
  /* Room so the why-note can clear the soft bottom fade */
  padding-bottom: 1.75rem;
  /* Soft cue that more content may sit below the fold */
  mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 0.85rem), transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 0.85rem), transparent 100%);
}
.setup-form-scroll.is-at-bottom,
.setup-form-scroll:not(.is-scrollable) {
  mask-image: none;
  -webkit-mask-image: none;
}
.setup-form-scroll:hover,
.setup-form-scroll:focus-within {
  scrollbar-color: color-mix(in srgb, var(--brand-primary) 60%, transparent) color-mix(in srgb, var(--line) 55%, transparent);
}
.setup-form-scroll::-webkit-scrollbar {
  width: 10px;
}
.setup-form-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand-primary) 45%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.setup-form-scroll:hover::-webkit-scrollbar-thumb,
.setup-form-scroll:focus-within::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand-primary) 62%, transparent);
  background-clip: padding-box;
}
.setup-form-scroll::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 999px;
}
/* Explicit “there is more below” arrow: visible only while scrolling is possible. */
.setup-scroll-cue {
  display: none;
  justify-content: center;
  align-items: center;
  height: 2.15rem;
  margin: -0.2rem 0 0.15rem;
  color: var(--brand-primary-deep);
  pointer-events: none;
}
.setup-form-scroll.is-scrollable:not(.is-at-bottom) ~ .setup-scroll-cue {
  display: flex;
}
.setup-scroll-cue-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 34%, var(--line));
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  box-shadow: 0 0 0 0 transparent;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  will-change: opacity, transform, box-shadow;
  animation: setup-scroll-blink 1.7s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes setup-scroll-blink {
  0%, 100% {
    opacity: 0.22;
    transform: translateY(-0.18rem) scale(0.94);
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    opacity: 1;
    transform: translateY(0.2rem) scale(1.08);
    box-shadow:
      0 0 0 0.45rem color-mix(in srgb, var(--brand-primary) 14%, transparent),
      0 0 1.1rem color-mix(in srgb, var(--brand-primary) 28%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  /* No movement, but the arrow still blinks so it is noticed.
     !important is required because the global reduced-motion reset sets
     animation-duration/iteration-count with !important. */
  .setup-scroll-cue-arrow {
    animation: setup-scroll-blink-soft 1.8s ease-in-out infinite !important;
  }
  @keyframes setup-scroll-blink-soft {
    0%, 100% { opacity: 0.35; box-shadow: 0 0 0 0 transparent; }
    50% { opacity: 1; box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--brand-primary) 16%, transparent); }
  }
}
@keyframes setup-ambient-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  to { transform: translate3d(3%, -2%, 0) scale(1.06); opacity: 1; }
}
.setup-kicker {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 3.8rem);
  font-weight: 700;
  color: var(--brand-socly);
  margin: 0 0 1.1rem;
  letter-spacing: -0.045em;
  line-height: 1;
}
.setup-mark {
  display: block;
  height: clamp(4.2rem, 11vw, 5.8rem);
  width: auto;
  max-width: min(100%, 440px);
  object-fit: contain;
  object-position: left center;
}
.setup-hello {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
}
.setup-hello-main {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.7rem);
  letter-spacing: -0.02em;
  color: var(--brand-primary-deep);
  line-height: 1.2;
}
.setup-hello-sub {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  letter-spacing: -0.015em;
  color: var(--brand-accent-ink);
  line-height: 1.3;
}
.setup-thanks-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.8vw, 1.95rem);
  letter-spacing: -0.03em;
  color: var(--brand-primary-deep);
  line-height: 1.35;
  margin: 0 0 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28em;
  max-width: 100%;
  overflow: visible;
}
.setup-thanks-lead,
.setup-thanks-trail {
  color: var(--brand-primary-deep);
  flex: 0 0 auto;
  white-space: nowrap;
}
.assoc-lockup-thanks,
.assoc-lockup-setup-title {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: baseline;
  vertical-align: baseline;
  white-space: normal;
  gap: 0.28em;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  overflow: visible;
}
.assoc-lockup-thanks .assoc-name {
  display: inline !important;
  color: var(--brand-accent-ink);
  font-weight: 700;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}
.assoc-lockup-setup-title .assoc-name {
  display: inline-block !important;
  color: var(--brand-accent-ink);
  font-weight: 700;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: baseline;
  line-height: 1.25;
}
.assoc-lockup-thanks .assoc-legal,
.assoc-lockup-setup-title .assoc-legal {
  display: inline !important;
  color: var(--brand-accent-muted);
  opacity: 1;
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 !important;
  vertical-align: baseline !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
  white-space: nowrap;
  flex: 0 0 auto;
}
.setup-thanks-trail {
  white-space: normal;
}
.setup-thanks-copy {
  font-size: 1.08rem;
}
.socly-word {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.12em;
  letter-spacing: -0.04em;
  color: var(--brand-socly);
  text-transform: uppercase;
}
.auth-brand .socly-word {
  color: #6EB3E0;
  font-size: 1.15em;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.socly-word-footer {
  font-size: 1em;
  line-height: 1;
  vertical-align: baseline;
}
.setup-title {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  margin: 0.35rem 0 0.9rem;
  max-width: 100%;
  overflow: visible;
  line-height: 1.25;
}
.setup-title[data-setup-fit-title],
.setup-title-lockup {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2em 0.35em;
  width: 100%;
  overflow: visible;
  white-space: normal;
  line-height: 1.25;
  margin-bottom: 1rem;
}
.setup-title-prefix {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.25;
}
.setup-title[data-setup-fit-title] .assoc-lockup-setup-title,
.setup-title-lockup .assoc-lockup-setup-title {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  align-items: baseline;
  gap: 0.28em;
  line-height: 1.25;
}
.setup-title-lockup + .setup-copy,
.setup-title[data-setup-fit-title] + .setup-copy {
  margin-top: 0.15rem;
  clear: both;
}
.setup-copy {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
  margin: 0.15rem 0 1rem;
}
.setup-copy + .setup-copy-reassure {
  margin-top: -0.65rem;
  margin-bottom: 1rem;
  font-size: 0.98rem;
}
.setup-copy-reassure + .setup-copy-reassure {
  margin-top: -0.95rem;
  margin-bottom: 1.35rem;
  font-size: 0.98rem;
}
.setup-copy-reassure-strong {
  font-weight: 700;
  color: var(--ink);
}
.setup-copy-reassure-eta {
  font-style: normal;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
}
.setup-eta-highlight {
  font-style: normal;
  font-weight: 700;
  color: var(--brand-primary);
}
.setup-smtp {
  display: grid;
  gap: 1.5rem;
}
.setup-smtp .setup-hint {
  margin: 0;
  line-height: 1.55;
}
.setup-smtp-fields {
  display: grid;
  gap: 1.5rem;
}
.setup-smtp-section {
  display: grid;
  gap: 1rem;
}
.setup-smtp-fields[hidden],
.setup-smtp-section[hidden],
.setup-smtp-manual[hidden],
.setup-smtp-actions[hidden],
.setup-smtp [hidden] {
  display: none !important;
}
.setup-smtp-skip {
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--brand-primary) 6%, white);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.setup-smtp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.setup-smtp-status-ok,
.setup-smtp-feedback.setup-smtp-status-ok {
  color: #1b7a3d;
  font-weight: 650;
}
.setup-smtp-status-ok:not(:empty)::before,
.setup-smtp-feedback.setup-smtp-status-ok:not(:empty)::before {
  content: '✓ ';
}
.setup-smtp-status-pending {
  color: var(--muted);
  font-weight: 600;
}
.setup-smtp-feedback.is-error,
.setup-smtp-feedback.setup-hint-warn {
  color: #b42318;
  font-weight: 650;
}
.setup-smtp-feedback.is-error:not(:empty)::before,
.setup-smtp-feedback.setup-hint-warn:not(:empty)::before {
  content: '❌ ';
}
.setup-smtp-discover-btn.btn-ghost {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--line));
  background: #fff;
  width: 100%;
  min-height: 2.85rem;
  justify-content: center;
  text-align: center;
  border-radius: 14px;
  font-weight: 650;
}
.setup-smtp-discover-btn.btn-ghost:hover:not(:disabled) {
  color: var(--brand-primary-deep);
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
}
.setup-smtp-manual {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 0.65rem;
  padding: 0.85rem 1rem;
}
.setup-smtp-manual-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--ink);
}
.setup-smtp-manual .setup-field,
.setup-smtp-manual .setup-hint,
.setup-smtp-manual .setup-equal-row,
.setup-smtp-manual label {
  margin-top: 0.85rem;
}
.setup-smtp-manual > .setup-hint:first-of-type {
  margin-top: 0;
}
.setup-smtp-test {
  padding-top: 0.25rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.setup-smtp-discover-row {
  margin-top: 0.25rem;
}
.setup-smtp-live {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: color-mix(in srgb, white 72%, var(--brand-paper));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
}
.setup-smtp-live[hidden] { display: none !important; }
.setup-smtp-live-status { margin: 0; }
.setup-smtp.is-smtp-busy .setup-smtp-discover-btn {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}
[data-setup-wizard].is-smtp-busy .setup-form input:not([data-smtp-from]):not([data-smtp-password]),
[data-setup-wizard].is-smtp-busy .setup-form select,
[data-setup-wizard].is-smtp-busy .setup-form textarea,
[data-setup-wizard].is-smtp-busy .setup-form button:not([data-smtp-discover-btn]):not([data-smtp-verify-btn]) {
  pointer-events: none;
  opacity: 0.55;
}
.setup-fields-editor-compact .setup-fields-editor-meta > div {
  display: grid;
  gap: 0.35rem;
}
.setup-fields-editor-compact .setup-fields-step {
  border: none;
  padding: 0;
  background: transparent;
}
.setup-fields-editor-compact .setup-fields-table-wrap {
  margin-top: 0;
}
.setup-meta {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.setup-progress {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  margin: 0 0 1rem;
  overflow: hidden;
}
.setup-progress span {
  display: block;
  width: var(--setup-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: inherit;
  transform-origin: left center;
}
.setup-form { display: grid; gap: 0.75rem; overflow: visible; }
.setup-field-group,
.setup-address,
.geo-address,
.setup-president {
  display: grid;
  gap: 0.65rem;
  overflow: visible;
}
.setup-section {
  border: 1px solid color-mix(in srgb, var(--line) 92%, var(--brand-primary));
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 94%, #fff);
  overflow: visible;
}
.setup-section-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
  align-items: center;
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  user-select: none;
}
.setup-section-summary::-webkit-details-marker { display: none; }
.setup-section-summary::after {
  content: '';
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2.5px solid color-mix(in srgb, var(--ink) 55%, var(--muted));
  border-bottom: 2.5px solid color-mix(in srgb, var(--ink) 55%, var(--muted));
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.18s ease;
}
.setup-section[open] > .setup-section-summary::after {
  transform: translateY(15%) rotate(225deg);
}
.setup-section-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
}
.setup-section-hint {
  grid-column: 1;
  font-size: 0.82rem;
  font-weight: 500;
}
.setup-section-body {
  display: grid;
  gap: 0.65rem;
  padding: 0 1rem 1rem;
}
.setup-section.is-needs-attention:not([open]) {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.setup-section.is-needs-attention:not([open]) .setup-section-summary::after {
  border-color: var(--brand-primary);
  animation: setup-section-nudge 1.1s ease-in-out infinite;
}
@keyframes setup-section-nudge {
  0%, 100% { transform: translateY(-25%) rotate(45deg); }
  50% { transform: translateY(0) rotate(45deg); }
}
.setup-form .suggest-field,
.member-form .suggest-field,
.geo-address .suggest-field {
  z-index: 1;
}
.setup-form .suggest-field:focus-within,
.setup-form .suggest-field.is-open,
.member-form .suggest-field:focus-within,
.member-form .suggest-field.is-open,
.geo-address .suggest-field:focus-within,
.geo-address .suggest-field.is-open {
  z-index: 120;
}
.setup-address-row,
.geo-address-row {
  display: grid;
  grid-template-columns: 1fr minmax(5.5rem, 7.5rem);
  gap: 0.75rem;
  align-items: start;
}
.geo-address .setup-field,
.geo-address .setup-field input,
.geo-address-host .setup-field,
.geo-address-host .setup-field input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.geo-address-host,
.member-form,
.member-form .member-profile-grid,
.member-form .wizard-panel.is-active {
  overflow: visible;
}
.suggest-list {
  border-color: color-mix(in srgb, var(--brand-primary-ink) 28%, #c5cdca);
}
.geo-hint,
.setup-hint {
  margin: -0.25rem 0 0;
  font-size: 0.9rem;
  font-weight: 500;
}
.member-form .geo-address {
  margin: 0;
}
.member-form .member-geo-birth {
  display: grid;
  gap: 0.35rem;
  width: 100%;
}
.member-form .member-geo-birth > span {
  font-weight: 600;
  color: var(--ink);
}
.assoc-person-dates {
  margin-top: 0.35rem;
}
.setup-equal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
}
.setup-equal-row .setup-field,
.setup-equal-row .setup-field input,
.setup-equal-row .setup-field select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.setup-president .cf-row {
  width: 100%;
}
.setup-field-grow { min-width: 0; }
.setup-field-cap,
.setup-field-num { max-width: 8rem; }
.setup-scrape {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 35%, var(--line));
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-accent) 16%, white), color-mix(in srgb, var(--brand-primary) 14%, white));
}
.setup-scrape[hidden] {
  display: none !important;
}
.setup-scrape-btn {
  justify-self: stretch;
  width: 100%;
  white-space: normal;
  text-align: left;
  max-width: 100%;
  line-height: 1.4;
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  min-height: 3.1rem;
  background: color-mix(in srgb, var(--brand-primary) 88%, #062e2b);
  color: #f4fbf9;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-primary) 28%, transparent);
}
.setup-scrape-btn:hover:not(:disabled) {
  background: var(--brand-primary-deep);
  color: #fff;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--brand-primary) 34%, transparent);
}
.setup-scrape-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 16%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 72%, #0a3d39);
  color: #f4fbf9;
}
.setup-scrape.is-scraping .setup-scrape-btn {
  display: none !important;
}
.setup-scrape-btn[hidden] {
  display: none !important;
}
.setup-scrape-btn .scrape-name {
  display: inline-block;
  max-width: min(100%, 16rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: color-mix(in srgb, var(--brand-accent) 40%, white);
  font-weight: 800;
}
.setup-scrape-btn .scrape-site {
  display: block;
  margin-top: 0.2rem;
  color: color-mix(in srgb, var(--brand-primary) 28%, white);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.setup-scrape-status { margin: 0; font-size: 0.92rem; }
.setup-scrape-live {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: color-mix(in srgb, white 72%, var(--brand-paper));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
}
.setup-scrape-live[hidden],
.setup-scrape-results[hidden] { display: none !important; }
.setup-scrape-live-copy { display: grid; gap: 0.2rem; min-width: 0; }
.setup-scrape-retry {
  justify-self: start;
  margin-top: 0.35rem;
}
.setup-scrape-retry[hidden] { display: none !important; }
.setup-scrape-elapsed { margin: 0; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.setup-scrape-spinner {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--brand-primary) 22%, transparent);
  border-top-color: var(--brand-primary);
  animation: setup-scrape-spin 0.75s linear infinite;
}
.setup-scrape.is-scraping .setup-scrape-spinner { display: block; }
.setup-scrape:not(.is-scraping) .setup-scrape-spinner { display: none; }
[data-setup-wizard].is-scrape-busy .setup-back,
[data-setup-wizard].is-scrape-busy .setup-cta,
[data-setup-wizard].is-scrape-busy [data-setup-exit],
[data-setup-wizard].is-runts-busy .setup-back,
[data-setup-wizard].is-runts-busy .setup-cta,
[data-setup-wizard].is-runts-busy [data-setup-exit] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
[data-setup-wizard].is-scrape-busy [data-setup-website-input],
[data-setup-wizard].is-runts-busy [data-setup-runts-input],
[data-setup-wizard].is-runts-busy [data-setup-assoc-name],
[data-setup-wizard].is-runts-busy [data-setup-legal-name] {
  cursor: wait;
}
[data-setup-wizard].is-runts-busy [data-setup-assoc-name],
[data-setup-wizard].is-runts-busy [data-setup-legal-name],
[data-setup-wizard].is-runts-busy .setup-field-name,
[data-setup-wizard].is-runts-busy .setup-field-legal {
  opacity: 0.55;
  pointer-events: none;
}
.setup-scrape-results {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.15rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background:
    linear-gradient(160deg, color-mix(in srgb, white 82%, var(--brand-paper)), color-mix(in srgb, var(--brand-paper) 55%, white));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--line));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-primary) 8%, transparent);
}
.setup-scrape-results-head {
  display: grid;
  gap: 0.25rem;
}
.setup-scrape-results-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--brand-primary-deep);
}
.setup-scrape-results-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
}
.setup-scrape-results-status {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.setup-scrape-brand {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 0.75rem;
}
.setup-scrape-brand[hidden] { display: none !important; }
.setup-scrape-logo-card,
.setup-scrape-palette-card {
  position: relative;
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: color-mix(in srgb, white 88%, var(--brand-paper));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, var(--line));
  min-width: 0;
}
.setup-scrape-logo-card[hidden],
.setup-scrape-palette-card[hidden],
.setup-scrape-logo-picks[hidden] { display: none !important; }
.setup-scrape-logo-picks {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: color-mix(in srgb, white 88%, var(--brand-paper));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, var(--line));
}
.setup-scrape-logo-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.setup-scrape-logo-pick {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 5.5rem;
  padding: 0.55rem;
  border: 2px solid color-mix(in srgb, var(--brand-primary) 16%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, white 92%, var(--brand-paper));
  cursor: pointer;
  appearance: none;
  font: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.setup-scrape-logo-pick:hover,
.setup-scrape-logo-pick:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--line));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--brand-primary) 16%, transparent);
  outline: 2px solid color-mix(in srgb, var(--brand-primary) 45%, white);
  outline-offset: 2px;
}
.setup-scrape-logo-pick.is-selected {
  border-color: var(--brand-primary);
  border-width: 3px;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--brand-primary) 28%, white),
    0 12px 24px color-mix(in srgb, var(--brand-primary) 22%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
}
.setup-scrape-logo-pick.is-selected::after {
  content: '✓';
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}
.setup-scrape-logo-pick.is-busy:not(.is-selected) {
  opacity: 0.45;
  pointer-events: none;
}
.setup-scrape-logo-pick.is-busy.is-selected {
  pointer-events: none;
}
.setup-scrape-logo-pick img {
  max-width: 100%;
  max-height: 4.6rem;
  object-fit: contain;
}
.setup-scrape-logo-picks .btn {
  justify-self: start;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.setup-scrape-logo-picks .btn.is-selected {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  color: var(--brand-primary-deep);
  font-weight: 750;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 22%, white);
}
.setup-scrape-brand-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 55%, var(--brand-primary));
}
.setup-scrape-logo-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 5rem;
  padding: 0.7rem;
  border: 0;
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 12%, white), color-mix(in srgb, var(--brand-accent) 12%, white));
  transition: background 0.9s ease, transform 0.2s ease, box-shadow 0.2s ease;
  font: inherit;
  cursor: pointer;
  appearance: none;
}
button.setup-scrape-logo-frame:hover,
button.setup-scrape-logo-frame:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--brand-primary) 16%, transparent);
  outline: 2px solid color-mix(in srgb, var(--brand-primary) 45%, white);
  outline-offset: 2px;
}
.setup-scrape-logo-overlay {
  position: absolute;
  inset: auto 0.55rem 0.55rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary-deep) 82%, transparent);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
button.setup-scrape-logo-frame:hover .setup-scrape-logo-overlay,
button.setup-scrape-logo-frame:focus-visible .setup-scrape-logo-overlay {
  opacity: 1;
  transform: translateY(0);
}
.setup-scrape-logo-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.setup-scrape-logo-hint {
  margin: 0;
  font-size: 0.8rem;
}
.setup-scrape-logo-card.is-uploading {
  opacity: 0.72;
  pointer-events: none;
}
.setup-scrape-logo-frame img {
  max-width: 100%;
  max-height: 4.4rem;
  width: auto;
  height: auto;
  object-fit: contain;
}
.setup-scrape-palette-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.setup-scrape-palette-swatch {
  display: block;
  height: 3rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, white 18%, transparent);
  background: var(--swatch, var(--brand-primary));
  transition: background-color 0.9s ease, box-shadow 0.9s ease;
}
.setup-scrape-palette-bar {
  height: 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  transition: background 0.9s ease;
}
.setup-scrape-groups {
  display: grid;
  gap: 0.75rem;
}
.setup-scrape-group {
  display: grid;
  gap: 0.45rem;
}
.setup-scrape-group[hidden] { display: none !important; }
.setup-scrape-group-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 55%, var(--brand-primary));
}
.setup-scrape-found {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.setup-scrape-found-item {
  display: grid;
  grid-template-columns: minmax(5.5rem, 32%) 1fr;
  gap: 0.45rem 0.85rem;
  align-items: baseline;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: color-mix(in srgb, white 90%, var(--brand-paper));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 10%, var(--line));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.setup-scrape-found-item.is-in {
  opacity: 1;
  transform: translateY(0);
}
.setup-scrape-found-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--ink) 58%, var(--brand-primary));
}
.setup-scrape-found-value {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--brand-primary-deep);
  word-break: break-word;
}
@keyframes setup-scrape-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 640px) {
  .setup-scrape-brand,
  .setup-scrape-found-item {
    grid-template-columns: 1fr;
  }
  .setup-scrape-logo-pick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.setup-membership {
  display: grid;
  gap: 0.9rem;
}
.setup-membership-list {
  display: grid;
  gap: 0.75rem;
}
.setup-membership-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-paper) 72%, white);
  box-shadow: var(--shadow-soft);
}
.setup-membership-card-new {
  border-style: dashed;
  background: color-mix(in srgb, var(--brand-primary) 5%, white);
  position: relative;
}
.setup-membership-new-list {
  display: grid;
  gap: 0.85rem;
}
.setup-membership-card-head {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 1;
}
.setup-membership-card-new .setup-langs-row {
  padding-right: 1.75rem;
}
.setup-membership-remove {
  width: 2rem;
  height: 2rem;
  padding: 0;
  line-height: 1;
  font-size: 1.25rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 55%, var(--muted));
}
.setup-membership-remove:hover {
  color: var(--brand-primary);
}
.setup-membership-remove[hidden] {
  display: none !important;
}
.setup-langs-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.setup-check-inline {
  align-self: end;
  margin-bottom: 0.35rem;
}
.user-role-picker {
  margin-top: 1rem;
}
.user-role-description {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.user-permissions-editor {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}
.user-permissions-templates {
  margin-bottom: 1rem;
}
.user-permissions-template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.user-permissions-template-list .btn.is-active {
  border-color: var(--brand-primary, #2563eb);
  background: color-mix(in srgb, var(--brand-primary, #2563eb) 12%, transparent);
}
.user-permissions-groups {
  display: grid;
  gap: 1rem;
}
.user-permissions-group {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-md, 0.5rem);
  background: var(--surface-muted, rgba(0, 0, 0, 0.02));
}
.user-permissions-group-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.user-permissions-group-items {
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.user-permission-item {
  margin: 0;
}
.settings-users-table {
  margin-bottom: 1.25rem;
}
.settings-user-create {
  margin-top: 0.5rem;
}
.email-template-editor-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .email-template-editor-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
.email-template-ph-list,
.email-template-cond-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.email-template-cond {
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}
.email-template-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}
.email-template-lang-tab {
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.12));
  background: transparent;
  border-radius: var(--radius-sm, 0.35rem);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font: inherit;
}
.email-template-lang-tab.is-active {
  border-color: var(--brand-primary, #2563eb);
  background: color-mix(in srgb, var(--brand-primary, #2563eb) 10%, transparent);
}
.email-template-lang-pane {
  display: none;
}
.email-template-lang-pane.is-active {
  display: block;
}
.tpl-html-mode-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.5rem 0;
}
.tpl-html-mode-tab {
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.12));
  background: transparent;
  border-radius: var(--radius-sm, 0.35rem);
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
}
.tpl-html-mode-tab.is-active {
  border-color: var(--brand-primary, #2563eb);
}
.tpl-body-source,
.mail-preview-body {
  white-space: pre-wrap;
  word-break: break-word;
}
.mail-preview {
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-md, 0.5rem);
  padding: 0.85rem 1rem;
  background: #fff;
}
.mail-preview-meta {
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
}
.mail-preview-subject {
  font-weight: 600;
}
.mail-preview-html {
  border: 1px dashed var(--border-subtle, rgba(0, 0, 0, 0.12));
  padding: 0.75rem;
  min-height: 4rem;
  background: var(--surface-muted, rgba(0, 0, 0, 0.02));
}
.email-template-test-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}
.settings-email-templates-list,
.settings-workflow-list {
  margin-top: 1.25rem;
}
.workflow-rule-form-card {
  margin-bottom: 1rem;
}
.setup-hint-warn {
  color: var(--brand-accent-ink);
  font-weight: 600;
}
.setup-fields {
  display: grid;
  gap: 0.75rem;
}
.setup-fields-editor {
  display: grid;
  gap: 1rem;
}
.setup-fields-editor-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.setup-fields-autosave-status {
  margin: 0;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 600;
  min-height: 1.2em;
}
.setup-fields-autosave-status.is-ok {
  color: var(--brand-primary-deep);
}
.setup-fields-autosave-status.is-error {
  color: var(--brand-accent-ink, #b84a1b);
}
.setup-fields-autosave-status.is-busy {
  color: var(--muted);
}
.settings-autosave-status {
  min-height: 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.88rem;
}
.settings-autosave-status.is-ok {
  color: color-mix(in srgb, var(--brand-primary) 78%, var(--ink));
  font-weight: 600;
}
.settings-autosave-status.is-error {
  color: var(--danger, #b42318);
}
.settings-autosave-status.is-busy {
  color: var(--muted);
}
.setup-fields-steps {
  display: grid;
  gap: 1rem;
}
.setup-fields-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-paper) 55%, white);
  overflow: hidden;
}
.setup-fields-step.is-drag-over {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 25%, transparent);
}
.setup-fields-step-locked {
  opacity: 0.96;
}
.setup-fields-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.setup-fields-step-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.setup-fields-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.setup-fields-step-name {
  font-size: 1rem;
  color: var(--brand-primary-deep);
}
.setup-fields-step-locked-note {
  font-size: 0.85rem;
}
.setup-fields-step-titles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.75rem 0.9rem 0.35rem;
}
.setup-fields-step .setup-fields-table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.setup-fields-step-system {
  border-style: dashed;
}
.setup-fields-step-actions {
  display: flex;
  justify-content: flex-start;
  padding: 0.15rem 0;
}
.setup-fields-empty-row td {
  text-align: center;
  padding: 1rem 0.85rem;
}
.setup-fields-system-row th,
.setup-fields-system-row td {
  color: var(--muted);
  background: color-mix(in srgb, var(--brand-primary) 3%, white);
}
.setup-fields-drag-locked {
  display: inline-flex;
  width: 1.85rem;
  height: 1.85rem;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0.7;
}

@media (max-width: 720px) {
  .setup-fields-step-titles {
    grid-template-columns: 1fr;
  }
}
.setup-fields-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--brand-paper) 55%, white);
}
.setup-fields-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.setup-fields-table th,
.setup-fields-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  vertical-align: middle;
}
.setup-fields-table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--brand-primary) 6%, white);
}
.setup-fields-table tbody th {
  font-weight: 600;
  text-align: left;
  color: var(--ink);
}
.setup-fields-table tbody tr:last-child th,
.setup-fields-table tbody tr:last-child td {
  border-bottom: 0;
}
.setup-fields-table tbody tr:hover {
  background: color-mix(in srgb, var(--brand-primary) 4%, transparent);
}
.setup-fields-col-check {
  width: 5.5rem;
  text-align: center;
}
.setup-fields-col-drag {
  width: 2.5rem;
  padding-left: 0.55rem;
  padding-right: 0.25rem;
  text-align: center;
  vertical-align: middle;
}
.setup-fields-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.setup-fields-drag-handle:hover,
.setup-fields-drag-handle:focus-visible {
  color: var(--brand-primary-deep);
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  outline: none;
}
.setup-fields-drag-handle:active {
  cursor: grabbing;
}
.setup-fields-table tbody tr.is-dragging {
  opacity: 0.45;
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
}
.setup-fields-table tbody tr.is-drag-over {
  box-shadow: inset 0 2px 0 0 var(--brand-primary);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.setup-fields-name {
  font-weight: 600;
}
.setup-fields-type {
  display: block;
  margin: 0;
}
.setup-fields-type select {
  width: 100%;
  min-width: 9rem;
  font-weight: 600;
}
.setup-fields-type-locked {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--brand-primary-deep);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 10%, white);
}
.setup-fields-add {
  margin-top: 0.75rem;
}
.setup-fields-add .setup-subhead {
  margin: 0;
}
.setup-fields-add .btn {
  margin-top: 0.35rem;
}
.setup-fields-add-now-btn.btn-ghost {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--line));
  background: #fff;
}
.setup-fields-add-now-btn.btn-ghost:hover {
  color: var(--brand-primary-deep);
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, white);
}
.setup-fields-bundle-sync {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.config-accordion-body .setup-fields-add .setup-field > span {
  display: block;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--brand-primary-deep);
  margin-bottom: 0.35rem;
}
.setup-fields-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.setup-fields-toggle.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.setup-fields-toggle.is-locked input {
  cursor: not-allowed;
}
.setup-fields-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--brand-primary);
}
@media (max-width: 720px) {
  .setup-langs-row {
    grid-template-columns: 1fr;
  }
  .setup-fields-col-check {
    width: 4.25rem;
  }
  .setup-fields-table th,
  .setup-fields-table td {
    padding: 0.5rem 0.55rem;
  }
  .setup-fields-type select {
    min-width: 0;
  }
}
.setup-subhead {
  margin: 0.35rem 0 0;
  font-weight: 700;
  color: var(--brand-primary-deep);
}
.setup-people { display: grid; gap: 0.85rem; }
.setup-accounts-list { display: grid; gap: 0.65rem; }
.setup-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 12rem);
  gap: 0.75rem;
  align-items: end;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-paper) 55%, white);
}
.setup-account-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.55rem;
  font-weight: 700;
}
.setup-account-active { padding-bottom: 0.55rem; }
.setup-account-active .setup-field { margin: 0; }
.setup-field-account-opening > span { font-size: 0.9rem; }
@media (max-width: 600px) {
  .setup-account-row { grid-template-columns: 1fr; }
  .setup-account-toggle,
  .setup-account-active { padding-bottom: 0; }
}
.setup-people-row[hidden],
.setup-people-pager[hidden] { display: none !important; }
.setup-admin-summary {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
}
.setup-admin-summary p { margin: 0 0 0.35rem; }
.setup-admin-summary p:last-child { margin-bottom: 0; }
.setup-admin-summary .setup-subhead { margin-bottom: 0.35rem; }
.setup-people-intro { margin: 0; }
.setup-people-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.setup-people-counter {
  min-width: 9rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--brand-primary-deep);
}
.setup-people-nav {
  min-width: 2.4rem;
  font-size: 1.25rem;
  line-height: 1;
}
.setup-people-rows { display: grid; gap: 0.75rem; }
.setup-people-row {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-paper) 55%, white);
}
.setup-people-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-items: end;
}
.setup-people-main > .setup-field-people-cf {
  grid-column: 1 / -1;
}
.setup-people-row .setup-field-organ-type,
.setup-people-row .setup-field-office-role {
  grid-column: 1 / -1;
  max-width: 18rem;
}
.setup-people-president {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
}
.setup-people-president-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--brand-on-primary, #fff);
  background: var(--brand-primary);
}
.setup-people-president-name {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}
.setup-people-president-meta {
  margin: 0.1rem 0 0;
  font-size: 0.86rem;
}
.setup-people-president-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand-primary-deep);
  background: color-mix(in srgb, var(--brand-primary) 14%, #fff);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
}
.setup-runts-import {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--brand-accent) 45%, var(--line));
  background: color-mix(in srgb, var(--brand-accent) 6%, #fff);
}
.setup-runts-import-text {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}
.setup-runts-import-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}
.setup-people-cf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: center;
}
.setup-people-cf-row input {
  min-width: 0;
  width: 100%;
}
.setup-people-cf-row .btn {
  white-space: nowrap;
}
.setup-people-remove {
  min-width: 2.25rem;
  padding-inline: 0.55rem;
  font-size: 1.15rem;
  line-height: 1;
}
.setup-exit-dialog.setup-cf-calc-dialog {
  max-width: min(36rem, 96vw);
  width: min(36rem, 96vw);
  overflow: visible;
}
.setup-cf-calc-shell {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.setup-cf-calc-dialog::backdrop {
  background: color-mix(in srgb, #0b1f1c 45%, transparent);
}
.setup-cf-calc-fields {
  display: grid;
  gap: 0.75rem;
  overflow: visible;
  min-width: 0;
}
.setup-cf-calc-dialog .setup-equal-row {
  grid-template-columns: 1fr;
  min-width: 0;
}
@media (min-width: 560px) {
  .setup-cf-calc-dialog .setup-equal-row {
    grid-template-columns: 1fr 1fr;
  }
}
.setup-cf-calc-dialog .setup-field,
.setup-cf-calc-dialog .suggest-field,
.setup-cf-calc-dialog .geo-birth-place {
  position: relative;
  z-index: 2;
  min-width: 0;
}
.setup-cf-calc-dialog .setup-field input,
.setup-cf-calc-dialog .setup-field select,
.setup-cf-calc-dialog .suggest-wrap {
  max-width: 100%;
  box-sizing: border-box;
}
.setup-cf-calc-dialog .setup-hint.is-error {
  color: var(--danger);
  font-weight: 600;
}
.setup-lang-flag-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.setup-lang-flag-label img {
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}
.setup-price-with-currency {
  position: relative;
  display: block;
  width: 100%;
}
/* The inline field adds a bottom margin that shifted the € below the digits. */
.setup-price-with-currency .sf-field { margin: 0; }
.setup-price-with-currency input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 3rem;
  margin-bottom: 0;
  /* Keep the € suffix readable: no native number spinners on top of it. */
  -moz-appearance: textfield;
  appearance: textfield;
}
.setup-price-with-currency input::-webkit-outer-spin-button,
.setup-price-with-currency input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.setup-price-currency {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  min-width: 1.15rem;
  padding-left: 0.55rem;
  border-left: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--brand-primary-deep, var(--ink));
  pointer-events: none;
}
.setup-locale-grid-compact {
  margin-top: 0.35rem;
}
.setup-locale-grid-compact .setup-locale-card {
  padding: 0.55rem 0.65rem;
}
.setup-admin-locale > span {
  display: block;
  margin-bottom: 0.35rem;
}
.assoc-people { display: grid; gap: 0.85rem; }
.assoc-people-rows { display: grid; gap: 0.85rem; }
.assoc-person-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-paper) 55%, white);
}
.assoc-person-main {
  display: grid;
  grid-template-columns: minmax(9rem, 0.9fr) 1fr 1fr 1fr auto;
  gap: 0.65rem;
  align-items: end;
}
@media (max-width: 720px) {
  .setup-address-row:not(.geo-address-row-inline),
  .geo-address-row:not(.geo-address-row-inline),
  .setup-equal-row,
  .setup-people-main,
  .assoc-person-main {
    grid-template-columns: 1fr;
  }
  .setup-people-cf-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .setup-field-cap,
  .setup-field-num { max-width: none; }
}
.setup-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}
.setup-field .setup-field-hint {
  margin: 0;
  font-weight: 500;
}
.setup-field .setup-field-hint.is-error,
.setup-field .setup-field-hint.setup-hint-warn {
  color: var(--danger);
  font-weight: 600;
}
.setup-field .setup-field-hint.is-ok {
  display: none;
}
.setup-input-validity {
  position: relative;
  display: block;
  width: 100%;
}
.setup-input-validity > input,
.setup-input-validity > select,
.setup-input-validity > textarea {
  width: 100%;
  padding-right: 2.35rem;
}
.setup-input-validity-mark {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  color: transparent;
  box-sizing: border-box;
}
.setup-input-validity.is-valid .setup-input-validity-mark {
  color: #1a7a3c;
}
.setup-input-validity.is-invalid .setup-input-validity-mark {
  color: var(--danger, #9b1c1c);
}
/* Spinner while address/city is being searched or validated (same slot as ✓ / ✕). */
.setup-input-validity.is-pending .setup-input-validity-mark {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--brand-primary) 28%, #d5ddd9);
  border-top-color: var(--brand-primary);
  color: transparent;
  font-size: 0;
  line-height: 0;
  animation: setup-scrape-spin 0.7s linear infinite;
}
.setup-input-validity.is-pending > input,
.setup-input-validity.is-pending > select,
.setup-input-validity.is-pending > textarea {
  padding-right: 2.7rem;
}
.setup-input-validity > textarea ~ .setup-input-validity-mark {
  top: 0.85rem;
  transform: none;
}
.setup-input-validity.is-pending > textarea ~ .setup-input-validity-mark {
  transform: none;
}
/* Prefer the in-field validity spinner over the legacy suggest-spinner when both exist. */
.suggest-wrap.is-loading .setup-input-validity.is-pending ~ .suggest-spinner,
.suggest-wrap .setup-input-validity.is-pending ~ .suggest-spinner {
  display: none;
}
/* Locale cards already show selection — no orphan ✓ grid cell. */
.setup-locale-grid.is-valid::after {
  content: none;
  display: none;
}
.setup-field input.is-invalid,
.setup-field select.is-invalid,
.setup-field textarea.is-invalid,
.setup-people-row input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 18%, transparent);
}
.setup-field input.is-valid,
.setup-field select.is-valid,
.setup-field textarea.is-valid,
.setup-people-row input.is-valid {
  border-color: color-mix(in srgb, #1a7a3c 70%, var(--line));
}
.setup-field input,
.setup-field select,
.setup-field textarea {
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.setup-field input:focus,
.setup-field select:focus,
.setup-field textarea:focus {
  transform: translateY(-1px);
}
.setup-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.setup-brand-preview {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand-paper) 60%, white);
  transition: --brand-primary 0.9s ease, --brand-accent 0.9s ease;
}
.setup-brand-preview-primary,
.setup-brand-preview-accent {
  flex: 1;
  height: 2.75rem;
  border-radius: 10px;
  transition: background 0.9s ease;
}
.setup-brand-preview-primary {
  background: var(--brand-primary);
}
.setup-brand-preview-accent {
  background: var(--brand-accent);
}
.setup-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.setup-palette-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.setup-palette-card:hover,
.setup-palette-card.is-selected {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--line));
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}
.setup-palette-card.is-preset {
  border-style: dashed;
}
.setup-palette-swatch {
  display: block;
  height: 1.6rem;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--swatch-a) 50%, var(--swatch-b) 50%);
}
.setup-palette-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.setup-logo-preview {
  display: grid;
  place-items: center;
  min-height: 7rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
  margin-bottom: 0.85rem;
}
.setup-logo-preview img {
  max-width: min(100%, 220px);
  max-height: 120px;
  object-fit: contain;
  transition: opacity 0.45s ease;
}
.setup-logo-preview.is-loading img,
.setup-logo-preview.is-uploading img {
  opacity: 0.45;
}
.setup-logo-preview.is-uploading {
  position: relative;
}
.setup-logo-preview.is-uploading::after {
  content: '';
  position: absolute;
  inset: auto 50% 0.75rem auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: -0.625rem;
  border: 2px solid color-mix(in srgb, var(--brand-primary) 22%, transparent);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: setup-scrape-spin 0.75s linear infinite;
}
.setup-logo-remove {
  margin: 0;
}
.setup-logo-status.is-error {
  color: var(--danger);
  font-weight: 600;
}
.setup-logo-preview img[hidden],
.setup-logo-preview:has(img[hidden]) {
  display: none;
}
.setup-logo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.55rem;
}
.setup-logo-actions .file-btn {
  margin: 0;
}
.setup-logo-actions .file-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.setup-defer-wrap {
  flex: 0 0 auto;
  margin: 0.55rem 0 0.15rem;
  padding: 0.35rem 0.25rem 0.55rem;
  text-align: center;
  position: relative;
  z-index: 13;
}
.setup-defer-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.15rem 0.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.setup-defer-link:hover {
  color: var(--brand-accent);
}
.setup-period-label {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
}
.setup-logo-filename {
  display: none !important;
}
.setup-logo-upload-progress {
  height: 0.35rem;
  margin: 0.35rem 0 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  overflow: hidden;
}
.setup-logo-upload-progress-bar {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  transition: width 0.15s ease;
}
.phone-field {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.phone-dial-select {
  flex: 0 0 9.5rem;
  width: 9.5rem;
  max-width: 9.5rem;
  min-width: 9.5rem;
  padding-left: 2.1rem;
  padding-right: 0.65rem;
  background-repeat: no-repeat;
  background-position: 0.6rem center;
  background-size: 1.15rem auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
.phone-national-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
}
/* If a validity wrap was left from older sessions, keep the dial row stable */
.phone-field > .setup-input-validity {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  max-width: 100%;
  display: block;
}
.member-form .member-field-row--contact > .field-block {
  min-width: 0;
  max-width: 100%;
}
.member-form .member-field-row--contact .phone-field {
  width: 100%;
}
.setup-field-province {
  flex: 0 0 5.5rem;
  max-width: 6rem;
}
.geo-layout-rows .setup-field-province input {
  text-transform: uppercase;
}
.assoc-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
}
.assoc-logo.sidebar-assoc-logo {
  width: auto;
  height: auto;
  max-width: min(100%, 9rem);
  max-height: 3.75rem;
  border-radius: 10px;
  padding: 0.25rem;
  box-shadow: 0 4px 12px color-mix(in srgb, #000 22%, transparent);
}
.sidebar-brand.has-assoc-logo .sidebar-brand-stack {
  gap: 0.35rem;
}
@media (max-width: 700px) {
  .setup-colors { grid-template-columns: 1fr; }
}
.setup-check {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-paper) 70%, white);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.setup-check input[type="checkbox"] {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.1rem 0 0;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
  cursor: pointer;
}
.setup-check > span {
  font-weight: 650;
  line-height: 1.45;
  color: var(--ink);
}
.setup-check-prominent {
  border-color: color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  background: color-mix(in srgb, var(--brand-primary) 4%, white);
}
.setup-gdpr-options {
  display: grid;
  gap: 0.65rem;
}
.setup-gdpr-extras {
  display: grid;
  gap: 0.55rem;
  margin-left: 0.15rem;
  padding-left: 0.85rem;
  border-left: 3px solid color-mix(in srgb, var(--brand-primary) 22%, transparent);
}
.setup-gdpr-extras.is-disabled {
  opacity: 0.45;
}
.setup-gdpr-model-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: color-mix(in srgb, #2563eb 10%, #eff6ff);
  border: 1px solid color-mix(in srgb, #2563eb 28%, transparent);
  color: #1e3a8a;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}
.setup-gdpr-model-note-icon {
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  background: color-mix(in srgb, #2563eb 18%, white);
  color: #1d4ed8;
}
.setup-lang-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.setup-check:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 35%, var(--line));
  transform: translateY(-1px);
}
.setup-cta {
  min-width: 10rem;
  margin-top: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 0.65rem;
  position: sticky;
  bottom: 0;
  z-index: 12;
  padding: 0.75rem 0 0.15rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, #fff 28%);
  border-top: 1px solid color-mix(in srgb, var(--brand-primary) 12%, transparent);
  box-shadow: 0 -12px 22px -8px rgba(255, 255, 255, 0.98);
}
.setup-why-note {
  margin: 1rem 0 0.35rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  opacity: 1;
  position: relative;
  z-index: 1;
}
.setup-why-title {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand-primary-deep);
}
.setup-why-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
  opacity: 1;
}
.setup-why-text.muted {
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
}
.setup-back {
  min-width: auto;
  margin-right: auto;
}
.setup-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-primary) 28%, transparent);
}
.setup-cta:active {
  transform: translateY(0);
}
.setup-card-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1rem;
}
.setup-card-bar-end {
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}
.setup-card-bar .setup-progress {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}
.setup-exit {
  flex: 0 0 auto;
  min-width: auto;
  position: static;
}
.setup-exit:hover {
  transform: none;
  box-shadow: none;
}
.member-leave-dialog,
.setup-exit-dialog,
.member-treasury-dialog,
.member-collect-dialog,
.member-bulk-email-dialog,
.socly-dialog,
.camera-dialog,
.doc-dialog,
.config-reset-dialog,
.setup-runts-doc-dialog {
  border: 0;
  outline: 0;
  border-radius: 20px;
  padding: 0;
  max-width: min(420px, 92vw);
  width: 100%;
  background: transparent;
  z-index: 1000;
  overflow: visible;
  box-shadow: none;
}
.member-treasury-dialog,
.member-collect-dialog,
.member-bulk-email-dialog {
  max-width: min(520px, 94vw);
}
.camera-dialog { max-width: min(560px, 94vw); }
.doc-dialog { max-width: min(720px, 94vw); }
.setup-runts-doc-dialog { max-width: min(960px, 96vw); border-radius: 18px; }
.member-leave-dialog::backdrop,
.setup-exit-dialog::backdrop,
.member-treasury-dialog::backdrop,
.member-collect-dialog::backdrop,
.member-bulk-email-dialog::backdrop,
.socly-dialog::backdrop,
.camera-dialog::backdrop,
.doc-dialog::backdrop,
.setup-runts-doc-dialog::backdrop {
  background: color-mix(in srgb, var(--brand-primary-deep) 50%, transparent);
  backdrop-filter: blur(4px);
}
.member-leave-shell,
.setup-exit-shell,
.camera-shell,
.doc-shell,
.config-reset-shell,
.setup-runts-doc-shell {
  background: var(--card);
  border: 0;
  border-radius: 20px;
  padding: 1.35rem 1.4rem 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.85rem;
  overflow: hidden;
}
.member-leave-shell {
  gap: 0.85rem;
}
.camera-shell { padding: 1.1rem; }
.doc-shell {
  padding: 1.15rem 1.25rem 1.25rem;
  max-height: min(82vh, 760px);
}
.setup-runts-doc-shell {
  border-radius: 18px;
  padding: 0;
  max-height: min(90vh, 920px);
  grid-template-rows: auto minmax(0, 1fr);
}
.member-leave-text {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}
.member-leave-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}
.setup-exit-shell {
  gap: 1.1rem;
}
.setup-exit-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--brand-primary-deep);
}
.setup-exit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.setup-exit-discard-all {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.setup-exit-discard-all:hover {
  background: color-mix(in srgb, var(--danger) 8%, white);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: var(--danger);
}
.setup-logout-form {
  display: none;
}
.update-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 35%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-accent) 10%, white), color-mix(in srgb, var(--brand-primary) 8%, white));
}
.update-banner-copy {
  flex: 1;
  min-width: min(100%, 16rem);
}
.update-banner strong { display: block; margin-bottom: 0.15rem; }
.update-banner-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.update-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.update-banner-actions form { margin: 0; }
@media (max-width: 700px) {
  .setup-colors { grid-template-columns: 1fr; }
  .setup-cta,
  .setup-back { width: 100%; }
  .setup-actions { width: 100%; }
  .setup-back { margin-right: 0; }
}

/* Member wizard compact + enrollment pad */
.member-form.form-card {
  gap: 0.85rem;
}
.member-form .wizard-steps {
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}
@media (min-width: 900px) {
  .member-form .wizard-panel-head {
    margin-bottom: 0.65rem;
  }
  .member-form .wizard-panel-head .section-lede {
    margin-bottom: 0;
  }
  .member-form .wizard-panel-body {
    grid-template-columns: minmax(0, 1fr) minmax(14.5rem, 16.5rem);
  }
  .member-form .tessera-step-fields .grid-2,
  .member-form .member-profile-grid {
    gap: 0.65rem 0.85rem;
  }
  .member-form .field-block {
    margin-bottom: 0;
  }
}
.enrollment-pad {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, #d6dde8);
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
  max-width: 40rem;
}
.enrollment-pad canvas {
  display: block;
  width: 100%;
  height: 160px;
  touch-action: none;
  border-radius: 8px;
  background: #fff;
  cursor: crosshair;
}
.enrollment-pad-actions {
  margin-top: 0.5rem;
}
.auth-remember {
  margin: 0.85rem 0 0.35rem;
}
.setup-platform-consents {
  display: grid;
  gap: 0.4rem;
}
.setup-platform-consents .setup-check {
  margin-bottom: 0.35rem;
  padding: 0.65rem 0.85rem;
}
.setup-platform-intro {
  margin: 0 0 0.35rem;
}
.setup-platform-showcase-note {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  line-height: 1.4;
}
.setup-platform-confirm {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.45rem;
  padding-top: 0;
  border-top: none;
}
.setup-platform-confirm-lede {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.setup-platform-confirm > .setup-hint,
.setup-platform-confirm > .muted {
  margin: 0 0 0.15rem;
}
.setup-platform-confirm .setup-equal-row {
  gap: 0.65rem;
}

/* —— Terms of Service consent (setup wizard + settings) —— */
.setup-terms-consent {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 26%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff);
}
.setup-terms-consent .setup-check {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.setup-terms-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--brand-primary-deep);
}
.setup-terms-consent-lede {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}
.setup-terms-consent-error {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #b3261e;
}
.setup-terms-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand-primary-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  justify-self: start;
}
.setup-terms-link:hover {
  color: var(--brand-accent-ink);
}
.settings-terms-status {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-primary) 4%, #fff);
}
.settings-terms-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--brand-primary-deep);
}
.settings-terms-note {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.settings-terms-lede {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* —— Base components (setup + modules) —— */
.setup-component-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.85rem 0 1.1rem;
  border-top: none;
}
.setup-component-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  cursor: pointer;
  padding: 0.85rem 1.15rem 0.85rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--ink, #1a1a1a) 10%, transparent);
  border-radius: 12px;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}
.setup-component-row > input[type="checkbox"] {
  margin: 0.2rem 0 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
  flex-shrink: 0;
}
.setup-component-core-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--brand-primary);
  flex-shrink: 0;
}
.setup-component-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.setup-component-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.85rem;
}
.setup-component-name {
  font-size: 0.98rem;
  line-height: 1.3;
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
}
.setup-component-price,
.setup-component-core-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}
.setup-component-price {
  color: var(--brand-accent-ink, #8A3514);
  background: color-mix(in srgb, var(--brand-accent, #B84A1B) 16%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-accent-ink, #8A3514) 32%, #fff);
}
.setup-component-core-badge {
  color: var(--brand-primary-deep);
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
}
.setup-component-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--text, #1a1a1a) 68%, transparent);
}
.setup-component-row:hover {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 6%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 28%, transparent);
}
.setup-component-row.is-selected,
.setup-component-row:has(> input:checked) {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 10%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary-ink, var(--brand-primary, #0D6E66)) 40%, transparent);
}
.setup-component-row.is-selected .setup-component-name,
.setup-component-row:has(> input:checked) .setup-component-name {
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
}
.settings-component-list { margin-top: 0.35rem; }
.config-sub-accordions {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
}
.config-sub-accordion {
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-muted, #f7f8f8) 70%, #fff);
}
.config-sub-accordion > summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 700;
  list-style: none;
}
.config-sub-accordion > summary::-webkit-details-marker { display: none; }
.config-sub-body { padding: 0 1rem 1rem; }
.stat-positive { color: #0f7a48; }
.stat-negative { color: #b42318; }
.treasury-ledger .treasury-row-income { background: color-mix(in srgb, #0f7a48 6%, transparent); }
.treasury-ledger .treasury-row-expense { background: color-mix(in srgb, #b42318 5%, transparent); }
/* Giroconto: liquidity moved between own accounts — neutral, balance-safe row. */
.treasury-ledger .treasury-row-transfer { background: color-mix(in srgb, #5b6472 7%, transparent); }
.treasury-ledger .amount-transfer { color: #4a5568; font-weight: 700; }
.treasury-ledger .amount-income { color: #0f7a48; font-weight: 700; }
.treasury-ledger .amount-expense { color: #b42318; font-weight: 700; }
.treasury-ledger .amount-balance { font-variant-numeric: tabular-nums; }
.deadline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.deadline-list.compact { gap: 0.45rem; }
.deadline-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
}
.deadline-item.deadline-overdue { border-color: color-mix(in srgb, #b42318 25%, transparent); }
.deadline-item.deadline-soon { border-color: color-mix(in srgb, #b7791f 25%, transparent); }
.deadline-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.deadline-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.deadline-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
}
.deadline-badge-overdue { background: #fde8e8; color: #b42318; }
.deadline-badge-soon { background: #fff4db; color: #9a6700; }
.deadline-badge-done { background: #eef2f6; color: #475467; }
.deadline-row .deadline-badge {
  display: inline-block;
  margin-right: 0.45rem;
  vertical-align: middle;
}
.doc-category-badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  color: var(--brand-primary);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.deadline-row-actions,
.doc-row-actions .inline-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

/* ── Scadenzario: barra filtri live + archivio raggruppato per urgenza ── */
@media (min-width: 961px) {
  .deadlines-filter-row {
    grid-template-columns: minmax(11rem, 2fr) minmax(9rem, 1fr) minmax(9rem, 1fr) auto;
  }
}
.deadlines-filter-reset { align-self: end; }
.deadlines-table .deadline-row-overdue { background: color-mix(in srgb, #b42318 5%, transparent); }
.deadlines-table .deadline-row-soon { background: color-mix(in srgb, #b7791f 6%, transparent); }
.deadlines-table .deadline-row-done { background: color-mix(in srgb, #475467 5%, transparent); }
.deadlines-table .deadline-due {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.deadlines-table .deadline-badge {
  margin: 0 0 0 0.35rem;
  vertical-align: middle;
}
.deadlines-table .deadline-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.deadlines-table .deadline-notes { margin-top: 0.2rem; }
.deadlines-table .deadline-recurrence {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  font-size: 0.72rem;
  font-weight: 700;
}
.deadlines-form .deadline-member-toggle { margin-bottom: 0.5rem; }
/* Form su pagina dedicata: righe come Prima cassa (titolo 50% · data 25% · categoria 25%). */
.deadlines-form-row { display: grid; gap: 0.85rem; margin-top: 0.9rem; }
.deadlines-form-row--main { grid-template-columns: 2fr 1fr 1fr; align-items: start; }
.deadlines-form-row--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.deadlines-form-row--single { grid-template-columns: 1fr; }
@media (max-width: 960px) {
  .deadlines-form-row--main,
  .deadlines-form-row--pair { grid-template-columns: 1fr; }
}
/* Template legali ETS */
.deadlines-templates { display: grid; gap: 0.5rem; margin-bottom: 0.35rem; }
.deadlines-templates-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand-primary-deep, var(--brand-primary, #0D6E66));
}
.deadlines-templates-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.deadlines-template {
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 25%, var(--line, #d7dee7));
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 6%, #fff);
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.deadlines-template:hover { background: color-mix(in srgb, var(--brand-primary, #0D6E66) 12%, #fff); }
.deadlines-templates-hint { margin: 0; font-size: 0.8rem; }
/* Preavvisi: pillole larghe su una riga, con il numero in evidenza */
.deadlines-notify { display: grid; gap: 0.4rem; }
.deadlines-notify-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.deadlines-notify-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.deadlines-notify-pill input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--brand-primary, #0D6E66);
  flex-shrink: 0;
}
.deadlines-notify-days {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}
.deadlines-notify-unit {
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
}
.deadlines-notify-pill.is-on,
.deadlines-notify-pill:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 55%, transparent);
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 10%, #fff);
}
.deadlines-notify-pill.is-on .deadlines-notify-days,
.deadlines-notify-pill:has(input:checked) .deadlines-notify-days {
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
}
.deadlines-notify-pill.is-on .deadlines-notify-unit,
.deadlines-notify-pill:has(input:checked) .deadlines-notify-unit {
  color: color-mix(in srgb, var(--brand-primary-ink, #0D6E66) 80%, transparent);
}
@media (max-width: 560px) {
  .deadlines-notify-pills { grid-template-columns: 1fr; }
}
.deadlines-notify-hint { margin: 0; font-size: 0.8rem; }
/* Avviso attivo (promemoria dentro la finestra scelta) */
.deadline-notify,
.sidebar-deadline-notify {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff4db;
  color: #9a6700;
  white-space: nowrap;
}
.sidebar-deadline-notify {
  background: color-mix(in srgb, var(--brand-accent, #B84A1B) 22%, transparent);
  color: color-mix(in srgb, var(--brand-paper) 92%, var(--brand-accent));
}

/* ── Verbali e documenti: barra filtri live + archivio per categoria ── */
@media (min-width: 961px) {
  .documents-filter-row {
    grid-template-columns: minmax(11rem, 2fr) minmax(9rem, 1fr) minmax(9rem, 1fr) auto;
  }
}
.documents-filter-reset { align-self: end; }
.documents-table .documents-row { cursor: pointer; }
.documents-table .documents-date {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.documents-table .documents-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.documents-table .documents-summary { margin-top: 0.2rem; }
.documents-table .documents-file-badge,
.documents-table .documents-lang {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.documents-table .documents-file-badge {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 10%, #fff);
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
}
.documents-table .documents-lang {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}
.documents-table .documents-expires {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted, #667085);
}
.documents-table .documents-expires.is-soon { color: #9a6700; }
.documents-table .documents-expires.is-late { color: #b42318; }
/* Mobile: la tabella diventa un elenco di schede, come socio/scadenzario. */
@media (max-width: 640px) {
  .documents-table { min-width: 0 !important; }
  .documents-table thead { display: none; }
  .documents-table tbody { display: grid; gap: 0.75rem; }
  .documents-table tr {
    display: grid;
    gap: 0.45rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand-paper) 55%, #fff);
    box-shadow: var(--shadow-soft);
  }
  .documents-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0;
    border: 0;
    font-size: 0.95rem;
    min-width: 0;
  }
  .documents-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
    max-width: 42%;
  }
  .documents-table td:first-child {
    display: block;
    padding-bottom: 0.35rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid var(--line);
  }
  .documents-table td:first-child::before { display: none; }
  .documents-table td:last-child {
    display: block;
    padding-top: 0.35rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--line);
  }
  .documents-table td:last-child::before { display: none; }
}
/* Mobile: the deadlines table becomes a card list, like the members table. */
@media (max-width: 640px) {
  .deadlines-table { min-width: 0 !important; }
  .deadlines-table thead { display: none; }
  .deadlines-table tbody { display: grid; gap: 0.75rem; }
  .deadlines-table tr {
    display: grid;
    gap: 0.45rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand-paper) 55%, #fff);
    box-shadow: var(--shadow-soft);
  }
  .deadlines-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0;
    border: 0;
    font-size: 0.95rem;
    min-width: 0;
  }
  .deadlines-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
    max-width: 42%;
  }
  .deadlines-table td:first-child {
    display: block;
    padding-bottom: 0.35rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid var(--line);
  }
  .deadlines-table td:first-child::before { display: none; }
  .deadlines-table td:last-child {
    display: block;
    padding-top: 0.35rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--line);
  }
  .deadlines-table td:last-child::before { display: none; }
}
.inline-form { display: inline; margin: 0; }
.settings-plugins-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line, #d7dee7);
}
.settings-plugins-block .section-title {
  margin-bottom: 0.35rem;
}
.empty-state.compact {
  padding: 1rem 0.25rem;
}
.demo-banner {
  background: #fff3d6;
  color: #6b4a00;
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid #f0d48a;
}
.org-chart {
  --org-line: color-mix(in srgb, var(--brand-primary, #0D6E66) 35%, #98a2b3);
  --org-node-bg: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0.5rem 0.25rem 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.org-chart-panel {
  overflow: visible;
}
.org-chart-panel > .org-chart {
  width: 100%;
}
.org-tier {
  display: flex;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.org-assoc-root {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  text-align: left;
  padding: 0.75rem 1.15rem;
  border-radius: 18px;
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 24%, transparent);
  max-width: min(100%, 28rem);
}
.org-assoc-root:not(.has-logo) {
  text-align: center;
}
.org-assoc-logo {
  flex: 0 0 auto;
}
.org-assoc-logo-img,
img.org-assoc-logo-img {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 16%, transparent);
}
.org-assoc-text {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}
.org-assoc-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted, #667085);
}
.org-assoc-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--ink, #1a1a1a);
  line-height: 1.25;
  word-break: break-word;
}
.org-assoc-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  margin-top: 0.1rem;
}
.org-assoc-legal-code {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand-primary-deep, var(--brand-primary, #0D6E66));
}
.org-assoc-legal-label {
  font-size: 0.78rem;
  color: var(--muted, #667085);
  line-height: 1.3;
}
.org-spine {
  width: 2px;
  height: 1.15rem;
  background: var(--org-line);
  flex-shrink: 0;
  align-self: center;
}
.org-fork {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
}
.org-fork-stem {
  width: 2px;
  height: 0.85rem;
  background: var(--org-line);
}
.org-fork-bar {
  position: relative;
  width: 100%;
  height: 14px;
}
.org-fork-bar::before {
  content: "";
  position: absolute;
  left: calc(100% / 6);
  right: calc(100% / 6);
  top: 0;
  height: 2px;
  background: var(--org-line);
}
.org-fork-corner {
  position: absolute;
  top: 0;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
}
.org-fork-corner--left {
  left: calc(100% / 6);
  transform: translateX(-50%);
  border-top: 2px solid var(--org-line);
  border-left: 2px solid var(--org-line);
}
.org-fork-corner--right {
  left: calc(100% * 5 / 6);
  transform: translateX(-50%);
  border-top: 2px solid var(--org-line);
  border-right: 2px solid var(--org-line);
}
.org-fork-junction {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 12px;
  transform: translateX(-50%);
  background: var(--org-line);
}
.org-fork-legs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}
.org-fork-leg {
  justify-self: center;
  width: 2px;
  height: 0.85rem;
  background: var(--org-line);
}
.org-tier--exec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  width: 100%;
  max-width: 100%;
  align-items: start;
  align-self: stretch;
}
.org-tier-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
.org-chart-actions {
  align-items: center;
}
/* ── Organigramma: form persona (blocchi come “Nuovo socio”) ─────── */
.org-person-form {
  display: grid;
  gap: 1rem;
}
.org-person-form .org-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
  align-items: start;
}
.org-person-form .org-field-row--single {
  grid-template-columns: 1fr;
}
.org-person-form .geo-birth-host,
.org-person-form .geo-address-host {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.org-person-form .org-member-hint {
  margin: 0;
  font-size: 0.88rem;
}
.org-person-form .org-locked-hint {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}
.org-person-form .org-copy-fields.is-locked input,
.org-person-form .org-copy-fields.is-locked select,
.org-person-form .org-copy-fields.is-locked textarea {
  background: #f2f2f2;
  color: #4a4a4a;
}
.org-person-delete {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}
@media (max-width: 720px) {
  .org-person-form .org-field-row {
    grid-template-columns: 1fr;
  }
}
.org-add-organ-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.org-add-organ-form input[type="text"] {
  min-width: 11rem;
  max-width: 16rem;
}
.org-add-organ-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 0.5rem 0 0.25rem;
}
.org-tier--add-organ {
  width: 100%;
}
.org-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.org-group-head .org-group-title {
  margin: 0;
}
.org-group-head--stacked {
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.org-group-delete {
  margin: 0;
}
.org-group--custom {
  border-style: dashed;
  background: color-mix(in srgb, var(--brand-accent, #B84A1B) 6%, #fff);
}
.org-commissions-label {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--brand-accent-ink, #B84A1B);
}
.org-tier--commissions {
  margin-top: 0.25rem;
}
.org-node {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: var(--org-node-bg);
  border: 1px solid var(--line, #d7dee7);
  box-shadow: var(--shadow-soft, 0 8px 24px rgba(16, 24, 40, 0.06));
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
a.org-node:hover {
  text-decoration: none;
  color: inherit;
}
.org-node--clickable {
  cursor: pointer;
}
.org-node--clickable:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 40%, var(--line));
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.1);
}
.org-node--president {
  width: 100%;
  max-width: min(100%, 22rem);
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 40%, var(--line));
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 7%, #fff);
}
.org-node--mandate-expired {
  border-color: #c62828;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c62828 40%, transparent);
}
.org-node--mandate-soon {
  border-color: color-mix(in srgb, var(--brand-accent, #e8a317) 55%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-accent, #e8a317) 35%, transparent);
}
.org-node-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.org-node-link:hover {
  text-decoration: none;
  color: inherit;
}
.org-mandate-badge {
  display: inline-block;
  margin: 0.35rem 0 0.1rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: #c62828;
  text-decoration: none;
}
.org-mandate-badge--soon {
  color: #fff;
  background: color-mix(in srgb, var(--brand-accent, #e8a317) 88%, #8a4b00);
}
a.org-mandate-badge--soon:hover {
  filter: brightness(0.95);
  text-decoration: none;
  color: #fff;
}
.org-node--vacant,
.org-node--add {
  border-style: dashed;
  opacity: 0.9;
}
.org-node-role {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--brand-primary-deep, var(--brand-primary, #0D6E66));
}
.org-node-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink, #1a1a1a);
}
.org-node-mandate {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--muted, #667085);
  line-height: 1.3;
}
.org-node-action {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-primary, #0D6E66);
}
.org-tier--group {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
}
.org-group {
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line, #d7dee7);
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 4%, #fff);
}
.org-group--audit {
  background: color-mix(in srgb, var(--brand-accent, #B84A1B) 5%, #fff);
  border-color: color-mix(in srgb, var(--brand-accent, #B84A1B) 22%, var(--line));
}
.org-group-title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink, #1a1a1a);
}
.org-group-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.75rem;
  width: 100%;
  align-items: stretch;
}
.org-group-nodes .org-node {
  width: 100%;
  max-width: none;
  height: 100%;
}
.org-tier--assembly {
  width: 100%;
}
.org-node--assembly {
  width: min(100%, 28rem);
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 32%, var(--line));
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 6%, #fff);
}
.org-node-meta {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted, #667085);
  line-height: 1.35;
}
.org-node-meta.muted {
  font-style: italic;
}
.org-group--directors {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 7%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 28%, var(--line));
}
.org-group-lede {
  margin: 0.25rem 0 0;
  max-width: 36rem;
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted, #667085);
  line-height: 1.4;
}
.org-board-officers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
  width: 100%;
  align-items: start;
}
.org-board-officer-slot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
}
.org-board-officer-slot .org-node {
  width: 100%;
  max-width: none;
}
.org-board-members {
  border-top: 1px dashed color-mix(in srgb, var(--brand-primary, #0D6E66) 22%, var(--line));
  padding-top: 0.85rem;
}
.org-board-members-title {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted, #667085);
}
.org-group-nodes--board {
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  justify-content: start;
}
.org-group-nodes--board .org-node {
  max-width: 100%;
}
.org-tier--independent {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  gap: 0.65rem;
}
.org-independent-label,
.org-commissions-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted, #667085);
  text-align: center;
}
.org-independent-fork {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  position: relative;
}
.org-independent-fork-stem {
  width: 2px;
  height: 0.85rem;
  background: var(--org-line);
  align-self: center;
}
.org-independent-fork-bar {
  position: relative;
  width: 100%;
  height: 14px;
}
.org-independent-fork-bar::before {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  top: 0;
  height: 2px;
  background: var(--org-line);
}
.org-independent-fork-leg {
  position: absolute;
  top: 0;
  width: 2px;
  height: 14px;
  background: var(--org-line);
}
.org-independent-fork-leg--left {
  left: 25%;
  transform: translateX(-50%);
}
.org-independent-fork-leg--right {
  left: 75%;
  transform: translateX(-50%);
}
.org-independent-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  width: 100%;
  max-width: 100%;
  align-items: start;
  align-self: stretch;
}
.org-independent-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
}
.org-independent-branch .org-group {
  width: 100%;
}
.org-group--ombudsman {
  background: color-mix(in srgb, #6366f1 5%, #fff);
  border-color: color-mix(in srgb, #6366f1 22%, var(--line));
}
.org-tier--commissions {
  width: 100%;
  max-width: 100%;
}
@media (max-width: 820px) {
  .org-tier--exec {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .org-fork {
    width: 2px;
  }
  .org-fork-bar,
  .org-fork-legs {
    display: none;
  }
  .org-fork-stem {
    height: 1rem;
  }
  .org-tier--exec .org-tier-slot + .org-tier-slot {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--org-line);
    width: 100%;
    align-items: center;
  }
  .org-board-officers {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .org-board-officer-slot + .org-board-officer-slot {
    padding-top: 0.65rem;
    border-top: 1px dashed color-mix(in srgb, var(--brand-primary, #0D6E66) 18%, var(--line));
  }
  .org-independent-fork {
    width: 2px;
  }
  .org-independent-fork-bar,
  .org-independent-fork-leg {
    display: none;
  }
  .org-independent-split {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .org-independent-branch + .org-independent-branch {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--org-line);
    width: 100%;
  }
}
.doc-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.doc-status-draft { background: #eef2f6; color: #475467; }
.doc-status-approved { background: #e8f7ee; color: #0f7a48; }
.doc-status-signed { background: #ede9fe; color: #5925dc; }
.dashboard-tabs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dashboard-tablist-wrap {
  position: relative;
  min-width: 0;
}
.dashboard-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 14%, var(--line, #d7dee7));
}
.dashboard-tablist-nav {
  display: none;
}
.dashboard-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink, #1a1a1a);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.dashboard-tab:hover {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 10%, #fff);
}
.dashboard-tab[aria-selected="true"] {
  background: #fff;
  color: var(--brand-primary-deep, var(--brand-primary, #0D6E66));
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
}
.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dashboard-panel[hidden] {
  display: none !important;
}
.dashboard-panel-header {
  margin: 0;
  padding: 0 0.15rem;
  border-bottom: 0;
}
.dashboard-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dashboard-module {
  margin: 0;
}
.dashboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dashboard-list-link,
.deadline-link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0;
  border-radius: 8px;
}
.dashboard-list-link:hover,
.deadline-link:hover {
  text-decoration: none;
  color: inherit;
}
.dashboard-list-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.dashboard-org-summary {
  display: grid;
  gap: 0.65rem;
}
.dashboard-org-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.deadline-list.compact .deadline-item {
  list-style: none;
}
@media (max-width: 960px) {
  .dashboard-modules {
    grid-template-columns: 1fr;
  }
  .dashboard-tablist-wrap {
    margin: 0 -0.15rem;
  }
  .dashboard-tablist-wrap::before,
  .dashboard-tablist-wrap::after {
    content: "";
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 1.65rem;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
  }
  .dashboard-tablist-wrap::before {
    left: 0;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(
      to right,
      color-mix(in srgb, var(--brand-primary, #0D6E66) 10%, #fff) 35%,
      transparent
    );
  }
  .dashboard-tablist-wrap::after {
    right: 0;
    border-radius: 0 16px 16px 0;
    background: linear-gradient(
      to left,
      color-mix(in srgb, var(--brand-primary, #0D6E66) 10%, #fff) 35%,
      transparent
    );
  }
  .dashboard-tablist-wrap.is-fade-start::before,
  .dashboard-tablist-wrap.is-fade-end::after {
    opacity: 1;
  }
  .dashboard-tablist-nav {
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, #fff 88%, var(--brand-primary, #0D6E66));
    box-shadow: 0 1px 6px rgba(16, 24, 40, 0.14);
    color: var(--brand-primary-deep, var(--brand-primary, #0D6E66));
    transform: translateY(-50%);
    cursor: pointer;
  }
  .dashboard-tablist-nav[hidden] {
    display: none !important;
  }
  .dashboard-tablist-nav-prev {
    left: 0.15rem;
  }
  .dashboard-tablist-nav-next {
    right: 0.15rem;
  }
  .dashboard-tablist-nav span {
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
  }
  .dashboard-tablist-nav-prev span {
    margin-left: -0.1rem;
    border-width: 0.28rem 0.38rem 0.28rem 0;
    border-color: transparent currentColor transparent transparent;
  }
  .dashboard-tablist-nav-next span {
    margin-right: -0.1rem;
    border-width: 0.28rem 0 0.28rem 0.38rem;
    border-color: transparent transparent transparent currentColor;
  }
  .dashboard-tablist {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    padding: 0.25rem 1.15rem;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .dashboard-tablist::-webkit-scrollbar {
    display: none;
  }
  .dashboard-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
  }
  .dashboard-tab[aria-selected="true"] {
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.1);
  }
}
.dashboard-deadlines { margin-bottom: 1rem; }

.doc-new-category {
  margin-top: 0.65rem;
}
.doc-new-category[hidden] {
  display: none;
}

.form-actions-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.config-accordion-body form[data-leave-guard] > button[type="submit"] {
  display: block;
  margin-top: 1rem;
  margin-left: auto;
}
.category-attention {
  animation: category-attention 0.72s ease-in-out 3;
}
@keyframes category-attention {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-accent) 0%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-accent) 28%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .category-attention {
    animation: none;
    outline: 3px solid color-mix(in srgb, var(--brand-accent) 35%, transparent);
  }
}
.setup-color-picker-grid {
  gap: 0.85rem;
}
.setup-color-picker-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-paper) 70%, white);
}
.setup-color-picker-control {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  align-items: center;
  gap: 0.8rem;
}
.setup-color-picker-control input[type="color"] {
  width: 4.25rem;
  min-height: 3rem;
  padding: 0.2rem;
  cursor: pointer;
}
.setup-color-picker-control code {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}
.setup-password-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.setup-password-copy-btn {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--line));
}
.setup-password-copy-btn.is-copied {
  color: #1a7a3c;
  border-color: color-mix(in srgb, #1a7a3c 40%, var(--line));
}
.setup-password-copy-ok {
  color: #1a7a3c !important;
  font-weight: 650;
}
.setup-component-row-locked,
.setup-component-row-core {
  cursor: default;
  opacity: 1;
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, transparent);
}
.setup-component-row-core:hover {
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, transparent);
}
.setup-component-row-locked input[type="checkbox"]:disabled {
  opacity: 1;
}
.setup-enrollment {
  display: grid;
  gap: 0.85rem;
}
.setup-enrollment .setup-field-label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--brand-primary-deep);
}
.setup-enrollment-cards {
  display: grid;
  gap: 0.65rem;
}
.setup-enrollment-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  cursor: pointer;
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 14px;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.setup-enrollment-card > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.setup-enrollment-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 10%, white);
  flex-shrink: 0;
}
.setup-enrollment-card-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.setup-enrollment-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.setup-enrollment-card-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}
.setup-enrollment-card-note {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--brand-primary-deep) 72%, var(--muted));
}
.setup-enrollment-card-lock {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}
.setup-enrollment-card:hover:not(.is-disabled) {
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, transparent);
}
.setup-enrollment-card.is-selected,
.setup-enrollment-card:has(> input:checked) {
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  border-color: color-mix(in srgb, var(--brand-primary) 45%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 22%, transparent);
}
.setup-enrollment-card.is-selected .setup-enrollment-card-title,
.setup-enrollment-card:has(> input:checked) .setup-enrollment-card-title {
  color: var(--brand-primary-deep);
}
.setup-enrollment-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: color-mix(in srgb, var(--surface) 70%, #fff);
  filter: grayscale(0.25);
}
.setup-enrollment-otp-hint {
  margin: 0;
  line-height: 1.5;
}
.setup-enrollment-otp-hint.is-emphasised {
  color: var(--brand-primary-deep);
  font-weight: 650;
}
.setup-enrollment-mail-link {
  display: inline-block;
  margin-left: 0.25rem;
  font-weight: 700;
}
.setup-enrollment-detail {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--brand-paper) 55%, white);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 14%, var(--line));
  line-height: 1.55;
  font-size: 0.9rem;
}
.setup-enrollment-detail[hidden] { display: none !important; }
@media (min-width: 720px) {
  .setup-enrollment-cards {
    grid-template-columns: 1fr 1fr;
  }
}
.setup-password-strength {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.setup-password-strength .setup-field-label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.password-complexity {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 0;
}
.setup-admin-locale {
  margin-top: 1.25rem;
}
.password-complexity span {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--line);
  transition: background 160ms ease;
}
.password-complexity span.is-active {
  background: var(--brand-primary);
}
.member-payment-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
}
.doc-archive {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}
.doc-archive-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.doc-archive-group-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink, #1a1a1a);
}
.doc-archive-group-count {
  font-size: 0.85rem;
  font-weight: 700;
}
.doc-archive-group .table-wrap {
  margin: 0;
}
.doc-archive-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  max-width: 100%;
}
.doc-archive-search input[type="search"] {
  min-width: min(100%, 14rem);
  width: 16rem;
  max-width: 100%;
  margin: 0;
}
tr.doc-row-editable {
  cursor: pointer;
  transition: background 0.12s ease;
}
tr.doc-row-editable:hover,
tr.doc-row-editable:focus-visible {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 7%, #fff);
}
tr.doc-row-editable:focus {
  outline: none;
}
tr.doc-row-editable:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 45%, transparent);
  outline-offset: -2px;
}
.doc-row-actions {
  cursor: default;
}

.doc-file-field .doc-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.doc-file-field .file-btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.doc-file-field .file-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.doc-file-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 12rem;
}
.doc-file-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
  color: var(--ink, #1a1a1a);
}
.doc-file-name[hidden] { display: none; }
.doc-file-status {
  font-size: 0.82rem;
  line-height: 1.3;
}
.doc-file-field .doc-file-status,
.doc-file-field .doc-file-hint {
  /* Pezza giustificativa: testo secondario ma leggibile (prima era grigio su grigio). */
  color: color-mix(in srgb, var(--ink, #1a1a1a) 74%, transparent);
}
.doc-file-hint {
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 500;
}
.doc-file-progress {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.2rem;
  max-width: 18rem;
}
.doc-file-progress[hidden] {
  display: none;
}
.doc-file-progress-track {
  flex: 1;
  height: 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 12%, #e8edf2);
  overflow: hidden;
}
.doc-file-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--brand-primary, #0D6E66);
  transition: width 0.12s linear;
}
.doc-file-progress-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
  min-width: 2.4rem;
  text-align: right;
}
.doc-file-field.is-uploading .doc-file-status {
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
  font-weight: 700;
}
.doc-file-field.is-uploaded {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 22%, transparent);
}
.doc-file-field.is-uploaded .doc-file-status {
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
  font-weight: 700;
}
.doc-file-field.is-error .doc-file-status {
  color: #b42318;
  font-weight: 700;
}

/* Archivio documenti: i 4 KPI restano sulla stessa riga (prima il quarto andava a capo). */
.stats-context-documents {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .stats-context-documents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .stats-context-documents {
    grid-template-columns: 1fr;
  }
}

/* Form documento: riga a 4 colonne (titolo 50%, numero e data 25% ciascuno). */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.grid-span-2 {
  grid-column: span 2;
}
@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .grid-span-2 {
    grid-column: span 1;
  }
}

/* Libri sociali obbligatori (art. 15 CTS): i tre blocchi dei verbali. */
.documents-minutes .panel-header {
  margin-bottom: 0.75rem;
}
.documents-minutes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 900px) {
  .documents-minutes-grid {
    grid-template-columns: 1fr;
  }
}
.documents-minutes-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 18%, var(--line, #e4e7ec));
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 6%, #ffffff);
}
.documents-minutes-card.is-missing {
  border-color: color-mix(in srgb, #c9842a 34%, var(--line, #e4e7ec));
  background: color-mix(in srgb, #c9842a 8%, #ffffff);
}
.documents-minutes-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink, #1a1a1a) 72%, transparent);
}
.documents-minutes-count {
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 800;
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
}
.documents-minutes-meta {
  font-size: 0.82rem;
  line-height: 1.35;
}
.documents-minutes-warning {
  font-size: 0.82rem;
  font-weight: 700;
  color: #a16207;
}
.documents-minutes-card .btn {
  margin-top: 0.55rem;
  align-self: flex-start;
}

/* Upload documento: riquadro tratteggiato con drag & drop. */
.doc-file-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.doc-dropzone {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 2px dashed color-mix(in srgb, var(--brand-primary, #0D6E66) 32%, var(--line, #e4e7ec));
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 4%, #ffffff);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.doc-dropzone.is-dragging {
  border-color: var(--brand-primary, #0D6E66);
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 11%, #ffffff);
}
.doc-dropzone-icon {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
}
.doc-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.doc-dropzone-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}
.doc-dropzone-meta {
  font-size: 0.78rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink, #1a1a1a) 66%, transparent);
}
.doc-dropzone-pick {
  margin-left: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}
.doc-dropzone .sf-field {
  display: block;
  margin: 0;
}
.doc-dropzone-pick:hover {
  color: var(--brand-primary, #0D6E66);
}
.doc-file-field.is-uploaded .doc-dropzone {
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 8%, #ffffff);
  border-style: solid;
}

/* Ledger filters: one row on desktop — search + period/type/category/account/sort + grouping. */
@media (min-width: 961px) {
  .treasury-filter-row {
    grid-template-columns: minmax(11rem, 2fr) repeat(5, minmax(7rem, 1fr)) auto auto;
  }
}
.treasury-filter-group,
.treasury-filter-reset {
  align-self: end;
}
.treasury-filter-group .field-label {
  font-weight: 600;
}

/* ── Conti finanziari: prospetto saldi sotto le KPI del libro mastro ── */
.treasury-wallets { margin-top: 1rem; }
.treasury-wallets-head { margin-bottom: 0.75rem; }
.treasury-wallets-head .section-title { margin: 0; }
.treasury-wallets-head .section-lede { margin: 0.15rem 0 0; }
.treasury-wallets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.7rem;
}
.treasury-wallet {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 3%, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.treasury-wallet:hover,
.treasury-wallet.is-active {
  border-color: color-mix(in srgb, var(--brand-primary, #0D6E66) 55%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary, #0D6E66) 22%, transparent);
}
.treasury-wallet.is-inactive { opacity: 0.72; }
.treasury-wallet-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}
.treasury-wallet-balance {
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
  color: var(--brand-primary-ink, var(--brand-primary, #0D6E66));
}
.treasury-wallet-balance.is-negative { color: #b42318; }
.treasury-wallet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.treasury-wallet-meta .is-income { color: #0f7a48; }
.treasury-wallet-meta .is-expense { color: #b42318; }
.treasury-wallet-meta .is-transfer { color: #5b6472; }
.treasury-wallet-meta .is-muted { color: var(--muted, #667085); }
/* Saldo dei conti mostrato nelle option; avviso quando «A conto» = «Da conto». */
.treasury-transfer-notice {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b42318;
}
/* ── Impostazioni → Conti finanziari ── */
.accounts-admin { display: grid; gap: 0.55rem; margin-bottom: 1rem; }
.accounts-admin-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface, #fff) 96%, var(--ink) 4%);
}
.accounts-admin-row.is-inactive { opacity: 0.65; }
.accounts-admin-form {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(160px, 1.4fr) auto auto;
  align-items: end;
  gap: 0.6rem 0.85rem;
}
.accounts-admin-identity { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; padding-bottom: 0.35rem; }
.accounts-admin-slug {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #667085);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.accounts-admin-meta { font-size: 0.72rem; line-height: 1.25; }
.accounts-admin-label { min-width: 0; }
.accounts-admin-toggle { padding-bottom: 0.45rem; white-space: nowrap; }
.accounts-admin-save { align-self: end; }
.accounts-admin-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 8.5rem;
  padding-top: 1.35rem;
}
.accounts-admin-locked { font-size: 0.72rem; text-align: right; line-height: 1.25; }
.accounts-admin-delete { margin: 0; }
.accounts-admin-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
  padding-top: 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
@media (max-width: 960px) {
  .accounts-admin-row { flex-direction: column; }
  .accounts-admin-form { grid-template-columns: 1fr 1fr; }
  .accounts-admin-identity { grid-column: 1 / -1; padding-bottom: 0; }
  .accounts-admin-side { padding-top: 0; min-width: 0; justify-content: flex-start; }
  .accounts-admin-add { grid-template-columns: 1fr; }
}

.treasury-form-panel {
  margin-bottom: 1rem;
}
/* Prima cassa: form movimento su pagina dedicata (stesso layout del modale). */
/* ── Entrata / Uscita: pulsanti grandi con stato attivo inequivocabile ── */
.treasury-direction-field {
  margin-bottom: 1.1rem;
}
.treasury-direction-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 560px) {
  .treasury-direction-cards {
    grid-template-columns: 1fr;
  }
}
.treasury-direction-cards .tessera-choice-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 4.75rem;
  padding: 0.95rem 1rem;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 16px;
}
.treasury-direction-cards .tessera-choice-card-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 13px;
  background: color-mix(in srgb, var(--ink) 7%, #fff);
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}
.treasury-direction-cards .tessera-choice-card-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
}
.treasury-direction-cards .is-income.is-selected,
.treasury-direction-cards .is-income:has(> input:checked) {
  background: #0f7a48;
  border-color: #0b5c36;
  box-shadow: 0 10px 22px color-mix(in srgb, #0f7a48 34%, transparent);
}
.treasury-direction-cards .is-expense.is-selected,
.treasury-direction-cards .is-expense:has(> input:checked) {
  background: #b42318;
  border-color: #8f1c13;
  box-shadow: 0 10px 22px color-mix(in srgb, #b42318 32%, transparent);
}
.treasury-direction-cards .is-transfer.is-selected,
.treasury-direction-cards .is-transfer:has(> input:checked) {
  background: #5b6472;
  border-color: #474e59;
  box-shadow: 0 10px 22px color-mix(in srgb, #5b6472 30%, transparent);
}
.treasury-direction-cards .is-income.is-selected .tessera-choice-card-title,
.treasury-direction-cards .is-income:has(> input:checked) .tessera-choice-card-title,
.treasury-direction-cards .is-expense.is-selected .tessera-choice-card-title,
.treasury-direction-cards .is-expense:has(> input:checked) .tessera-choice-card-title,
.treasury-direction-cards .is-transfer.is-selected .tessera-choice-card-title,
.treasury-direction-cards .is-transfer:has(> input:checked) .tessera-choice-card-title {
  color: #fff;
}
.treasury-direction-cards .is-income.is-selected .tessera-choice-card-icon,
.treasury-direction-cards .is-income:has(> input:checked) .tessera-choice-card-icon,
.treasury-direction-cards .is-expense.is-selected .tessera-choice-card-icon,
.treasury-direction-cards .is-expense:has(> input:checked) .tessera-choice-card-icon,
.treasury-direction-cards .is-transfer.is-selected .tessera-choice-card-icon,
.treasury-direction-cards .is-transfer:has(> input:checked) .tessera-choice-card-icon {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}
.treasury-direction-cards .tessera-choice-card.is-selected::after,
.treasury-direction-cards .tessera-choice-card:has(> input:checked)::after {
  content: '✓';
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.treasury-direction-cards .tessera-choice-card:not(.is-selected):not(:has(> input:checked)):hover {
  background: color-mix(in srgb, var(--ink) 4%, #fff);
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
}
/* Rete di sicurezza: se una classe "is-selected" rimane indietro, il pulsante
   non si colora — lo stato reale è sempre quello del radio selezionato. */
.treasury-direction-cards .tessera-choice-card.is-selected:not(:has(> input:checked)) {
  background: #fff;
  border-color: color-mix(in srgb, var(--ink) 16%, transparent);
  box-shadow: none;
}
.treasury-direction-cards .tessera-choice-card.is-selected:not(:has(> input:checked)) .tessera-choice-card-title {
  color: color-mix(in srgb, var(--ink) 72%, transparent);
}
.treasury-direction-cards .tessera-choice-card.is-selected:not(:has(> input:checked)) .tessera-choice-card-icon {
  background: color-mix(in srgb, var(--ink) 7%, #fff);
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}
.treasury-direction-cards .tessera-choice-card.is-selected:not(:has(> input:checked))::after {
  content: none;
}
.treasury-form-row {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.9rem;
}
/* Rows are grids, so `hidden` needs an explicit rule to beat `display: grid`. */
.treasury-form-row[hidden] {
  display: none;
}
/* Importo · Data · Conto («Da conto») · Metodo («A conto») */
.treasury-form-row--economy {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
}
/* Cassa contanti: il metodo è implicito, la riga resta a tre colonne. */
@media (min-width: 961px) {
  .treasury-form-row--economy:has([data-treasury-method-wrap][hidden]):not(:has([data-treasury-transfer-fields]:not([hidden]))) {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.25fr);
  }
}
/* Categoria (50%) · N. documento (30%) · Data documento (20%) */
.treasury-form-row--docs {
  grid-template-columns: 5fr 3fr 2fr;
  align-items: start;
}
/* The two document fields keep their 30/20 share inside their own wrapper. */
.treasury-doc-fields {
  display: grid;
  grid-column: 2 / -1;
  grid-template-columns: 3fr 2fr;
  gap: 0.85rem;
  align-items: start;
}
/* "Pagamento fattura" active: invoice data live in their block, so Categoria owns the row. */
@media (min-width: 961px) {
  .treasury-form-row--docs:has([data-treasury-doc-fields][hidden]) {
    grid-template-columns: 1fr;
  }
}
.treasury-form-row--single {
  grid-template-columns: 1fr;
}
.treasury-soggetto-fields,
.treasury-attach-fields {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}
/* Fixed € inside the amount control (associations work in EUR). */
.treasury-amount-field {
  position: relative;
}
.treasury-amount-field input {
  padding-right: 2.1rem;
}
.treasury-amount-field::after {
  content: '€';
  position: absolute;
  right: 0.8rem;
  bottom: 0.72rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  pointer-events: none;
}
.treasury-attach-lede {
  margin: 0;
}
.treasury-invoice-fields {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.35rem;
}
@media (min-width: 961px) {
  .treasury-invoice-fields {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
  }
}
@media (max-width: 960px) {
  .treasury-form-row--economy,
  .treasury-form-row--docs,
  .treasury-doc-fields {
    grid-template-columns: 1fr;
  }
  .treasury-doc-fields {
    grid-column: auto;
  }
}
.treasury-invoice-block {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-primary, #0D6E66) 5%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary, #0D6E66) 16%, var(--line, #d7dee7));
}
.treasury-invoice-fields {
  display: grid;
  gap: 0.75rem;
}
.treasury-form-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  user-select: none;
}
.treasury-form-panel > summary::-webkit-details-marker { display: none; }
.treasury-form-summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.treasury-form-summary-text .section-title { margin: 0; font-size: 1.05rem; }
.treasury-form-summary-text .section-lede { margin: 0; }
.treasury-form-chevron {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  opacity: 0.55;
}
.treasury-form-panel[open] .treasury-form-chevron {
  transform: rotate(-135deg);
  margin-top: 0.35rem;
}
.treasury-form-body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid color-mix(in srgb, var(--border, #d0d7de) 80%, transparent);
}
.doc-file-preview {
  margin-top: 0.35rem;
  width: min(100%, 12rem);
  aspect-ratio: 3 / 4;
  border: 1px solid color-mix(in srgb, var(--border, #d0d7de) 85%, transparent);
  border-radius: 0.35rem;
  overflow: hidden;
  background: #f8f9fa;
}
.doc-file-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* Image attachments: show the photo as-is instead of a page-shaped frame. */
.doc-file-preview.is-image {
  aspect-ratio: auto;
  max-height: 14rem;
}
.doc-file-preview.is-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 14rem;
  object-fit: contain;
}
.doc-file-archive-link {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.15rem;
}
.treasury-type-row [data-treasury-sign-wrap] select {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}


.stats a.stat {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.stats a.stat:hover,
.stats a.stat.is-active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 45%, transparent);
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--line));
}

/* ── Prima cassa: panoramica compatta (saldo + conti in un solo pannello) ── */
.treasury-overview { display: grid; gap: 0.9rem; padding: 1rem 1.15rem; }
.treasury-overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  flex-wrap: wrap;
}
.treasury-overview-label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #667085);
}
.treasury-overview-value {
  font-size: 1.85rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.treasury-overview-value.is-negative { color: #b42318; }
.treasury-overview-flows { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.treasury-overview-flows span {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.treasury-overview-flows .is-income { background: color-mix(in srgb, #12805c 12%, transparent); color: #0f6b4d; }
.treasury-overview-flows .is-expense { background: color-mix(in srgb, #b42318 12%, transparent); color: #9a1c12; }
.treasury-overview-actions { display: flex; gap: 0.5rem; }
.treasury-wallets-grid.is-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.5rem;
}
.treasury-wallets-grid.is-compact .treasury-wallet { padding: 0.55rem 0.7rem; }
.treasury-wallet-flag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9a1c12;
}

/* ── Bilancio preventivo ── */
.budget-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #667085);
}
.budget-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.budget-badge.is-draft { background: color-mix(in srgb, #b54708 14%, transparent); color: #92400e; }
.budget-badge.is-approved { background: color-mix(in srgb, #12805c 14%, transparent); color: #0f6b4d; }
.budget-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.budget-header-actions form { margin: 0; }
.budget-locked-note {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  background: color-mix(in srgb, var(--brand-primary, #2563eb) 8%, transparent);
  color: var(--ink, #16181d);
}
.budget-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.budget-card { display: grid; gap: 0.75rem; padding: 0.95rem 1.05rem; }
.budget-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.budget-card-year { margin: 0; font-size: 1.35rem; line-height: 1.1; }
.budget-card-title { margin: 0.15rem 0 0; font-size: 0.82rem; }
.budget-card-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0; }
.budget-card-kpis dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted, #667085); }
.budget-card-kpis dd { margin: 0.15rem 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.budget-card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.budget-empty { padding: 1.1rem 1.25rem; display: grid; gap: 0.35rem; margin-bottom: 1.25rem; }
.budget-create { padding: 1.1rem 1.25rem 1.25rem; }
.budget-create-row {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.2fr) minmax(0, 0.6fr);
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.budget-template-picker { border: 0; padding: 0; margin: 0 0 0.9rem; }
.budget-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
  margin-top: 0.45rem;
}
.budget-template-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--ink, #16181d) 12%, transparent);
  border-radius: 12px;
  cursor: pointer;
}
.budget-template-option:has(input:checked) {
  border-color: var(--brand-primary, #2563eb);
  background: color-mix(in srgb, var(--brand-primary, #2563eb) 8%, transparent);
}
.budget-template-option input { margin-top: 0.2rem; }
.budget-template-body { display: grid; gap: 0.15rem; font-size: 0.84rem; line-height: 1.3; }
.budget-csv-field { display: grid; gap: 0.3rem; margin: 0 0 0.9rem; }
.budget-csv-input {
  max-width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0;
}


/* Griglia preventivo: sezioni espandibili, righe compatte */
.budget-grid-form { display: grid; gap: 0.85rem; }
.budget-grid { display: grid; gap: 0.85rem; counter-reset: budget-section; }
.budget-section {
  border: 1px solid color-mix(in srgb, var(--ink, #16181d) 12%, transparent);
  border-radius: 16px;
  background: var(--surface, #fff);
  padding: 0.75rem 0.9rem 0.85rem;
}
.budget-section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.budget-section-index::before {
  counter-increment: budget-section;
  content: counter(budget-section, decimal-leading-zero);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #667085);
  font-variant-numeric: tabular-nums;
}
.budget-section-title {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 0.32rem 0.45rem;
}
.budget-section-title:hover { border-color: color-mix(in srgb, var(--ink, #16181d) 12%, transparent); }
.budget-section-title:focus {
  outline: none;
  border-color: var(--brand-primary, #2563eb);
  background: #fff;
}
.budget-section-total {
  display: flex;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.budget-section-total-sep { color: var(--muted, #667085); }
.budget-remove {
  border: 0;
  background: transparent;
  color: var(--muted, #667085);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
}
.budget-remove:hover { background: color-mix(in srgb, #b42318 12%, transparent); color: #9a1c12; }
.budget-table { width: 100%; border-collapse: collapse; }
.budget-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #667085);
  font-weight: 600;
  padding: 0.3rem 0.4rem;
  text-align: left;
}
.budget-table td { padding: 0.22rem 0.4rem; vertical-align: middle; }
.budget-th-amount { text-align: right; }
.budget-input, .budget-select {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.38rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--ink, #16181d) 14%, transparent);
  border-radius: 9px;
  background: #fff;
}
.budget-input:focus, .budget-select:focus { outline: 2px solid color-mix(in srgb, var(--brand-primary, #2563eb) 45%, transparent); border-color: var(--brand-primary, #2563eb); }
.budget-cell-category { width: 22%; }
.budget-cell-direction { width: 12%; }
.budget-cell-amount { width: 16%; }
.budget-cell-actions { width: 2.2rem; text-align: right; }
.budget-amount-wrap { position: relative; display: flex; align-items: center; }
.budget-amount { text-align: right; padding-right: 1.9rem; font-variant-numeric: tabular-nums; }
.budget-amount-currency {
  position: absolute;
  right: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted, #667085);
  pointer-events: none;
}
.budget-add-row { margin-top: 0.4rem; }
.budget-grid-tools { display: flex; justify-content: flex-start; }
.budget-summary {
  position: sticky;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand-primary, #2563eb) 22%, transparent);
  background: color-mix(in srgb, var(--brand-primary, #2563eb) 6%, #fff);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink, #16181d) 8%, transparent);
  z-index: 5;
}
.budget-summary-kpis { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.budget-summary-item { display: grid; gap: 0.1rem; }
.budget-summary-item span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #667085);
}
.budget-summary-item strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.budget-summary-need strong { color: var(--brand-primary, #2563eb); }
.budget-danger { margin-top: 1.5rem; display: flex; justify-content: flex-end; }


/* Confronto preventivo / consuntivo */
.budget-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.budget-kpi {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--ink, #16181d) 10%, transparent);
  background: var(--surface, #fff);
}
.budget-kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #667085);
}
.budget-kpi strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.budget-kpi-meta { font-size: 0.76rem; color: var(--muted, #667085); }
.budget-kpi-need { border-color: color-mix(in srgb, var(--brand-primary, #2563eb) 40%, transparent); }
.budget-kpi-need strong { color: var(--brand-primary, #2563eb); }
.budget-alerts {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #b42318 35%, transparent);
  background: color-mix(in srgb, #b42318 8%, #fff);
}
.budget-alerts ul { margin: 0.45rem 0 0.35rem 1.1rem; padding: 0; }
.budget-alerts li { margin-bottom: 0.2rem; font-size: 0.88rem; }
.budget-alerts-note { margin: 0; font-size: 0.82rem; color: #7a271a; }
.budget-compare-section { padding: 0.95rem 1.1rem 1.05rem; margin-bottom: 0.85rem; }
.budget-compare-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.budget-compare-totals { font-size: 0.82rem; }
.budget-compare-table { width: 100%; border-collapse: collapse; }
.budget-compare-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #667085);
  font-weight: 600;
  padding: 0.35rem 0.45rem;
  text-align: left;
}
.budget-compare-table td {
  padding: 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--ink, #16181d) 8%, transparent);
  font-variant-numeric: tabular-nums;
}
.budget-compare-row.is-over td { background: color-mix(in srgb, #b42318 6%, transparent); }
.budget-compare-row.is-warning td { background: color-mix(in srgb, #b54708 5%, transparent); }
.budget-compare-label { font-weight: 600; }
.budget-compare-category { display: block; font-size: 0.72rem; }
.budget-th-amount { text-align: right; }
.budget-th-progress { width: 22%; min-width: 140px; }
.budget-compare-table .is-negative { color: #b42318; }
.budget-progress {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  --budget-bar: #12805c;
}
.budget-progress[data-status="warning"] { --budget-bar: #dc8a16; }
.budget-progress[data-status="over"] { --budget-bar: #b42318; }
.budget-progress-track {
  flex: 1 1 auto;
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink, #16181d) 10%, transparent);
  overflow: hidden;
}
.budget-progress-bar {
  display: block;
  height: 100%;
  width: calc(var(--pct, 0) * 1%);
  background: var(--budget-bar);
  border-radius: inherit;
  transition: width 0.2s ease;
}
.budget-progress-label { font-size: 0.76rem; color: var(--muted, #667085); min-width: 3.2rem; text-align: right; }
.budget-status {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.budget-status.ok { background: color-mix(in srgb, #12805c 14%, transparent); color: #0f6b4d; }
.budget-status.warning { background: color-mix(in srgb, #b54708 16%, transparent); color: #92400e; }
.budget-status.over { background: color-mix(in srgb, #b42318 16%, transparent); color: #9a1c12; }
.budget-unallocated { border-style: dashed; }
.budget-compare-footer { margin: 0.35rem 0 1rem; font-size: 0.82rem; }
.budget-impute-field { margin-top: 0.75rem; }
@media (max-width: 760px) {
  .budget-create-row { grid-template-columns: 1fr; }
  .budget-th-progress { width: auto; min-width: 110px; }
  .budget-progress-label { display: none; }
  .budget-summary { position: static; }
}
