:root {
  --portal-bg: #f5f5f7;
  --portal-card: #ffffff;
  --portal-line: #d8dee9;
  --portal-ink: #111827;
  --portal-muted: #6b7280;
  --portal-accent: #041c54;
  --portal-accent-ink: #ffffff;
  --portal-accent-border: #0f172a;
  --portal-accent-soft: rgba(4, 28, 84, 0.08);
  --portal-danger: #d93b3b;
  --portal-ok: #177245;
}

.portal-body,
.portal-auth-body {
  margin: 0;
  font-family: "Saans TRIAL", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--portal-ink);
  background: var(--portal-bg);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.portal-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.portal-sidebar {
  border-right: 1px solid var(--portal-line);
  background: #fff;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.portal-sidebar-head {
  margin-bottom: 18px;
}

.portal-logo-link {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--portal-line);
}

.portal-logo {
  height: 28px;
  display: block;
}

.portal-user {
  margin-top: 10px;
  font-size: 14px;
  color: var(--portal-muted);
}

.portal-revenue {
  padding: 12px;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  margin-bottom: 18px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.portal-revenue span,
.portal-revenue small {
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-revenue strong {
  font-size: 20px;
}

.portal-menu {
  display: grid;
  gap: 6px;
}

.portal-menu-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--portal-ink);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-menu-item:hover,
.portal-menu-item.is-active {
  border-color: rgba(4, 28, 84, 0.2);
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
}

.portal-menu-item--highlight {
  border-color: rgba(4, 28, 84, 0.32);
  box-shadow: 0 0 0 1px rgba(4, 28, 84, 0.12), 0 0 18px rgba(4, 28, 84, 0.16);
}

.portal-menu-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(4, 28, 84, 0.24);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--portal-accent);
  background: rgba(4, 28, 84, 0.08);
  flex: 0 0 auto;
  width: fit-content;
  white-space: nowrap;
}

.sidebar-customers {
  margin-top: 16px;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  padding: 10px;
}

.sidebar-customers summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--portal-muted);
}

.sidebar-customers ul {
  margin: 10px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.sidebar-customers li a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  color: var(--portal-ink);
  font-size: 12px;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
}

.sidebar-customers li small {
  color: var(--portal-muted);
}

.sidebar-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--portal-muted);
}

.sidebar-pagination a {
  color: var(--portal-ink);
}

.portal-main-wrap {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.portal-topbar {
  padding: 18px 24px;
  border-bottom: 1px solid var(--portal-line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.portal-topbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portal-topbar-title h1 {
  margin: 0;
  font-size: 22px;
}

.portal-topbar-title p {
  margin: 2px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-top-actions {
  display: flex;
  gap: 10px;
}

.portal-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--portal-line);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0;
}

.portal-nav-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #4b5563;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.portal-nav-toggle-bar + .portal-nav-toggle-bar {
  margin-top: 4px;
}

.portal-body.portal-nav-open .portal-nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.portal-body.portal-nav-open .portal-nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.portal-body.portal-nav-open .portal-nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.portal-icon-link {
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--portal-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--portal-ink);
  position: relative;
  font-weight: 600;
}

.portal-icon-link em {
  position: absolute;
  top: -6px;
  right: -6px;
  font-style: normal;
  font-size: 11px;
  background: var(--portal-accent);
  color: var(--portal-accent-ink);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 1px 6px;
}

.portal-icon-link--danger {
  color: var(--portal-danger);
}

.portal-icon-glyph {
  width: 20px;
  height: 20px;
  display: block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.portal-icon-glyph--users {
  -webkit-mask-image: url("/assets/icons/users.svg");
  mask-image: url("/assets/icons/users.svg");
}

.portal-icon-glyph--moneybag {
  -webkit-mask-image: url("/assets/icons/moneybag-move.svg");
  mask-image: url("/assets/icons/moneybag-move.svg");
}

.portal-icon-glyph--user-plus {
  -webkit-mask-image: url("/assets/icons/user-plus.svg");
  mask-image: url("/assets/icons/user-plus.svg");
}

.portal-icon-glyph--settings {
  -webkit-mask-image: url("/assets/icons/settings.svg");
  mask-image: url("/assets/icons/settings.svg");
}

.portal-icon-glyph--logout {
  -webkit-mask-image: url("/assets/icons/logout.svg");
  mask-image: url("/assets/icons/logout.svg");
}

.portal-nav-overlay {
  display: none;
}

.portal-main {
  padding: 22px 24px calc(30px + env(safe-area-inset-bottom, 0px));
  min-width: 0;
}

.portal-grid {
  display: grid;
  gap: 14px;
}

.portal-grid.portal-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-grid.portal-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  padding: 18px;
  min-width: 0;
}

.portal-card h2,
.portal-card h3 {
  margin-top: 0;
}

.portal-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.portal-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.portal-research-card {
  background:
    linear-gradient(180deg, rgba(250, 251, 253, 0.95) 0%, #ffffff 28%);
}

.portal-research-form {
  gap: 14px;
}

.portal-research-grid {
  gap: 14px;
  align-items: start;
}

.portal-research-grid-field {
  gap: 8px;
}

.portal-research-grid-field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #748093;
}

.portal-research-grid-field input:not([type="checkbox"]):not([type="radio"]),
.portal-research-grid-field select {
  min-height: 52px;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fcfdff;
  border-color: #dbe2ec;
}

.portal-research-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e4e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #7a8596;
  font-size: 13px;
  line-height: 1.45;
}

.portal-research-actions {
  padding-top: 2px;
}

.portal-research-actions .portal-btn {
  min-width: 220px;
}

.portal-option-groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.portal-option-group {
  --portal-option-accent: rgba(4, 28, 84, 0.12);
  padding: 0;
  overflow: hidden;
  border-color: #dfe6f0;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, #ffffff 22%);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.portal-option-group--website {
  --portal-option-accent: rgba(4, 28, 84, 0.16);
}

.portal-option-group--backend {
  --portal-option-accent: rgba(8, 145, 178, 0.18);
}

.portal-option-group--billing {
  --portal-option-accent: rgba(5, 150, 105, 0.18);
}

.portal-option-group--mailing {
  --portal-option-accent: rgba(219, 39, 119, 0.16);
}

.portal-option-group--website,
.portal-option-group--other {
  grid-column: 1 / -1;
}

.portal-option-group--maintenance {
  --portal-option-accent: rgba(15, 118, 110, 0.18);
}

.portal-option-group--photography {
  --portal-option-accent: rgba(180, 83, 9, 0.18);
}

.portal-option-group--videography {
  --portal-option-accent: rgba(124, 58, 237, 0.16);
}

.portal-option-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #e6edf6;
  box-shadow: inset 0 4px 0 var(--portal-option-accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(248, 251, 255, 0.96) 100%);
}

.portal-option-group-head h4 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.portal-option-group-kicker {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-muted);
}

