/* Invite modal (invite.js). Reads the semantic tokens from polpo.css, so themes flow through. */
#polpo-set-row-invite[hidden] { display: none; }

#polpo-invite-modal {
  position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center;
  padding: 4vh 16px; background: var(--scrim, rgba(16, 16, 22, .38)); animation: m-fade var(--dur, 200ms) ease-out;
}
#polpo-invite-modal.open { display: flex; }
.polpo-inv-panel {
  display: flex; flex-direction: column; width: min(620px, 100%); max-height: 90vh; overflow: hidden;
  border-radius: var(--r-lg, 20px); background: var(--surface, #fff); color: var(--text, #1a1a1a);
  border: 1px solid var(--border); box-shadow: var(--e3); font-family: var(--font);
  animation: m-materialize var(--dur-enter, 230ms) var(--spring, ease-out);
}
.polpo-inv-head {
  display: flex; align-items: center; gap: 12px; flex: none; padding: 12px 14px 12px 20px;
  border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 650;
}
.polpo-inv-title { margin-right: auto; }
.polpo-inv-close {
  width: 32px; height: 32px; border: 0; border-radius: var(--r-sm, 10px); background: transparent;
  color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer;
}
.polpo-inv-close:hover { background: var(--surface-2); color: var(--text); }
.polpo-inv-body { overflow: auto; padding: 18px 20px 20px; }
.polpo-inv-sub, .polpo-inv-label, .polpo-inv-roles legend {
  margin: 0 0 8px; padding: 0; color: var(--text-2); font-size: 12px; font-weight: 600;
}
.polpo-inv-sub { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.polpo-inv-muted { margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.polpo-inv-error, .polpo-inv-warn { margin: 0 0 12px; color: var(--danger-ink); font-size: 13px; line-height: 1.5; }
.polpo-inv-error[hidden] { display: none; }
.polpo-inv-warn { display: block; margin: 2px 0 0; font-size: 12px; }

#polpo-inv-form { display: flex; flex-direction: column; gap: 16px; }
.polpo-inv-roles { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.polpo-inv-role {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-sm, 10px); transition: border-color var(--dur-fast, 120ms), background var(--dur-fast, 120ms);
}
.polpo-inv-role:hover { background: var(--surface-2); }
.polpo-inv-role:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.polpo-inv-role input { margin: 3px 0 0; accent-color: var(--brand); }
.polpo-inv-role span, .polpo-inv-board > span, .polpo-inv-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.polpo-inv-role strong, .polpo-inv-board strong, .polpo-inv-who strong { font-size: 13.5px; font-weight: 600; }
.polpo-inv-role small, .polpo-inv-board small, .polpo-inv-who small, .polpo-inv-field small { color: var(--text-3); font-size: 12px; line-height: 1.45; }
.polpo-inv-is-admin .polpo-inv-role:has(input[value="admin"]:checked) { border-color: var(--warn); background: var(--warn-soft); }

.polpo-inv-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.polpo-inv-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.polpo-inv-field > span { color: var(--text-2); font-size: 12px; font-weight: 600; }
.polpo-inv-field em { color: var(--text-faint); font-style: normal; font-weight: 500; }
.polpo-inv-panel :is(input:not([type="radio"]), select) {
  width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm, 10px);
  background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px;
}
.polpo-inv-panel :is(input, select):focus-visible { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

.polpo-inv-boards { display: flex; flex-direction: column; gap: 6px; }
.polpo-inv-board {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm, 10px);
}
.polpo-inv-panel .polpo-inv-board select { width: auto; min-width: 160px; flex: none; }

.polpo-inv-actions { display: flex; justify-content: flex-end; }
.polpo-inv-primary, .polpo-inv-secondary {
  min-height: 38px; padding: 0 16px; border-radius: var(--r-sm, 10px); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background var(--dur-fast, 120ms), transform var(--dur-press, 110ms);
}
.polpo-inv-primary { border: 0; background: var(--brand); color: #fff; }
.polpo-inv-primary:hover { background: var(--brand-strong); }
.polpo-inv-secondary { border: 1px solid var(--border); background: var(--btn, transparent); color: var(--text); }
.polpo-inv-secondary:hover { background: var(--btn-hover, var(--surface-2)); }
:is(.polpo-inv-primary, .polpo-inv-secondary):active { transform: scale(.98); }
:is(.polpo-inv-primary, .polpo-inv-secondary):disabled { opacity: .55; cursor: default; transform: none; }

.polpo-inv-done { display: flex; flex-direction: column; gap: 12px; }
.polpo-inv-done > p:first-child { margin: 0; font-size: 13.5px; line-height: 1.55; }
.polpo-inv-link { display: flex; gap: 8px; }
.polpo-inv-link input { font-family: var(--mono); font-size: 12.5px !important; }
.polpo-inv-done .polpo-inv-secondary { align-self: flex-start; }

.polpo-inv-list { display: flex; flex-direction: column; gap: 6px; }
.polpo-inv-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm, 10px); }
.polpo-inv-who { flex: 1; }
.polpo-inv-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.polpo-inv-status { flex: none; padding: 2px 8px; border-radius: var(--r-pill, 999px); font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-3); }
.polpo-inv-status-open { background: var(--ok-soft); color: var(--ok-ink); }
.polpo-inv-status-used { background: var(--info-soft); color: var(--info-ink); }
.polpo-inv-item .polpo-inv-secondary { min-height: 30px; padding: 0 10px; font-size: 12.5px; }

@media (max-width: 560px) {
  .polpo-inv-row { grid-template-columns: 1fr; }
  .polpo-inv-board { flex-direction: column; align-items: stretch; }
  .polpo-inv-panel .polpo-inv-board select { width: 100%; }
  .polpo-inv-link { flex-direction: column; }
  .polpo-inv-item { flex-wrap: wrap; }
}