.portal-option-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(4, 28, 84, 0.12);
  background: #fff;
  color: var(--portal-accent);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.portal-option-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.portal-option-group--website .portal-option-list,
.portal-option-group--other .portal-option-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

.portal-option-item-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e4ebf4;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.portal-option-item-shell:hover {
  border-color: rgba(4, 28, 84, 0.2);
  background: #fbfdff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.portal-option-item {
  align-items: flex-start;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--portal-ink);
  min-width: 0;
}

.portal-option-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--portal-accent);
}

.portal-option-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-option-item-copy strong {
  color: var(--portal-ink);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.portal-option-item-copy small {
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.3;
}

.portal-filter-details {
  display: block;
}

.portal-filter-details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-filter-details > summary::-webkit-details-marker {
  display: none;
}

.portal-filter-details > summary::marker {
  content: '';
}

.portal-filter-details > summary h2 {
  margin: 0;
}

.portal-filter-details > summary h3 {
  margin: 0;
}

.portal-filter-toggle {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--portal-muted);
  border-bottom: 2px solid var(--portal-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
  flex: 0 0 auto;
  margin-right: 2px;
}

.portal-filter-details > summary:hover .portal-filter-toggle {
  border-color: var(--portal-ink);
}

.portal-filter-details[open] > summary {
  margin-bottom: 14px;
}

.portal-filter-details[open] > summary .portal-filter-toggle {
  transform: rotate(-135deg);
}

.portal-dashboard-recent-scroll {
  max-height: 25rem;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.portal-dashboard-recent-list {
  margin: 0;
  padding-left: 24px;
}

.portal-dashboard-recent-list li + li {
  margin-top: 10px;
}

.portal-contract-card-head {
  display: grid;
  gap: 12px;
}

.portal-contract-overview-details > summary h2 {
  margin: 0;
}

.portal-contract-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.portal-contract-top-actions > a,
.portal-contract-top-actions > form {
  flex: 1 1 0;
  min-width: 0;
}

.portal-contract-top-actions > form {
  margin: 0;
}

.portal-contract-top-actions .portal-btn {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}

.portal-contract-layout {
  display: grid;
  gap: 14px;
}

.portal-contract-hero {
  display: grid;
  gap: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.portal-contract-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.portal-contract-hero-copy h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  letter-spacing: -0.02em;
}

.portal-contract-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.portal-contract-fact-card {
  border: 1px solid #dfe6f0;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 4px;
  align-content: start;
  text-align: left;
  min-width: 0;
}

.portal-contract-fact-card span {
  font-size: 12px;
  color: var(--portal-muted);
}

.portal-contract-fact-card strong {
  font-size: 17px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  word-break: normal;
}

.portal-contract-fact-card small {
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.3;
}

.portal-contract-fact-card.is-accent {
  border-color: #cad7ec;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.portal-contract-hero-actions {
  align-items: stretch;
}

.portal-contract-hero-actions > a,
.portal-contract-hero-actions > form {
  flex: 1 1 0;
  min-width: 0;
}

.portal-contract-hero-actions > form {
  margin: 0;
}

.portal-contract-hero-actions > form .portal-btn {
  width: 100%;
}

.portal-contract-overview-grid,
.portal-contract-admin-grid {
  align-items: start;
}

.portal-contract-section {
  display: grid;
  gap: 16px;
}

.portal-contract-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.portal-contract-section-head h2 {
  margin: 0;
}

.portal-contract-section-head .portal-actions {
  justify-content: flex-end;
}

.portal-contract-copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.portal-copy-btn.portal-contract-copy-card {
  min-height: 104px;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  min-width: 0;
}

.portal-copy-btn.portal-contract-copy-card span {
  font-size: 12px;
  line-height: 1.25;
  color: var(--portal-muted);
  width: 100%;
}

.portal-copy-btn.portal-contract-copy-card strong {
  display: block;
  width: 100%;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.portal-copy-btn.portal-contract-copy-card[disabled] {
  background: #f8fafc;
  opacity: 0.76;
  cursor: default;
}

.portal-contract-purchase-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.portal-contract-purchase-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.portal-contract-purchase-description {
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.35;
}

.portal-contract-purchase-row--muted {
  opacity: 0.9;
}

.portal-contract-admin-card {
  align-self: start;
}

.portal-contract-details-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.portal-contract-details-summary h2 {
  margin: 0;
}

.portal-contract-details-summary p {
  margin: 4px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.35;
}

.portal-contract-admin-meta-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.portal-contract-admin-meta {
  border: 1px solid #e6ebf3;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-contract-admin-meta span {
  font-size: 12px;
  color: var(--portal-muted);
}

.portal-contract-admin-meta strong {
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-contract-admin-bank {
  margin-top: 16px;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-contract-admin-bank span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--portal-muted);
}

.portal-contract-admin-bank strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-contract-delete-note {
  margin-bottom: 12px;
  border: 1px solid #f0d9d9;
  border-radius: 12px;
  background: #fff8f8;
  padding: 12px;
  color: #7d3030;
  font-size: 13px;
  line-height: 1.45;
}

.portal-contract-document-preview {
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  width: min(100%, 1600px);
}

.portal-contract-document-preview iframe {
  display: block;
  width: 100%;
  height: clamp(780px, 92vh, 1320px);
  border: 0;
  background: #fff;
}

.portal-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.portal-field label {
  font-size: 13px;
  color: var(--portal-muted);
}

.portal-field-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-field-head label {
  margin: 0;
}

.portal-info-button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  color: var(--portal-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.portal-info-button:hover {
  transform: translateY(-1px);
  border-color: rgba(4, 28, 84, 0.18);
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.portal-info-button:focus-visible {
  outline: 2px solid rgba(4, 28, 84, 0.22);
  outline-offset: 2px;
}

.portal-info-button--option {
  flex: 0 0 auto;
  margin-top: 2px;
}

.portal-field input:not([type="checkbox"]):not([type="radio"]),
.portal-field textarea,
.portal-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  line-height: 1.25;
  box-sizing: border-box;
}

.portal-field input[type="date"],
.portal-field input[type="datetime-local"],
.portal-field select {
  min-height: 44px;
}

.portal-field textarea {
  min-height: 100px;
}

.portal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.portal-actions .portal-btn {
  max-width: 100%;
}

.portal-incentive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.portal-incentive-head h3,
.portal-incentive-head h4,
.portal-incentive-head strong {
  margin: 0;
}

.portal-incentive-head .portal-badge {
  flex: 0 0 auto;
}

.portal-rich-editor {
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.portal-rich-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--portal-line);
  background: #f8fafc;
  flex-wrap: wrap;
}

.portal-rich-toolbar .portal-btn {
  min-height: 34px;
  padding: 6px 10px;
}

.portal-rich-toolbar select,
.portal-rich-toolbar input[type="color"] {
  min-height: 34px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #fff;
  padding: 4px 8px;
  font: inherit;
}

.portal-rich-toolbar input[type="color"] {
  width: 44px;
  padding: 2px;
}

.portal-rich-canvas {
  min-height: 220px;
  padding: 12px;
  line-height: 1.45;
  outline: none;
}

.portal-rich-canvas:focus {
  box-shadow: inset 0 0 0 1px rgba(4, 28, 84, 0.24);
}

.portal-rich-content {
  line-height: 1.45;
}

.portal-rich-content > *:first-child {
  margin-top: 0;
}

.portal-rich-content > *:last-child {
  margin-bottom: 0;
}

.portal-incentive-pdf-wrap {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.portal-incentive-pdf-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  min-height: 360px;
  max-height: 1400px;
  opacity: 1;
  transform: scaleY(1);
  transform-origin: top center;
  transition:
    opacity 220ms ease,
    max-height 360ms ease,
    min-height 360ms ease,
    margin-bottom 360ms ease,
    transform 360ms ease;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.portal-incentive-live-card.is-joining .portal-incentive-pdf-preview,
.portal-incentive-live-card.is-participating .portal-incentive-pdf-preview {
  opacity: 0;
  max-height: 0;
  min-height: 0;
  margin-bottom: 0;
  border-width: 0;
  transform: scaleY(0.96);
  overflow: hidden;
  pointer-events: none;
}

.portal-incentive-pdf-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  display: block;
}

@media (min-width: 741px) {
  .portal-incentive-pdf-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 0 5px #fff;
    pointer-events: none;
  }
}

.portal-incentive-cta {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.portal-incentive-cta .portal-btn {
  min-width: 180px;
}

.portal-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
  border: 1px solid #dbe4ef;
}

.portal-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0f766e, #16a34a);
}

.portal-incentive-progress-wrap {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.portal-incentive-admin-card {
  display: grid;
  gap: 10px;
}

.portal-incentive-participant-list {
  display: grid;
  gap: 10px;
}

.portal-incentive-participant-block {
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.portal-incentive-participant-block p {
  margin: 0;
}

.portal-incentive-participant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-btn[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
}

.portal-btn {
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.2;
  background: #fff;
  color: var(--portal-ink);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.portal-btn--primary {
  background: var(--portal-accent);
  border-color: var(--portal-accent-border);
  color: var(--portal-accent-ink);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.portal-btn--primary:hover {
  background: var(--portal-accent);
  border-color: var(--portal-accent-border);
  color: var(--portal-accent-ink);
}

.portal-btn--danger {
  background: #fff5f5;
  border-color: #f4cccc;
  color: var(--portal-danger);
}

.portal-btn--compact {
  min-height: 32px;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.portal-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.portal-table-actions form {
  margin: 0;
}

.portal-table-action-button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.portal-table-status-cell {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.portal-table-status-form {
  gap: 8px;
}

.portal-table-status-form .portal-field {
  gap: 0;
}

.portal-table-actions--links {
  gap: 10px;
}

.portal-table-action-link {
  display: inline-flex;
  align-items: center;
  color: var(--portal-accent);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.portal-table-action-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.portal-table-action-link--danger {
  color: var(--portal-danger);
}

.portal-table-action-disabled {
  display: inline-flex;
  align-items: center;
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.portal-table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-dashboard-contract-list {
  display: grid;
  gap: 10px;
}

.portal-dashboard-contract-item {
  border: 1px solid #e5ebf4;
  border-radius: 14px;
  padding: 12px;
  background: #fbfcfe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-dashboard-contract-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.portal-dashboard-contract-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-dashboard-contract-title-row strong {
  font-size: 15px;
  line-height: 1.3;
}

.portal-dashboard-contract-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.35;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.portal-table th,
.portal-table td {
  padding: 10px;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

.portal-table-wrap--fit {
  overflow: visible;
}

.portal-table--lead-results,
.portal-table--lead-jobs {
  min-width: 0;
  table-layout: fixed;
}

.portal-table--lead-results th,
.portal-table--lead-results td,
.portal-table--lead-jobs th,
.portal-table--lead-jobs td {
  padding: 9px 12px;
}

.portal-table--lead-results th:nth-child(1),
.portal-table--lead-results td:nth-child(1) {
  width: 36%;
}

.portal-table--lead-results th:nth-child(2),
.portal-table--lead-results td:nth-child(2) {
  width: 17%;
}

.portal-table--lead-results th:nth-child(3),
.portal-table--lead-results td:nth-child(3) {
  width: 20%;
}

.portal-table--lead-results th:nth-child(4),
.portal-table--lead-results td:nth-child(4) {
  width: 13%;
}

.portal-table--lead-results th:nth-child(5),
.portal-table--lead-results td:nth-child(5) {
  width: 14%;
}

.portal-table--lead-jobs th:nth-child(1),
.portal-table--lead-jobs td:nth-child(1) {
  width: 15%;
}

.portal-table--lead-jobs th:nth-child(2),
.portal-table--lead-jobs td:nth-child(2) {
  width: 34%;
}

.portal-table--lead-jobs th:nth-child(3),
.portal-table--lead-jobs td:nth-child(3) {
  width: 20%;
}

.portal-table--lead-jobs th:nth-child(4),
.portal-table--lead-jobs td:nth-child(4) {
  width: 11%;
}

.portal-table--lead-jobs th:nth-child(5),
.portal-table--lead-jobs td:nth-child(5) {
  width: 20%;
}

.portal-lead-table-main,
.portal-lead-table-location,
.portal-lead-table-contact,
.portal-lead-table-status,
.portal-lead-job-summary,
.portal-lead-job-status {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.portal-lead-table-main strong,
.portal-lead-job-summary strong {
  font-size: 15px;
  line-height: 1.25;
}

.portal-lead-table-main small,
.portal-lead-table-location small,
.portal-lead-table-status small,
.portal-lead-job-summary small,
.portal-lead-job-status small {
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.35;
}

.portal-lead-table-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.35;
}

.portal-lead-table-meta span {
  min-width: 0;
}

.portal-lead-table-contact .portal-table-action-link,
.portal-lead-table-contact .portal-table-action-disabled {
  white-space: normal;
  overflow-wrap: anywhere;
}

.portal-table--lead-results .portal-table-actions--links,
.portal-table--lead-jobs .portal-table-actions--links {
  gap: 6px 12px;
}

.portal-table--lead-results .portal-table-action-link,
.portal-table--lead-jobs .portal-table-action-link {
  font-size: 12px;
}

.portal-lead-job-error {
  color: var(--portal-danger);
}

.portal-salespeople-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.portal-salespeople-toolbar h2 {
  margin: 0;
}

.portal-salespeople-search {
  width: min(360px, 100%);
  margin: 0;
}

.portal-salespeople-search--mobile {
  display: none;
  margin: 0 0 10px;
}

.portal-salespeople-search .portal-field {
  gap: 0;
}

.portal-salespeople-mobile-list {
  display: none;
}

.portal-salespeople-mobile-summary {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.portal-salespeople-mobile-grid {
  display: grid;
  gap: 0;
}

.portal-salespeople-mobile-row {
  display: grid;
  grid-template-columns: minmax(108px, 42%) 1fr;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid #eef1f6;
  padding: 8px 0;
}

.portal-salespeople-mobile-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.portal-salespeople-mobile-label {
  font-size: 12px;
  color: var(--portal-muted);
  font-weight: 600;
  line-height: 1.25;
}

.portal-salespeople-mobile-value {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-salespeople-mobile-actions {
  gap: 10px;
}

.portal-statement-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-statement-list-head h2 {
  margin-bottom: 6px;
}

.portal-statement-list-intro {
  margin: 0;
  color: var(--portal-muted);
  max-width: 78ch;
}

.portal-kpis--statement-list {
  margin-top: 14px;
}

.portal-kpi--statement {
  min-height: 136px;
}

.portal-kpi--statement strong {
  font-size: clamp(1.15rem, 1.45vw, 1.7rem);
  line-height: 1.25;
}

.portal-kpi--statement-amount {
  border-color: rgba(4, 28, 84, 0.32);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.portal-table--statement-list {
  min-width: 980px;
}

.portal-table--statement-list td small {
  color: var(--portal-muted);
  display: block;
  margin-top: 2px;
}

.portal-table-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.portal-statement-actions {
  justify-content: flex-end;
}

.portal-statement-doc {
  display: grid;
  gap: 16px;
}

.portal-statement-doc-head {
  border: 1px solid #e4eaf3;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 14px;
}

.portal-statement-doc-head h2 {
  margin: 0;
  font-size: clamp(1.3rem, 1.7vw, 1.7rem);
}

.portal-statement-doc-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.portal-statement-doc-subline {
  margin: 8px 0 0;
  color: var(--portal-muted);
}

.portal-statement-meta-grid {
  border: 1px solid #e5ebf4;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-statement-meta-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-statement-meta-item span {
  font-size: 12px;
  color: var(--portal-muted);
}

.portal-statement-meta-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 14px;
}

.portal-statement-parties {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-statement-warning {
  border: 1px solid #f3de9a;
  border-radius: 12px;
  background: #fff8df;
  padding: 12px;
}

.portal-statement-warning h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.portal-statement-warning ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  color: #8b6a00;
  font-size: 13px;
}

.portal-statement-note {
  margin: -2px 0 2px;
  padding: 10px 12px;
  border: 1px solid #d8dee9;
  border-radius: 10px;
  background: #f9fbff;
  color: #475569;
  font-size: 13px;
}

.portal-statement-party-card {
  border: 1px solid #e5ebf4;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.portal-statement-party-card h3 {
  margin: 0;
  font-size: 16px;
}

.portal-statement-party-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-statement-party-grid > div {
  display: grid;
  gap: 2px;
}

.portal-statement-party-grid span {
  font-size: 12px;
  color: var(--portal-muted);
}

.portal-statement-party-grid strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-kpis--statement-detail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-statement-table-block h3 {
  margin-bottom: 10px;
}

.portal-table--statement-detail {
  min-width: 1120px;
}

.portal-table--statement-ledger {
  min-width: 1480px;
}

.portal-table--statement-ledger td small {
  color: var(--portal-muted);
}

.portal-statement-ledger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-statement-ledger-card {
  border: 1px solid #d9e1ee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.portal-statement-ledger-card h3 {
  margin: 0;
  font-size: 16px;
}

.portal-statement-ledger-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.portal-statement-ledger-table td {
  border-bottom: 1px solid #eef1f6;
  padding: 8px 4px;
  font-size: 14px;
  vertical-align: top;
}

.portal-statement-ledger-table td:first-child {
  color: var(--portal-muted);
  width: 58%;
}

.portal-statement-ledger-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  width: 42%;
  white-space: nowrap;
}

.portal-statement-ledger-table--wide td:last-child {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-statement-ledger-table tr:last-child td {
  border-bottom: none;
}

.portal-statement-ledger-table-final td {
  border-top: 1px solid #d9e1ee;
  border-bottom: none;
  font-size: 15px;
  font-weight: 700;
}

.portal-statement-totals {
  border: 1px solid #d9e1ee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.portal-statement-total-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.portal-statement-total-row strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.portal-statement-total-row--final {
  margin-top: 2px;
  border: 1px solid #c8d4ea;
  border-radius: 10px;
  background: #f5f9ff;
  padding: 10px;
  font-size: 15px;
}

.portal-statement-total-row--final strong {
  font-size: 19px;
}

.portal-statement-legal {
  border-top: 1px solid #e5ebf4;
  padding-top: 10px;
}

.portal-statement-legal h3 {
  margin-bottom: 8px;
}

.portal-statement-legal ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.4;
}

.portal-no-print {
  margin-top: 2px;
}

.portal-badge {
  display: inline-flex;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--portal-muted);
  white-space: nowrap;
}

.portal-badge--ok {
  color: var(--portal-ok);
  border-color: #b8dfca;
  background: #eefaf3;
}

.portal-badge--warn {
  color: #8b6a00;
  border-color: #f3de9a;
  background: #fff8df;
}

.portal-badge--info {
  color: #1f4f8a;
  border-color: #c5d8ee;
  background: #eff6ff;
}

.portal-badge--danger {
  color: var(--portal-danger);
  border-color: #f3c3c3;
  background: #fff1f1;
}

.portal-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.portal-pagination a,
.portal-pagination span {
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 6px 10px;
  text-decoration: none;
  color: var(--portal-ink);
  font-size: 13px;
}

.portal-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.portal-kpis--dashboard {
  margin-top: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-kpi {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  min-width: 0;
  overflow: hidden;
}

.portal-kpi span {
  display: block;
  color: var(--portal-ink);
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.portal-kpi strong {
  display: block;
  font-size: clamp(1.8rem, 2.2vw, 2.3rem);
  margin-top: auto;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}

.portal-kpi--interactive {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.portal-kpi--interactive:hover {
  border-color: rgba(4, 28, 84, 0.34);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.portal-kpi--interactive:focus-visible {
  outline: 0;
  border-color: rgba(4, 28, 84, 0.45);
  box-shadow: 0 0 0 3px rgba(4, 28, 84, 0.16);
}

.portal-kpi-note {
  margin-top: 8px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.2;
}

.portal-flash {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--portal-line);
  background: #fff;
}

.portal-flash--success {
  border-color: #b8dfca;
  background: #eefaf3;
}

.portal-flash--error {
  border-color: #f3c3c3;
  background: #fff1f1;
}

.portal-auth-main {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

.portal-auth-card {
  width: min(680px, 100%);
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  padding: 24px;
}

.portal-auth-logo-link {
  display: inline-flex;
  margin-bottom: 10px;
}

.portal-auth-logo {
  height: 30px;
}

.portal-checkbox {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  overflow-wrap: anywhere;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--portal-muted);
}

.portal-option-item-shell:has(input:checked) {
  border-color: rgba(4, 28, 84, 0.28);
  background: linear-gradient(180deg, rgba(4, 28, 84, 0.06) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 0 0 1px rgba(4, 28, 84, 0.08);
}

.portal-checkbox input[type="checkbox"],
.portal-checkbox input[type="radio"] {
  width: auto;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex: 0 0 auto;
}

.portal-signature {
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #fff;
}

.portal-signature-block {
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.portal-signature canvas {
  width: 100%;
  height: 220px;
  touch-action: none;
  display: block;
}

.portal-inline-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.portal-inline-links a {
  color: var(--portal-accent);
  font-size: 14px;
}

.portal-influencer-offer-card {
  display: flex;
  flex-direction: column;
}

.portal-influencer-offer {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  align-content: start;
  gap: 16px;
  min-height: 0;
}

.portal-influencer-offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-copy-btn.portal-influencer-offer-item {
  min-height: 162px;
  border-radius: 16px;
  padding: 16px;
  border-color: rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.portal-copy-btn.portal-influencer-offer-item:hover {
  border-color: rgba(4, 28, 84, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(242, 246, 255, 0.98));
}

.portal-copy-btn.portal-influencer-offer-item strong {
  font-size: 1.06rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.portal-copy-btn.portal-influencer-offer-item small {
  display: block;
  margin-top: auto;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--portal-muted);
  width: 100%;
}

.portal-influencer-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-influencer-rule {
  position: relative;
  width: 100%;
  min-height: 178px;
  padding: 0;
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
  color: inherit;
  font: inherit;
  text-align: inherit;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.portal-influencer-rule:hover,
.portal-influencer-rule[aria-expanded="true"] {
  border-color: rgba(4, 28, 84, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(241, 246, 255, 0.98));
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.portal-influencer-rule-summary {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 178px;
  padding: 18px;
  cursor: pointer;
}

.portal-influencer-rule-summary-content {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.portal-influencer-rule:is(:hover, :focus-visible, [aria-expanded="true"]) .portal-influencer-rule-summary-content {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
}

.portal-influencer-rule-icon-shell {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(4, 28, 84, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.portal-influencer-rule-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.92;
}

.portal-influencer-rule-title {
  color: var(--portal-ink);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.portal-influencer-rule-body {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: scale(0.98);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
  pointer-events: none;
  visibility: hidden;
}

.portal-influencer-rule:is(:hover, :focus-visible, [aria-expanded="true"]) .portal-influencer-rule-body {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.portal-influencer-rule:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(4, 28, 84, 0.12),
    0 14px 28px rgba(15, 23, 42, 0.08);
}

.portal-security-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--portal-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-field-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: #9ca3af;
}

.portal-legal-links {
  margin-top: 2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-legal-links a {
  font-size: 12px;
  color: #9ca3af;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.portal-legal-links a:hover {
  color: #6b7280;
}

.portal-copy-btn {
  border: 1px solid var(--portal-line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  line-height: 1.2;
  cursor: pointer;
  font-size: 14px;
  color: var(--portal-ink);
  font-family: inherit;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}

.portal-copy-btn[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
}

.portal-copy-btn.is-copied {
  border-color: rgba(4, 28, 84, 0.24);
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
}

.portal-structure-invite-row {
  display: grid;
  gap: 8px;
  max-width: 560px;
}

.portal-structure-invite-hint {
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-structure-root {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.portal-structure-tree-wrap {
  overflow: auto;
  padding-bottom: 4px;
}

.portal-structure-tree-list,
.portal-structure-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.portal-structure-tree-node {
  position: relative;
  padding-left: 20px;
}

.portal-structure-tree-node::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -8px;
  bottom: -10px;
  border-left: 1px dashed #cbd5e1;
}

.portal-structure-tree-node::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 22px;
  width: 10px;
  border-top: 1px dashed #cbd5e1;
}

.portal-structure-tree-list > .portal-structure-tree-node {
  padding-left: 0;
}

.portal-structure-tree-list > .portal-structure-tree-node::before,
.portal-structure-tree-list > .portal-structure-tree-node::after {
  display: none;
}

.portal-structure-tree-children {
  margin-top: 8px;
}

.portal-structure-node-card {
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.portal-structure-node-card--root {
  border-color: rgba(4, 28, 84, 0.26);
  background: rgba(4, 28, 84, 0.04);
  min-width: min(520px, 100%);
}

.portal-structure-node-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.portal-structure-node-company {
  font-size: 13px;
  font-weight: 600;
}

.portal-structure-node-meta {
  font-size: 12px;
  color: var(--portal-muted);
}

.portal-structure-empty {
  color: var(--portal-muted);
}

.portal-body.portal-modal-open {
  overflow: hidden;
}

.portal-modal[hidden] {
  display: none;
}

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overscroll-behavior: contain;
}

.portal-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.48);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.portal-modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(calc(var(--portal-lock-height, 100svh) - 32px), 720px);
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 50px rgba(15, 23, 42, 0.25);
  display: grid;
  grid-template-rows: auto 1fr;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  overflow: hidden;
  overscroll-behavior: contain;
}

.portal-modal.is-open .portal-modal-backdrop {
  opacity: 1;
}

.portal-modal.is-open .portal-modal-card {
  transform: translateY(0);
  opacity: 1;
}

.portal-modal-head {
  border-bottom: 1px solid var(--portal-line);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-modal-head h2 {
  margin: 0;
  font-size: clamp(1.05rem, 0.9vw + 0.8rem, 1.35rem);
}

.portal-modal-body {
  overflow: auto;
  padding: 12px 14px 14px;
  display: grid;
  gap: 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.portal-modal-body.website-checkout-body {
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: block;
  gap: 0;
}

.portal-modal-body.website-checkout-body .website-checkout-form,
.portal-modal-body.website-checkout-body .website-checkout-scroll {
  height: 100%;
  min-height: 0;
}

.portal-modal-body.website-checkout-body .website-checkout-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.portal-modal-card--lead {
  width: min(1080px, 100%);
  max-height: min(calc(var(--portal-lock-height, 100svh) - 32px), 860px);
}

.portal-modal-body--lead {
  gap: 12px;
}

.portal-modal-body--lead .portal-card {
  padding: 14px;
}

.portal-modal-body--lead .portal-table {
  min-width: 0;
}

.portal-modal-body--lead .portal-table th,
.portal-modal-body--lead .portal-table td {
  padding: 8px 10px;
  font-size: 13px;
}

.portal-lead-modal-loading {
  padding: 34px 16px;
  text-align: center;
  color: var(--portal-muted);
  font-size: 14px;
}

.portal-lead-modal-summary {
  border: 1px solid #e3e9f1;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.92) 0%, #ffffff 100%);
  display: grid;
  gap: 10px;
}

.portal-lead-modal-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-lead-modal-summary-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.portal-lead-modal-summary-copy h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.portal-lead-modal-summary-copy p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.5;
}

.portal-lead-modal-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.portal-lead-modal-nav {
  gap: 8px 14px;
}

.portal-lead-modal-nav a[aria-current="page"] {
  color: var(--portal-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.portal-lead-modal-table-wrap {
  overflow: auto;
}

.portal-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.portal-modal-stat {
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background: #f8fafd;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.portal-modal-stat span {
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.2;
}

.portal-modal-stat strong {
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.portal-modal-card--info {
  width: min(680px, 100%);
  max-height: min(calc(var(--portal-lock-height, 100svh) - 32px), 760px);
  border-radius: 28px;
  border-color: rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 248, 250, 0.98) 100%);
  box-shadow:
    0 30px 60px rgba(15, 23, 42, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.9) inset;
}

.portal-info-modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.portal-info-modal-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-info-close {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--portal-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-info-close:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.portal-info-modal-body {
  padding: 18px 20px 20px;
  gap: 14px;
}

.portal-info-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  width: fit-content;
  max-width: 100%;
}

.portal-info-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--portal-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.portal-info-tab.is-active {
  background: #fff;
  color: var(--portal-ink);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.portal-info-panel {
  display: none;
  gap: 14px;
}

.portal-info-panel.is-active {
  display: grid;
}

.portal-info-panel[hidden] {
  display: none;
}

.portal-info-hero {
  display: grid;
  gap: 8px;
}

.portal-info-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(4, 28, 84, 0.08);
  color: var(--portal-accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.portal-info-title {
  margin: 0;
  font-size: clamp(1.2rem, 1vw + 1rem, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.portal-info-summary {
  margin: 0;
  max-width: 56ch;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.55;
}

.portal-info-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-info-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 600;
}

.portal-info-pill--soft {
  background: rgba(15, 23, 42, 0.04);
  color: var(--portal-muted);
}

.portal-info-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.portal-info-card h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.portal-influencer-profile-offer {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: min(920px, 100%);
  margin-inline: auto;
  justify-items: center;
}

.portal-influencer-profile-offer > .portal-info-hero {
  justify-items: center;
  text-align: center;
  max-width: 760px;
}

.portal-influencer-profile-offer-panel {
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  justify-items: center;
}

.portal-influencer-profile-offer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 14px 18px;
  width: 100%;
}

.portal-influencer-profile-offer-code {
  flex: 0 1 380px;
  justify-items: center;
}

.portal-influencer-profile-offer-code input {
  max-width: 380px;
}

.portal-influencer-profile-offer-toggle {
  align-self: end;
  padding-bottom: 6px;
  color: var(--portal-ink);
  font-weight: 600;
}

.portal-influencer-profile-offer-link,
.portal-influencer-profile-offer-slider {
  justify-items: center;
  width: 100%;
}

.portal-influencer-profile-offer-slider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.portal-copy-btn.portal-influencer-profile-offer-link-btn {
  justify-self: center;
  min-height: 42px;
  min-width: 180px;
  padding: 10px 16px;
  border-radius: 999px;
}

.portal-influencer-profile-offer-slider-row input[type="range"] {
  flex: 0 1 360px;
  width: min(100%, 360px);
  max-width: 360px;
  justify-self: center;
}

.portal-influencer-profile-offer-save {
  min-width: 156px;
  padding-inline: 14px;
}

.portal-influencer-profile-offer-pills {
  width: 100%;
  justify-content: center;
}

.portal-info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.portal-info-list li {
  position: relative;
  padding-left: 18px;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
}

.portal-info-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(4, 28, 84, 0.7);
  box-shadow: 0 0 0 4px rgba(4, 28, 84, 0.08);
}

.portal-info-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
}

.portal-network-breakdown {
  display: grid;
  gap: 8px;
}

.portal-network-row {
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.portal-network-row-main {
  display: grid;
  gap: 2px;
}

.portal-network-row-main strong {
  font-size: 14px;
  line-height: 1.2;
}

.portal-network-row-company {
  font-size: 12px;
  color: var(--portal-muted);
  line-height: 1.25;
}

.portal-network-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-network-row-amount {
  font-size: 16px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.remote-contract-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1400px 460px at 50% -80px, rgba(9, 35, 94, 0.12), transparent 68%),
    linear-gradient(180deg, #f3f6fb 0%, #eef2f8 45%, #f6f7fa 100%);
  color: #0f172a;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.remote-contract-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 14px 40px;
  display: grid;
  gap: 14px;
}

.remote-contract-head {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.remote-contract-head .portal-auth-logo-link {
  margin-bottom: 10px;
}

.remote-contract-head h1 {
  margin: 0;
  font-size: clamp(1.4rem, 1.4vw + 1rem, 2rem);
  letter-spacing: 0.01em;
}

.remote-contract-head p {
  margin: 8px 0 0;
  color: #475569;
  max-width: 68ch;
}

.remote-contract-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.remote-contract-fact {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.remote-contract-fact-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #d5deea;
  background: #f5f8fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.remote-contract-fact-icon svg {
  width: 18px;
  height: 18px;
  stroke: #1d3f73;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.remote-contract-fact-copy {
  display: grid;
  gap: 2px;
}

.remote-contract-fact-copy strong {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.remote-contract-fact-copy span {
  font-size: 14px;
  color: #0f172a;
}

.remote-contract-paper {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 20px;
  overflow: hidden;
  background: #f5f5f7;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.1);
}

.remote-contract-paper .doc-wrap {
  max-width: 100%;
  padding: 14px;
}

.remote-contract-paper .doc-page {
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.remote-signature-card {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 12px;
}

.remote-signature-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 0.7vw + 1rem, 1.5rem);
}

.remote-signature-head p {
  margin: 6px 0 0;
  color: #475569;
  max-width: 72ch;
}

.remote-signature-pad {
  border-style: solid;
  border-color: #c7d0dd;
  background: #fcfdff;
}

.remote-signature-pad canvas {
  min-height: 220px;
}

.remote-contract-state {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.remote-contract-state h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.remote-contract-state p {
  margin: 0;
}

.remote-contract-state p + p {
  margin-top: 8px;
}

.remote-contract-state--error {
  border-color: #f3c3c3;
  background: #fff7f7;
}

.remote-contract-state--success {
  border-color: #b8dfca;
  background: #f4fcf7;
}

@media (max-width: 1220px) {
  .portal-grid.portal-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-option-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-option-group--website,
  .portal-option-group--other {
    grid-column: 1 / -1;
  }

  .portal-option-group--website .portal-option-list,
  .portal-option-group--other .portal-option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-kpis--dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-nav-toggle {
    display: inline-flex;
  }

  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 70;
    width: min(86vw, 340px);
    height: 100dvh;
    border-right: 1px solid var(--portal-line);
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
    overscroll-behavior: contain;
  }

  .portal-body.portal-nav-open .portal-sidebar {
    transform: translateX(0);
  }

  .portal-body.portal-nav-open {
    overflow: hidden;
  }

  .portal-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .portal-body.portal-nav-open .portal-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .portal-table-wrap {
    overflow: visible;
  }

  .portal-table:not(.portal-table--static) {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .portal-table:not(.portal-table--static) thead {
    display: none;
  }

  .portal-table:not(.portal-table--static),
  .portal-table:not(.portal-table--static) tbody,
  .portal-table:not(.portal-table--static) tr,
  .portal-table:not(.portal-table--static) td {
    display: block;
    width: 100%;
  }

  .portal-table:not(.portal-table--static) tr {
    border: 1px solid var(--portal-line);
    border-radius: 12px;
    background: #fff;
    padding: 8px 10px;
    margin-bottom: 10px;
  }

  .portal-table:not(.portal-table--static) td {
    border-bottom: 1px solid #eef1f6;
    padding: 8px 0;
    display: grid;
    grid-template-columns: minmax(108px, 42%) 1fr;
    gap: 10px;
    align-items: start;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .portal-table:not(.portal-table--static) td:last-child {
    border-bottom: 0;
  }

  .portal-table:not(.portal-table--static) td::before {
    content: attr(data-label);
    font-size: 12px;
    color: var(--portal-muted);
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .portal-table:not(.portal-table--static) td[colspan] {
    display: block;
    border-bottom: 0;
    padding: 4px 0;
    color: var(--portal-muted);
  }

  .portal-table:not(.portal-table--static) td[colspan]::before {
    content: none;
  }

  .portal-table:not(.portal-table--static) td > * {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .portal-table:not(.portal-table--static) td .portal-badge {
    white-space: normal;
  }

  .portal-table:not(.portal-table--static) td .portal-btn,
  .portal-table:not(.portal-table--static) td .portal-copy-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .portal-table:not(.portal-table--static) td .portal-table-actions .portal-btn--compact {
    width: auto;
    text-align: center;
    justify-content: center;
  }

  .portal-salespeople-desktop-table {
    display: none;
  }

  .portal-salespeople-toolbar {
    display: grid;
    gap: 8px;
  }

  .portal-salespeople-search {
    width: 100%;
  }

  .portal-salespeople-search--desktop {
    display: none;
  }

  .portal-salespeople-search--mobile {
    display: block;
    width: 100%;
  }

  .portal-statement-list-head {
    display: grid;
    gap: 8px;
  }

  .portal-kpis--statement-list,
  .portal-kpis--statement-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-statement-doc-head {
    grid-template-columns: 1fr;
  }

  .portal-statement-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-statement-parties {
    grid-template-columns: 1fr;
  }

  .portal-statement-ledger-grid {
    grid-template-columns: 1fr;
  }

  .portal-statement-actions {
    justify-content: flex-start;
  }

  .portal-salespeople-mobile-list {
    display: grid;
    gap: 10px;
  }

  .portal-salespeople-mobile-item {
    border: 1px solid var(--portal-line);
    border-radius: 12px;
    background: #fff;
    padding: 8px 10px;
  }

  .portal-salespeople-mobile-item > summary {
    min-width: 0;
  }

  .portal-salespeople-mobile-item[open] > summary {
    margin-bottom: 8px;
  }
}

@media (max-width: 740px) {
  .portal-main {
    padding-top: 12px;
    padding-bottom: 18px;
  }

  .portal-grid {
    gap: 10px;
  }

  .portal-grid.portal-grid-2,
  .portal-grid.portal-grid-3,
  .portal-form-grid,
  .portal-form-grid-3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .portal-option-groups {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .portal-option-group-head {
    padding: 13px 14px 12px;
    gap: 10px;
  }

  .portal-option-group-head h4 {
    font-size: 16px;
  }

  .portal-option-group-count {
    font-size: 11px;
    padding: 4px 8px;
  }

  .portal-option-list {
    padding: 12px;
    gap: 8px;
  }

  .portal-option-group--website,
  .portal-option-group--other {
    grid-column: auto;
  }

  .portal-option-group--website .portal-option-list,
  .portal-option-group--other .portal-option-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .portal-option-item-shell {
    padding: 11px 12px;
    border-radius: 14px;
    gap: 8px;
  }

  .portal-info-tabs {
    width: 100%;
  }

  .portal-info-tab {
    flex: 1 1 0;
    justify-content: center;
    padding: 10px 12px;
  }

  .portal-modal-card--info {
    border-radius: 24px;
  }

  .portal-info-modal-head,
  .portal-info-modal-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .portal-customer-create-form .portal-form-grid,
  .portal-customer-create-form .portal-form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-customer-create-form .portal-form-grid-3 .portal-field:first-child {
    grid-column: 1 / -1;
  }

  .portal-kpis--dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .portal-kpis--statement-list,
  .portal-kpis--statement-detail {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .portal-card {
    padding: 12px;
    border-radius: 14px;
  }

  .portal-form {
    gap: 10px;
  }

  .portal-kpi {
    min-height: 124px;
    padding: 9px;
    border-radius: 12px;
  }

  .portal-kpi span {
    font-size: 11.5px;
    line-height: 1.16;
  }

  .portal-kpi strong {
    font-size: clamp(0.98rem, 4.5vw, 1.42rem);
    letter-spacing: -0.01em;
    line-height: 1.04;
  }

  .portal-statement-meta-grid,
  .portal-statement-party-grid {
    grid-template-columns: 1fr;
  }

  .portal-statement-total-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .portal-statement-total-row--final strong {
    font-size: 18px;
  }

  .portal-field input:not([type="checkbox"]):not([type="radio"]),
  .portal-field textarea,
  .portal-field select {
    font-size: 16px;
  }

  .portal-field input[type="date"],
  .portal-field input[type="datetime-local"],
  .portal-field select {
    min-height: 38px;
    padding: 7px 10px;
  }

  .portal-field label {
    font-size: 12px;
  }

  .portal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .portal-actions .portal-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 38px;
  }

  .portal-contract-top-actions {
    gap: 6px;
  }

  .portal-contract-top-actions .portal-btn {
    min-height: 36px;
    padding: 8px 6px;
    font-size: 13px;
  }

  .portal-contract-hero {
    gap: 14px;
  }

  .portal-contract-hero-head,
  .portal-contract-section-head,
  .portal-contract-admin-bank {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-contract-status-stack,
  .portal-contract-purchase-badges,
  .portal-contract-section-head .portal-actions {
    justify-content: flex-start;
  }

  .portal-contract-facts-grid,
  .portal-contract-copy-grid,
  .portal-contract-admin-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .portal-dashboard-contract-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-actions .portal-btn--new-contract {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 14px;
    line-height: 1.2;
    justify-self: end;
    align-self: start;
  }

  .portal-incentive-head {
    flex-wrap: wrap;
  }

  .portal-rich-toolbar {
    gap: 6px;
    padding: 6px;
  }

  .portal-rich-canvas {
    min-height: 180px;
    padding: 10px;
  }

  .portal-incentive-pdf-preview {
    min-height: 360px;
  }

  .portal-incentive-pdf-frame {
    width: 160%;
    height: 160%;
    transform: scale(0.625);
    -webkit-transform: scale(0.625);
    transform-origin: top left;
  }

  .portal-incentive-cta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-incentive-cta .portal-btn {
    width: 100%;
    min-width: 0;
  }

  .portal-incentive-participant-block {
    padding: 10px;
  }

  .portal-pagination {
    margin-top: 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .portal-pagination a,
  .portal-pagination span {
    padding: 5px 8px;
    font-size: 12px;
  }

  .portal-inline-links {
    gap: 8px;
    margin-top: 10px;
  }

  .portal-influencer-profile-offer-panel {
    width: 100%;
    padding: 14px;
    gap: 14px;
  }

  .portal-influencer-profile-offer-code {
    flex-basis: 100%;
  }

  .portal-influencer-profile-offer-code input,
  .portal-influencer-profile-offer-slider-row input[type="range"] {
    width: 100%;
    max-width: 100%;
  }

  .portal-influencer-profile-offer-slider-row {
    width: 100%;
    align-items: stretch;
  }

  .portal-influencer-profile-offer-save {
    min-width: 0;
  }

  .portal-influencer-profile-offer-toggle {
    padding-bottom: 0;
  }

  .portal-copy-btn.portal-influencer-profile-offer-link-btn {
    min-width: 0;
  }

  .portal-influencer-offer-grid,
  .portal-influencer-rules {
    grid-template-columns: 1fr;
  }

  .portal-copy-btn.portal-influencer-offer-item {
    min-height: 136px;
  }

  .portal-legal-links a {
    font-size: 11.5px;
  }

  .portal-structure-tree-node {
    padding-left: 16px;
  }

  .portal-structure-node-card {
    padding: 9px 10px;
    border-radius: 10px;
  }

  .portal-modal {
    padding: 10px;
  }

  .portal-modal-card {
    width: 100%;
    max-height: calc(var(--portal-lock-height, 100svh) - 20px);
    border-radius: 12px;
  }

  .portal-modal-head {
    padding: 10px;
  }

  .portal-modal-head h2 {
    font-size: 16px;
  }

  .portal-modal-body {
    padding: 10px;
    gap: 8px;
  }

  .portal-modal-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-modal-stat {
    padding: 9px;
  }

  .portal-modal-stat strong {
    font-size: 16px;
  }

  .portal-lead-modal-summary {
    padding: 12px;
  }

  .portal-lead-modal-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-lead-modal-summary-actions {
    justify-content: flex-start;
  }

  .portal-network-row {
    padding: 9px;
  }

  .portal-network-row-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .portal-badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .portal-main,
  .portal-topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .portal-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .portal-topbar-title h1 {
    font-size: 20px;
  }

  .portal-topbar-title p {
    font-size: 12px;
  }

  .portal-top-actions {
    gap: 8px;
  }

  .remote-contract-shell {
    padding: 14px 10px 22px;
    gap: 10px;
  }

  .remote-contract-head,
  .remote-signature-card,
  .remote-contract-state {
    border-radius: 14px;
    padding: 12px;
  }

  .remote-contract-facts {
    grid-template-columns: 1fr;
  }

  .remote-contract-paper {
    border-radius: 14px;
  }

  .remote-contract-paper .doc-wrap {
    padding: 8px;
  }
}

.site-editor-layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(245, 247, 251, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.site-editor-sidebar-panel,
.site-editor-preview-panel {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
}

.site-editor-sidebar-panel {
  padding: 20px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.site-editor-sidebar-head,
.site-editor-preview-head,
.site-editor-sidebar-subhead {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.site-editor-sidebar-head h2,
.site-editor-preview-head h2,
.site-editor-sidebar-subhead h3 {
  margin: 4px 0 0;
}

.site-editor-preview-head {
  padding: 22px 22px 0;
}

.site-editor-preview-head p,
.site-editor-sidebar-subhead p {
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
}

.site-editor-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--portal-muted);
}

.site-editor-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(4, 28, 84, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--portal-accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.site-editor-sidebar-group {
  display: grid;
  gap: 12px;
}

.site-editor-sidebar-group h3 {
  margin: 0;
}

.site-editor-page-list {
  display: grid;
  gap: 8px;
}

.site-editor-page-link {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--portal-ink);
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.48);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.site-editor-page-link:hover,
.site-editor-page-link.is-active {
  border-color: rgba(4, 28, 84, 0.18);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 24px rgba(4, 28, 84, 0.08);
  transform: translateY(-1px);
}

.site-editor-page-link span {
  font-weight: 600;
}

.site-editor-page-link small {
  color: var(--portal-muted);
  font-size: 12px;
}

.site-editor-popup-form {
  gap: 14px;
}

.site-editor-preview-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  overflow: hidden;
}

.site-editor-preview-frame-wrap {
  padding: 22px;
  min-width: 0;
}

.site-editor-preview-frame {
  width: 100%;
  min-height: 78vh;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: #ffffff;
  box-shadow:
    0 22px 46px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.site-editor-note {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(4, 28, 84, 0.12);
  background: rgba(255, 255, 255, 0.62);
  color: var(--portal-muted);
  font-size: 13px;
}

.site-editor-note--warning {
  margin: 0 22px;
  color: #8a4b12;
  border-color: rgba(154, 82, 18, 0.2);
  background: rgba(255, 248, 235, 0.8);
}

.site-editor-image-preview-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.82);
  overflow: hidden;
}

.site-editor-image-preview-card img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 14px;
}

.site-editor-checkbox-stack {
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-editor-modal-card {
  max-width: 720px;
}

.site-editor-modal-meta {
  display: grid;
  gap: 6px;
}

.site-editor-modal-meta p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 13px;
  word-break: break-word;
}

.site-editor-form-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--portal-muted);
}

.site-popup-admin-grid {
  align-items: start;
}

.site-popup-admin-stack {
  gap: 18px;
  align-content: start;
}

.site-popup-admin-copy {
  margin: 8px 0 0;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.6;
}

.site-popup-admin-preview-copy {
  display: grid;
  gap: 8px;
}

.site-popup-admin-preview-copy h3,
.site-popup-admin-preview-copy p {
  margin: 0;
}

.site-popup-admin-placeholder {
  color: var(--portal-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1100px) {
  .site-editor-layout {
    grid-template-columns: 1fr;
  }

  .site-editor-preview-frame {
    min-height: 68vh;
  }
}

@media print {
  .portal-sidebar,
  .portal-topbar,
  .portal-no-print {
    display: none !important;
  }

  .portal-shell,
  .portal-main-wrap {
    display: block;
  }

  .portal-main {
    padding: 0;
  }

  .portal-card,
  .portal-kpi,
  .portal-statement-doc-head,
  .portal-statement-party-card,
  .portal-statement-totals {
    box-shadow: none;
    border-color: #d1d5db;
    background: #fff;
  }

  .portal-statement-doc {
    gap: 12px;
  }

  .portal-statement-parties,
  .portal-kpis--statement-detail,
  .portal-statement-totals,
  .portal-statement-legal {
    page-break-inside: avoid;
  }
}
