.promotion-app {
  background:
    radial-gradient(circle at 68% 0%, rgba(var(--blue-rgb), 0.05), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-promo-page .promotion-shell,
.admin-promo-create-page .promotion-shell {
  max-width: 1500px;
}

.admin-link-tab-shell {
  margin-bottom: 16px;
}

.admin-link-tabs {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dbe5f2;
  border-radius: 11px;
  background: #f5f8fc;
}

.admin-link-tabs button {
  min-width: 104px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.admin-link-tabs button:hover {
  color: var(--blue-deep);
}

.admin-link-tabs button.active {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.14);
}

.admin-link-tabs button:focus-visible {
  outline: 3px solid rgba(var(--blue-rgb), 0.22);
  outline-offset: 1px;
}

.admin-link-tab-shell > p {
  margin: 8px 0 12px;
  color: #64748b;
  font-size: 13px;
}

.filter-panel.admin-link-filter {
  display: block;
  padding: 18px;
}

.admin-link-filter-grid,
.admin-link-filter-advanced {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px 18px;
  align-items: end;
}

.admin-link-filter-advanced {
  margin-top: 14px;
}

.admin-link-filter-advanced[hidden],
.admin-link-filter [hidden] {
  display: none;
}

.admin-link-filter-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.admin-link-filter-field > span {
  color: #475569;
  font-size: 12px;
  font-weight: 950;
}

.filter-panel.admin-link-filter .admin-link-filter-field > input,
.filter-panel.admin-link-filter .admin-link-filter-field > select,
.admin-link-filter-search {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font: inherit;
}

.filter-panel.admin-link-filter .admin-link-filter-field > input,
.filter-panel.admin-link-filter .admin-link-filter-field > select {
  height: 40px;
  padding: 0 12px;
}

.admin-promo-create-form select[multiple],
.admin-promo-create-form input,
.admin-promo-create-form select {
  min-height: 44px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  background: #fff;
  color: #222;
}

.admin-link-filter-search {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}

.admin-link-filter-search svg,
.admin-link-filter-toggle svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.admin-link-filter-search svg {
  color: #94a3b8;
}

.admin-link-filter-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
}

.admin-link-owner-filter-combobox {
  position: relative;
  min-width: 0;
}

.admin-link-owner-filter-input-wrap {
  width: 100%;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.admin-link-owner-filter-input-wrap:focus-within {
  border-color: rgba(var(--blue-rgb), 0.64);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.11);
}

.admin-link-owner-filter-input-wrap > svg,
.admin-link-owner-filter-input-wrap > button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.admin-link-owner-filter-input-wrap > svg {
  color: #94a3b8;
}

.admin-link-owner-filter-input-wrap input {
  min-width: 0;
  height: 100%;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
}

.admin-link-owner-filter-input-wrap input::-webkit-search-cancel-button {
  display: none;
}

.admin-link-owner-filter-input-wrap > button {
  width: 38px;
  height: 100%;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid #edf1f7;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.admin-link-owner-filter-input-wrap > button:hover {
  background: #f8fafc;
  color: var(--blue-ink);
}

.admin-link-owner-filter-input-wrap > button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: -3px;
}

.admin-link-owner-filter-input-wrap > button svg {
  transition: transform 0.18s ease;
}

.admin-link-owner-filter-combobox.is-open .admin-link-owner-filter-input-wrap > button svg {
  transform: rotate(180deg);
}

.admin-link-owner-filter-options {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 286px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #d8e1ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.admin-link-owner-filter-options[hidden] {
  display: none;
}

.admin-link-owner-filter-option {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.admin-link-owner-filter-option:hover,
.admin-link-owner-filter-option:focus-visible {
  background: #f1f6ff;
  outline: 0;
}

.admin-link-owner-filter-option.is-selected {
  background: #eaf1ff;
  color: var(--blue-deep);
}

.admin-link-owner-filter-option-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-link-owner-filter-option-main strong,
.admin-link-owner-filter-option-main small,
.admin-link-owner-filter-option-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-link-owner-filter-option-main strong {
  font-size: 13px;
  font-weight: 850;
}

.admin-link-owner-filter-option-main small,
.admin-link-owner-filter-option-meta {
  color: #64748b;
  font-size: 11px;
}

.admin-link-owner-filter-option-meta {
  max-width: 130px;
}

.admin-link-owner-filter-option > b {
  color: transparent;
  font-size: 13px;
}

.admin-link-owner-filter-option.is-selected > b {
  color: var(--blue-ink);
}

.admin-link-owner-filter-empty {
  margin: 0;
  padding: 22px 12px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

.admin-link-account-range-filter,
.admin-link-account-range-combobox {
  position: relative;
  min-width: 0;
}

.admin-link-account-range-combobox.is-open {
  z-index: 60;
}

.admin-link-account-range-input-wrap {
  width: 100%;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 11px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
}

.admin-link-account-range-input-wrap:focus-within {
  border-color: rgba(var(--blue-rgb), 0.64);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.11);
}

.admin-link-account-range-input-wrap > svg,
.admin-link-account-range-input-wrap > button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: #94a3b8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.admin-link-account-range-scope {
  height: 22px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.admin-link-account-range-scope.is-direct {
  background: #ecfdf5;
  color: #047857;
}

.admin-link-account-range-input-wrap input {
  min-width: 0;
  height: 38px;
  flex: 1 1 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #0f172a;
  font: inherit;
}

.admin-link-account-range-input-wrap > button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid #edf1f7;
  background: transparent;
  cursor: pointer;
}

.admin-link-account-range-input-wrap > button:hover {
  background: rgba(var(--blue-rgb), 0.07);
}

.admin-link-account-range-input-wrap > button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: -3px;
}

.admin-link-account-range-input-wrap > button svg {
  transition: transform 0.18s ease;
}

.admin-link-account-range-combobox.is-open .admin-link-account-range-input-wrap > button svg {
  transform: rotate(180deg);
}

.admin-link-account-range-options {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  width: 100%;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.admin-link-account-range-options[hidden] {
  display: none;
}

.admin-link-account-range-scope-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: #f1f5f9;
}

.admin-link-account-range-scope-option {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.admin-link-account-range-scope-option:hover,
.admin-link-account-range-scope-option:focus-visible {
  outline: 0;
  color: var(--blue);
}

.admin-link-account-range-scope-option.is-selected {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.admin-link-account-range-user-heading {
  margin-top: 8px;
  padding: 9px 9px 6px;
  border-top: 1px solid #e8edf5;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.admin-link-account-range-user-list {
  display: grid;
  gap: 2px;
}

.admin-link-account-range-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.admin-link-account-range-option:hover,
.admin-link-account-range-option:focus-visible {
  outline: 0;
  background: rgba(var(--blue-rgb), 0.08);
}

.admin-link-account-range-option.is-selected {
  background: rgba(var(--blue-rgb), 0.12);
  color: var(--blue);
}

.admin-link-account-range-option.is-selected::after {
  content: "✓";
  flex: 0 0 auto;
  color: currentColor;
  font-size: 12px;
  font-weight: 950;
}

.admin-link-account-range-option span {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-link-account-range-option small {
  flex: 0 0 auto;
  margin-left: auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.admin-link-account-range-empty {
  padding: 18px 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.filter-panel.admin-link-filter .admin-link-filter-field > input:focus,
.filter-panel.admin-link-filter .admin-link-filter-field > select:focus,
.admin-link-filter-search:focus-within {
  border-color: rgba(var(--blue-rgb), 0.64);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.11);
  outline: 0;
}

.admin-link-filter-actions,
.admin-link-filter-action-group,
.admin-link-filter-toggle {
  display: flex;
  align-items: center;
}

.admin-link-filter-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e8edf5;
}

.admin-link-filter-action-group {
  gap: 10px;
}

.admin-link-filter-actions .primary-action,
.admin-link-filter-actions .secondary-action {
  min-width: 92px;
  height: 38px;
  border-radius: 6px;
}

.admin-link-filter-toggle {
  height: 38px;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue-ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-link-filter-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
}

.admin-link-filter-toggle:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 1px;
}

.admin-link-filter-toggle svg {
  transition: transform 0.18s ease;
}

.admin-link-filter-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.admin-link-filter-toggle-count {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue-ink);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.admin-link-filter-toggle.has-active-filter .admin-link-filter-toggle-count {
  background: var(--blue-ink);
  color: #fff;
}

.admin-link-toolbar {
  justify-content: space-between;
}

.admin-create-wrap {
  position: relative;
}

.admin-home-toggle,
.admin-advance-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #333;
  font-weight: 700;
}

.admin-help-dot {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid #aeb8c6;
  border-radius: 50%;
  background: #fff;
  color: #7a8492;
  cursor: help;
  font-weight: 800;
}

.admin-help-dot::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  z-index: 30;
  width: max-content;
  max-width: min(360px, calc(100vw - 84px));
  padding: 10px 12px;
  border-radius: 8px;
  background: #475569;
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.admin-help-dot::before {
  content: "";
  position: absolute;
  right: 9px;
  bottom: calc(100% + 5px);
  z-index: 31;
  width: 9px;
  height: 9px;
  border-right: 1px solid #475569;
  border-bottom: 1px solid #475569;
  background: #475569;
  transform: rotate(45deg) translateY(4px);
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.admin-help-dot:hover::after,
.admin-help-dot:focus-visible::after,
.admin-help-dot:hover::before,
.admin-help-dot:focus-visible::before {
  opacity: 1;
}

.admin-help-dot:hover::after,
.admin-help-dot:focus-visible::after {
  transform: translateY(0);
}

.admin-help-dot:hover::before,
.admin-help-dot:focus-visible::before {
  transform: rotate(45deg) translateY(0);
}

.admin-link-table th,
.admin-link-table td {
  white-space: nowrap;
}

.admin-link-name {
  display: grid;
  gap: 4px;
}

.admin-link-name small,
.admin-link-url {
  color: #8a94a3;
}

.admin-link-owner {
  display: inline-grid;
  align-items: start;
  gap: 2px;
  min-height: 0;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.admin-link-owner small {
  color: #8a94a3;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.admin-link-owner.is-platform {
  background: #e8f1ff;
  color: var(--blue-deep);
}

.admin-link-owner.is-platform small {
  color: #4f7fd8;
}

.admin-link-owner.is-platform small.is-warning {
  color: var(--warning, #c2410c);
}

:root[data-theme="dark"] .admin-link-owner.is-platform {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

:root[data-theme="dark"] .admin-link-owner.is-platform small:not(.is-warning) {
  color: var(--blue);
}

.admin-link-owner.is-personal {
  background: #f1f5f9;
  color: #475569;
}

.admin-link-table td:nth-last-child(-n + 4) {
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.admin-link-table th:last-child,
.admin-link-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 92px;
  border-left: 1px solid #d7e1ee;
  background: #fff;
  box-shadow: -10px 0 18px -13px rgba(15, 23, 42, 0.58);
}

.admin-link-table th:last-child {
  z-index: 4;
  background: #f8fafc;
}

.admin-link-table tbody tr:hover td:last-child,
.admin-link-table tbody tr.selected-row td:last-child {
  background: #f8fbff;
}

:root[data-theme="dark"] .admin-link-table td:nth-last-child(-n + 4) {
  color: var(--text-soft);
}

:root[data-theme="dark"] .admin-link-table td:last-child {
  border-left-color: var(--border);
  background: var(--surface);
  box-shadow: -10px 0 18px -13px rgba(0, 0, 0, 0.9);
}

:root[data-theme="dark"] .admin-link-table th:last-child {
  border-left-color: var(--border);
  background: var(--surface-muted);
}

:root[data-theme="dark"] .admin-link-table tbody tr:hover td:last-child,
:root[data-theme="dark"] .admin-link-table tbody tr.selected-row td:last-child {
  background: var(--surface-hover);
}

:root[data-theme="dark"] .admin-row-actions button.danger {
  background: transparent;
  color: var(--danger);
}

.admin-link-url {
  display: inline-block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.admin-link-url[data-full-url] {
  cursor: help;
}

.admin-row-actions {
  display: flex;
  gap: 18px;
}

.admin-row-actions a,
.admin-row-actions button {
  border: 0;
  background: transparent;
  color: #2478ff;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.admin-row-actions button.danger {
  color: #dc2626;
}

.admin-row-actions button.danger:hover,
.admin-row-actions button.danger:focus-visible {
  color: #b91c1c;
}

.admin-table-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px 20px;
  color: #333;
}

:root[data-theme="dark"] .admin-table-footer {
  color: var(--text-soft);
}

.admin-table-footer select {
  min-height: 40px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
}

.admin-promo-create-page {
  --admin-create-text: #1e293b;
  --admin-create-strong: #0f172a;
  --admin-create-label: #334155;
  --admin-create-muted: #64748b;
  --admin-create-placeholder: #94a3b8;
  padding-top: clamp(24px, 2.4vw, 34px);
  padding-bottom: 36px;
  background: transparent;
}

.admin-promo-create-page .page-back-action {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.admin-link-owner-summary {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 14px 15px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.admin-link-owner-summary > span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 900;
}

.admin-link-owner-summary strong {
  color: #0f172a;
  font-size: 14px;
}

.admin-link-owner-summary small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.admin-link-owner-summary[hidden],
[data-personal-owner-field][hidden],
[data-platform-org-field][hidden],
[data-link-type-field][hidden],
.admin-advanced-section[hidden] {
  display: none !important;
}

.admin-promo-create-form .admin-link-org-field.is-warning small {
  color: var(--warning, #c2410c);
}

.admin-create-heading {
  margin-bottom: 16px;
}

.admin-promo-create-page .admin-create-heading h1 {
  color: var(--admin-create-strong);
  font-size: 26px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-promo-create-page .admin-create-heading p {
  max-width: 680px;
  margin-top: 7px;
  color: var(--admin-create-muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.admin-promo-create-page .admin-create-action-bar {
  margin-bottom: 16px;
  border-radius: 8px;
}

.admin-promo-create-page .admin-create-action-bar strong {
  color: var(--admin-create-strong);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.admin-promo-create-page .admin-create-action-bar span {
  color: var(--admin-create-muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
}

.admin-promo-create-page .admin-create-action-bar .reward-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-promo-create-page :is(.primary-action, .secondary-action) {
  font-size: 13px;
  font-weight: 700;
}

.admin-promo-create-form {
  display: block;
  padding-bottom: 20px;
}

.admin-promo-create-form.is-personal-create .admin-create-side-card {
  position: static;
  max-height: none;
  overflow: visible;
  height: 100%;
  box-sizing: border-box;
}

.admin-create-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.admin-promo-create-page .admin-create-side-card {
  top: calc(var(--app-chrome-height, 131px) + 18px);
  gap: 14px;
  max-height: calc(100vh - var(--app-chrome-height, 131px) - 36px);
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  scrollbar-width: thin;
}

.admin-promo-create-page .admin-create-side-card h3 {
  color: var(--admin-create-strong);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
}

.admin-create-main-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
  height: 100%;
}

.admin-promo-create-page .admin-create-module {
  overflow: visible;
  padding: 16px 18px 18px;
  border-color: #e5ebf5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.025);
}

.admin-promo-create-page .admin-create-main-stack > [data-live-section] {
  margin-top: 0;
}

.admin-resource-count {
  display: none;
}

.admin-promo-create-form.is-personal-create .admin-create-main-stack {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  height: 100%;
  padding: 18px;
  border: 1px solid #e5ebf5;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.025);
}

.admin-promo-create-form.is-personal-create .admin-create-main-stack > [data-live-section] {
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid #e8edf5;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-promo-create-form.is-personal-create .admin-resource-count {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue-deep);
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.admin-promo-create-form.is-personal-create .admin-resource-count.is-empty {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.admin-promo-create-form.is-personal-create .admin-resource-selector {
  padding: 13px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 0;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-module-head h2 {
  margin: 0;
  color: var(--admin-create-strong, #0f172a);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
}

.admin-module-head p {
  margin: 3px 0 0;
  color: var(--admin-create-muted, #64748b);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 500;
}

.admin-promo-create-page .admin-create-main-stack .admin-module-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-promo-create-page .admin-create-main-stack .admin-module-head h2 {
  color: #1e293b;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.admin-promo-create-page .admin-create-main-stack .admin-module-head p {
  max-width: 740px;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.admin-promo-create-page .admin-module-head .tiny-chip {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 0;
}

.admin-promo-create-page [data-live-section] .admin-form-grid {
  grid-template-columns: minmax(0, 1fr);
}

.admin-create-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e8eef7;
  border-radius: 8px;
  background: #fff;
}

.admin-create-panel + .admin-create-panel {
  margin-top: 12px;
}

.admin-promo-create-form .field {
  display: grid;
  gap: 7px;
}

.admin-promo-create-form .field > span {
  color: var(--admin-create-label, #334155);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
}

.admin-promo-create-form .field small {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--admin-create-muted, #64748b);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
}

.admin-promo-create-form .field small b {
  color: inherit;
  font-weight: 600;
}

.admin-promo-create-page .admin-create-main-stack .field > span {
  color: #334155;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
}

.admin-promo-create-page .admin-create-main-stack .field small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
}

.admin-promo-create-page .field :is(input, select),
.admin-promo-create-page .admin-multi-trigger {
  color: var(--admin-create-text);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.admin-promo-create-page .admin-create-main-stack .field :is(input, select),
.admin-promo-create-page .admin-create-main-stack .admin-multi-trigger {
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
}

.admin-promo-create-page .field input::placeholder {
  color: var(--admin-create-placeholder);
  font-weight: 500;
}

.admin-create-main-stack .field select:not([multiple]),
.admin-create-main-stack .field input {
  min-height: 38px;
  border-radius: 8px;
}

.admin-promo-create-form select[multiple] {
  min-height: 116px;
  padding: 8px;
}

.admin-promo-create-form select[multiple] option {
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 6px;
  color: #475569;
  font-weight: 820;
}

.admin-promo-create-form select[multiple] option:checked {
  background: #eff6ff linear-gradient(#eff6ff, #eff6ff);
  color: var(--blue-deep);
}

.admin-native-multi {
  display: none !important;
}

.admin-multi-picker {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.admin-multi-trigger {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: var(--admin-create-text, #475569);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.admin-multi-trigger svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: #64748b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.16s ease;
}

.admin-multi-trigger[aria-expanded="true"] {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.1);
}

.admin-multi-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.admin-multi-menu {
  position: absolute;
  z-index: 30;
  top: calc(38px + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.admin-multi-menu[hidden] {
  display: none !important;
}

.admin-multi-option {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--admin-create-text, #475569);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.admin-multi-option:hover {
  background: #f8fbff;
  color: var(--blue-ink);
}

.admin-multi-option b {
  color: var(--blue-ink);
  opacity: 0;
}

.admin-multi-option.is-selected {
  background: #eff6ff;
  color: var(--blue-deep);
  font-weight: 700;
}

.admin-promo-create-page .admin-create-main-stack .admin-multi-option {
  color: #334155;
  font-size: 13px;
  font-weight: 500;
}

.admin-promo-create-page .admin-create-main-stack .admin-multi-option.is-selected {
  color: var(--blue-deep);
  font-weight: 600;
}

.admin-multi-option.is-selected b {
  opacity: 1;
}

.admin-multi-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-multi-selected[hidden] {
  display: none !important;
}

.admin-multi-chip {
  max-width: 100%;
  min-width: 0;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #f8fbff;
  color: var(--blue-ink);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-multi-chip button {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.admin-multi-chip button:hover {
  background: #dbeafe;
}

.admin-promo-create-page .admin-create-main-stack .admin-multi-chip {
  color: var(--blue-ink);
  font-weight: 600;
}

.admin-code-generate {
  height: 44px;
  flex: 0 0 auto;
}

.admin-promo-create-page .admin-advance-toggle {
  width: 100%;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #e8edf5;
  color: var(--admin-create-label, #334155);
  font-size: 13px;
  font-weight: 600;
}

.admin-advanced-section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e8edf5;
}

.admin-advanced-section header {
  display: grid;
  gap: 3px;
}

.admin-advanced-section h4 {
  margin: 0;
  color: var(--admin-create-strong, #0f172a);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}

.admin-advanced-section header p,
.admin-advanced-group p {
  margin: 0;
  color: var(--admin-create-muted, #64748b);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 500;
}

.admin-advanced-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-advanced-group legend {
  margin: 0 0 1px;
  padding: 0;
  color: var(--admin-create-label, #334155);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
}

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

.admin-advanced-option {
  position: relative;
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.admin-advanced-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.admin-advanced-option span {
  position: relative;
  z-index: 1;
}

.admin-advanced-option:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--blue-deep);
  box-shadow: 0 0 0 2px rgba(var(--blue-rgb), 0.06);
}

.admin-advanced-values {
  margin-top: 1px;
}

.admin-advanced-default {
  margin-top: 2px;
}

.admin-promo-create-page .admin-account-panel h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #1e293b;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
}

.admin-promo-create-page .admin-account-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-promo-create-page .admin-account-panel :is(h2, h3) span {
  padding: 1px 5px;
  border: 1px solid #dbeafe;
  border-radius: 5px;
  background: #f8fbff;
  color: var(--blue-ink);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
}

.admin-account-module-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.admin-promo-create-form.is-personal-create .admin-account-module-list {
  align-content: start;
  gap: 12px;
}

.admin-resource-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.admin-resource-section-head h3 {
  margin: 0;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.admin-resource-section-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 500;
}

.admin-account-panel-compact {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-account-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid #e5eaf1;
}

.admin-server-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-server-identity > span {
  min-width: 34px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 7px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--blue-ink);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.admin-promo-create-page .admin-server-identity h3 {
  margin: 0;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.admin-server-identity p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 500;
}

.admin-server-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
}

.admin-promo-create-page .admin-create-main-stack .admin-account-settings-grid {
  margin-top: 2px;
}

.admin-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #fff;
}

.admin-check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.admin-check-row label:has(input:checked) {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--blue-deep);
}

.admin-check-row input {
  min-height: auto;
  accent-color: var(--blue);
}

.admin-account-settings-grid,
.admin-account-leverage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-rebate-panel h3 {
  margin: 14px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.admin-empty-rebate {
  display: flex;
  align-items: center;
  min-height: 48px;
  max-width: 480px;
  padding: 0 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.admin-language-backdrop {
  align-items: center;
  justify-content: center;
}

.admin-language-modal {
  width: min(960px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.admin-language-body {
  flex: 1 1 auto;
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 24px 30px;
}

.admin-language-body h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.admin-language-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 26px;
}

.admin-language-checks label {
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-weight: 800;
}

.admin-language-checks input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.admin-language-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.admin-language-fields .field {
  padding: 14px;
  border: 1px solid #e7edf6;
  border-radius: 8px;
  background: #f7faff;
}

.admin-language-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #d8e1ef;
  background: #fff;
}

.admin-language-footer .secondary-action,
.admin-language-footer .primary-action {
  min-width: 104px;
}

.admin-restriction-trigger svg {
  transition: transform 0.15s ease;
}

.admin-restriction-trigger:hover svg {
  transform: translateY(2px);
}

.admin-opening-restriction-backdrop {
  align-items: center;
  justify-content: center;
}

.admin-opening-restriction-modal {
  width: min(620px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.admin-opening-restriction-header {
  background: #fff;
}

.admin-opening-restriction-body {
  display: grid;
  gap: 24px;
  padding: 24px 28px 28px;
}

.admin-opening-restriction-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.admin-opening-restriction-switch-row > span:first-child {
  display: grid;
  gap: 6px;
}

.admin-opening-restriction-title,
.admin-opening-restriction-modes legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-opening-restriction-switch-row strong,
.admin-opening-restriction-modes legend {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.admin-opening-restriction-switch-row small,
.admin-opening-mode-options small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.admin-opening-restriction-modes {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-opening-restriction-modes legend {
  margin-bottom: 12px;
}

.admin-opening-restriction-help {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  cursor: help;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.admin-opening-restriction-help::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  z-index: 30;
  width: max-content;
  max-width: min(360px, calc(100vw - 84px));
  padding: 10px 12px;
  border-radius: 8px;
  background: #475569;
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.admin-opening-restriction-help::before {
  content: "";
  position: absolute;
  top: calc(100% + 5px);
  left: 7px;
  z-index: 31;
  width: 9px;
  height: 9px;
  background: #475569;
  opacity: 0;
  pointer-events: none;
  transform: rotate(45deg);
  transition: opacity 0.14s ease;
}

.admin-opening-restriction-help:hover::after,
.admin-opening-restriction-help:focus-visible::after,
.admin-opening-restriction-help:hover::before,
.admin-opening-restriction-help:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

.admin-opening-restriction-help:hover::before,
.admin-opening-restriction-help:focus-visible::before {
  transform: rotate(45deg);
}

.admin-opening-restriction-modes.is-disabled {
  opacity: 0.48;
}

.admin-opening-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-opening-mode-options label {
  min-width: 0;
  cursor: pointer;
}

.admin-opening-mode-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-opening-mode-options label > span {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 15px 17px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.admin-opening-mode-options input:checked + span {
  border-color: var(--blue);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.admin-opening-mode-options input:checked + span strong {
  color: var(--blue-ink);
}

.admin-opening-restriction-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f4f8ff;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.admin-opening-restriction-footer {
  border-top: 1px solid #edf1f7;
}

@media (max-width: 1180px) {
  .admin-create-layout,
  .admin-form-grid,
  .admin-account-leverage-grid,
  .admin-language-fields {
    grid-template-columns: 1fr;
  }

  .admin-promo-create-page .admin-create-side-card {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .admin-link-tabs {
    width: 100%;
  }

  .admin-link-tabs button {
    flex: 1;
    min-width: 0;
    padding-inline: 10px;
  }

  .admin-module-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-promo-create-form.is-personal-create .admin-create-main-stack {
    padding: 14px;
  }

  .admin-promo-create-form.is-personal-create .admin-create-main-stack .admin-account-settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-account-panel-head {
    align-items: flex-start;
  }

  .admin-promo-create-page .admin-create-action-bar .reward-editor-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-language-body {
    padding: 22px;
  }

  .admin-opening-mode-options {
    grid-template-columns: 1fr;
  }

  .admin-opening-restriction-body {
    padding: 22px;
  }
}

.promotion-page {
  min-height: calc(100vh - var(--app-chrome-height, 131px));
  padding: clamp(28px, 2.8vw, 38px) clamp(22px, 3vw, 54px) 84px;
}

.promotion-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
}

.promotion-heading,
.module-toolbar,
.filter-panel,
.modal-header,
.modal-footer,
.detail-title,
.section-row,
.link-form-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.promotion-heading {
  align-items: flex-start;
  margin-bottom: 16px;
}

.promotion-heading h1 {
  margin: 0;
  color: #0f172a;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 900;
}

.promotion-heading p {
  margin: 8px 0 0;
  color: #64748b;
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.metric-strip span {
  min-width: 108px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #64748b;
  font-weight: 800;
}

.metric-strip strong {
  color: #0f172a;
  font-size: 20px;
}

.promo-stat-card {
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.promo-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.promo-stat-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 950;
}

.promo-stat-card .metric-strip {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.promo-stat-card .metric-strip::-webkit-scrollbar {
  display: none;
}

.promo-stat-card .metric-strip span {
  width: 176px;
  min-width: 176px;
  min-height: 54px;
  height: auto;
  justify-content: flex-start;
  padding: 9px 12px;
  border-color: #dce6f4;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.04);
}

.module-toolbar,
.filter-panel,
.table-card,
.detail-panel,
.link-workspace-card,
.subagent-card,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.module-toolbar {
  margin-bottom: 14px;
  padding: 14px 16px;
}

.toolbar-left,
.status-line,
.chip-row,
.link-actions,
.compact-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action,
.text-action,
.icon-action {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.primary-action,
.secondary-action {
  height: 40px;
  gap: 8px;
  padding: 0 15px;
}

.primary-action {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(var(--blue-rgb), 0.17);
}

.primary-action.danger-action {
  border-color: #dc2626;
  background: #dc2626;
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.14);
}

.secondary-action {
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--blue-ink);
}

.secondary-action.ghost-reset {
  color: #64748b;
}

.secondary-action:disabled,
.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.text-action {
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-ink);
}

.text-action.danger {
  color: #dc2626;
}

.icon-action {
  width: 36px;
  height: 36px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--blue-ink);
}

.primary-action svg,
.secondary-action svg,
.filter-search svg,
.modal-close svg,
.icon-action svg,
.copy-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.filter-panel {
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 16px;
}

.filter-search {
  min-width: 260px;
  flex: 1;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
}

.filter-search input,
.field input,
.field textarea,
.field select,
.filter-panel select,
.inline-select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.filter-search input {
  border: 0;
  outline: 0;
  background: transparent;
}

.filter-panel select,
.inline-select {
  width: 176px;
  height: 42px;
  padding: 0 12px;
  font-weight: 800;
}

.view-switch {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid #d8e1ef;
  border-radius: 9px;
  background: #f8fafc;
}

.view-switch button {
  min-width: 78px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-weight: 900;
}

.view-switch button.active {
  background: #fff;
  color: var(--blue-ink);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.link-type-filter {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  background: #f8fafc;
}

.link-type-filter button {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.link-type-filter button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(var(--blue-rgb), 0.18);
}

:root[data-theme="dark"] .link-type-filter {
  border-color: var(--border-light);
  background: var(--input-bg);
}

:root[data-theme="dark"] .link-type-filter button {
  color: var(--text-soft);
}

.view-switch svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.package-list-grid {
  grid-template-columns: minmax(0, 1fr);
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
}

.table-wrap[hidden],
.link-card-grid[hidden] {
  display: none !important;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid #edf1f7;
  background: #fbfdff;
}

.table-footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #64748b;
  font-weight: 800;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-weight: 800;
}

.page-size select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
}

.pager {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.pager button {
  min-width: 38px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--border);
  background: #fff;
  color: #64748b;
  font-weight: 800;
}

.pager button:last-child {
  border-right: 0;
}

.pager button.active {
  background: var(--blue);
  color: #fff;
}

.pager button:disabled {
  color: #cbd5e1;
  background: #f8fafc;
}

.data-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.package-list-table {
  min-width: 1240px;
}

.data-table th,
.data-table td {
  padding: 15px 14px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover,
.data-table tbody tr.selected-row {
  background: #f8fbff;
}

.data-table strong {
  color: #0f172a;
}

.data-table small,
.muted {
  color: #64748b;
}

.package-name,
.link-name {
  display: grid;
  gap: 5px;
}

.link-sub-meta {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.status-switch-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.package-status-switch {
  flex: 0 0 auto;
}

.operator-cell {
  display: grid;
  gap: 5px;
}

.operator-cell strong {
  color: #0f172a;
  font-size: 13px;
}

.operator-cell span {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #475569;
  font-size: 12px;
}

.status-pill,
.tag-pill,
.resource-chip,
.tiny-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.status-pill {
  min-height: 27px;
  padding: 0 10px;
  font-size: 12px;
}

.status-pill.green,
.tiny-chip.green {
  background: #ecfdf5;
  color: #047857;
}

.status-pill.amber,
.tiny-chip.amber {
  background: #fffbeb;
  color: #b45309;
}

.status-pill.orange,
.tiny-chip.orange {
  background: #fff7ed;
  color: #c2410c;
}

.status-pill.red,
.tiny-chip.red {
  background: #fef2f2;
  color: #dc2626;
}

.status-pill.slate,
.tiny-chip.slate {
  background: #f1f5f9;
  color: #475569;
}

.tiny-chip.blue {
  background: #eff6ff;
  color: var(--blue-ink);
}

.resource-chip,
.tag-pill,
.tiny-chip {
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: var(--blue-deep);
  font-size: 12px;
}

.resource-chip.invalid {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.tiny-chip {
  min-height: 22px;
  padding: 0 8px;
  border: 0;
}

.detail-panel {
  position: sticky;
  top: calc(var(--app-chrome-height, 131px) + 18px);
  padding: 18px;
}

.package-detail-page {
  position: static;
  top: auto;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.detail-panel.package-detail-page {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.package-detail-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.package-info-panel,
.package-detail-module {
  border: 1px solid #e1eaf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.package-info-panel {
  position: sticky;
  top: calc(var(--app-chrome-height, 131px) + 18px);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.package-info-panel .detail-title {
  margin-bottom: 0;
}

.package-info-actions {
  display: grid;
}

.package-info-actions .primary-action {
  width: 100%;
}

.package-info-actions .base-editing-label {
  width: 100%;
  justify-content: center;
}

.package-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.detail-status-switch {
  flex: 0 0 auto;
}

.package-base-editor {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #edf1f7;
}

.package-base-editor .compact-field {
  max-width: none;
  margin-top: 0;
}

.package-base-editor textarea {
  min-height: 92px;
  resize: vertical;
}

.base-editor-footer {
  position: static;
}

.package-info-block {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #edf1f7;
}

.package-info-block strong,
.package-info-block p {
  margin: 0;
  color: #0f172a;
  font-weight: 850;
  line-height: 1.55;
}

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

.package-module-stack {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.package-detail-module {
  min-width: 0;
  overflow: visible;
  padding: 0;
  border-top: 1px solid #e1eaf5;
}

.package-detail-module.is-editing {
  border-color: #93c5fd;
  box-shadow: 0 12px 30px rgba(47, 125, 246, 0.12);
}

.package-detail-module .detail-section-title {
  align-items: center;
  margin: 0;
  padding: 20px 20px 15px;
  border-bottom: 1px solid #edf1f7;
}

.package-detail-module .detail-section-title h3 {
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.15;
}

.detail-section-title p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.package-module-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-icon-action {
  width: 38px;
  height: 38px;
  border-color: #bfdbfe;
  background: #fff;
  color: var(--blue-ink);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.08);
}

.edit-icon-action:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.module-editing-label,
.detail-section-title .module-editing-label {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 900;
}

.package-module-scroll {
  max-height: none;
  overflow: visible;
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}

.module-editor {
  display: grid;
  gap: 13px;
}

.account-scope-editor {
  counter-reset: account-scope-step;
  gap: 12px;
}

.module-editor-section,
.audience-combined-section {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfdff;
}

.account-scope-editor .module-editor-section {
  gap: 12px;
  padding: 14px 16px;
  border-color: #dbe7fb;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0) 86px),
    #fff;
}

.module-editor-section h4,
.module-subtitle-row h4,
.audience-inline-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.module-section-head {
  display: grid;
  gap: 5px;
}

.module-section-head p {
  max-width: 760px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 780;
}

.account-scope-editor .module-editor-section h4 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-scope-editor .module-editor-section h4::before {
  counter-increment: account-scope-step;
  content: counter(account-scope-step);
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #2f7df6;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
}

.module-chip-row {
  margin-top: 0;
}

.module-editor-footer {
  position: static;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 0 0;
  border-top: 1px solid #edf1f7;
  background: #fff;
}

.audience-inline-head,
.module-subtitle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.audience-inline-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.module-subtitle-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.audience-combined-module {
  display: grid;
  gap: 12px;
}

.package-module-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.package-module-summary > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #f8fbff;
}

.package-module-summary span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.package-module-summary strong {
  color: #0f172a;
  font-size: 18px;
}

.audience-rule-card-grid {
  display: grid;
  gap: 10px;
}

.audience-rule-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #fff;
}

.audience-rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.audience-rule-card-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.audience-rule-card-head strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.audience-rule-card-head span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-rule-card-head b {
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
  white-space: nowrap;
}

.audience-value-chip-row {
  gap: 7px;
}

.special-permission-module {
  display: grid;
  gap: 12px;
}

.special-role-section,
.special-permission-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfdff;
}

.special-role-section > div:first-child,
.special-permission-card > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.special-role-section h4,
.special-permission-card strong {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.special-role-section p,
.special-permission-card span {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.special-role-section .chip-row {
  justify-content: flex-end;
}

.special-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.special-permission-card {
  min-height: 76px;
  background: #fff;
}

.special-permission-card em {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.special-permission-card.is-enabled {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.special-permission-card.is-enabled em {
  background: #dcfce7;
  color: #047857;
}

.special-toggle-list {
  display: grid;
  gap: 10px;
}

.special-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fff;
}

.special-toggle-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.special-toggle-row strong {
  color: #0f172a;
  font-weight: 950;
}

.special-toggle-row small {
  color: #64748b;
  font-weight: 800;
  line-height: 1.4;
}

.package-inline-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.package-inline-lists > div,
.package-impact-line {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfdff;
}

.package-inline-lists h4 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.package-audience-list {
  padding: 0;
}

.detail-empty,
.empty-state {
  padding: 42px 18px;
  color: #64748b;
  text-align: center;
  font-weight: 800;
}

.detail-title {
  align-items: flex-start;
  margin-bottom: 16px;
}

.detail-title h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.2;
}

.detail-title p {
  margin: 6px 0 0;
  color: #64748b;
}

.detail-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.package-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.package-detail-summary > div {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #f8fbff;
}

.package-detail-summary span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.package-detail-summary strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.15;
}

.package-detail-meta .section-row {
  align-items: flex-start;
}

.package-detail-meta strong {
  max-width: 760px;
  color: #0f172a;
  font-weight: 750;
  line-height: 1.55;
  text-align: right;
}

.empty-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.detail-section {
  padding: 15px 0;
  border-top: 1px solid #edf1f7;
}

.detail-section h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.detail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-section-title h3 {
  margin: 0;
}

.detail-section-title span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.detail-list {
  display: grid;
  gap: 9px;
}

.detail-list .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
}

.detail-list strong {
  color: #0f172a;
}

.compact-empty {
  padding: 22px 12px;
}

.audience-detail-section {
  display: grid;
  gap: 10px;
}

.audience-rule-row {
  margin-bottom: 2px;
}

.audience-collapse,
.audience-group {
  overflow: hidden;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fff;
}

.audience-collapse summary,
.audience-group summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.audience-collapse summary::-webkit-details-marker,
.audience-group summary::-webkit-details-marker {
  display: none;
}

.audience-collapse summary span,
.audience-group summary span {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-collapse summary small,
.audience-group summary small {
  flex: 0 0 auto;
  color: #64748b;
  font-weight: 850;
}

.audience-collapse summary::after,
.audience-group summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.audience-collapse[open] > summary::after,
.audience-group[open] > summary::after {
  transform: rotate(225deg);
}

.audience-collapse[open] > summary,
.audience-group[open] > summary {
  border-bottom: 1px solid #edf1f7;
}

.audience-collapse > .audience-group-grid,
.audience-collapse > .audience-all-users {
  margin: 10px;
}

.audience-group {
  background: #fbfdff;
}

.audience-user-table {
  padding: 10px;
}

.audience-user-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(160px, 1.3fr) minmax(90px, 0.8fr) minmax(72px, 0.6fr) minmax(120px, 1fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #edf1f7;
  border-radius: 9px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.audience-user-row > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.audience-user-row strong,
.audience-user-row small,
.audience-user-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-user-row strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.audience-user-row small {
  color: #64748b;
}

.audience-user-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.audience-user-tags span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--blue-ink);
  font-size: 11px;
  font-weight: 850;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}

.modal-backdrop[hidden],
.empty-state[hidden] {
  display: none !important;
}

.wide-modal,
.simple-modal {
  width: min(1080px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

[data-package-modal] .wide-modal {
  width: min(1220px, 100%);
}

/* 权限包编辑：沿用个人推广链接弹窗的紧凑尺寸与固定操作区。 */
[data-package-modal] {
  padding: 16px;
}

[data-package-modal] .package-editor-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: min(900px, calc(100vh - 32px));
}

[data-package-modal] .package-builder-header {
  min-height: 74px;
  padding: 14px 20px;
}

[data-package-modal] .package-builder-header h2 {
  font-size: 20px;
  line-height: 1.25;
}

[data-package-modal] .package-builder-header p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

[data-package-modal] .package-builder-form {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

[data-package-modal] .package-builder-grid {
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  overflow: auto;
  padding: 16px 18px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

[data-package-modal] .builder-side-card,
[data-package-modal] .builder-card {
  border-radius: 10px;
}

[data-package-modal] .builder-side-card {
  gap: 12px;
  padding: 16px;
}

[data-package-modal] .builder-card {
  padding: 16px 18px 18px;
}

[data-package-modal] .builder-side-card h3,
[data-package-modal] .builder-card h3 {
  font-size: 18px;
}

[data-package-modal] .resource-editor {
  gap: 10px;
}

[data-package-modal] .builder-card + .builder-card {
  margin-top: 10px;
}

[data-package-modal] .package-builder-form .modal-footer {
  min-height: 64px;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 20px;
}

.package-builder-header {
  align-items: center;
}

.package-builder-header .modal-close {
  margin-left: 2px;
}

.package-builder-page {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #eef3fb;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.package-builder-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid #dbe4f0;
  background: #fff;
}

.package-builder-page-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
}

.package-builder-page-head p {
  margin: 7px 0 0;
  color: #64748b;
}

.package-create-page {
  padding-top: clamp(24px, 2.4vw, 34px);
  padding-bottom: 28px;
}

.package-top-back-link {
  width: max-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.package-top-back-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.package-create-heading {
  margin-bottom: 14px;
}

.package-create-heading h1 {
  font-size: 30px;
}

.package-create-heading p {
  max-width: 620px;
}

.package-create-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised, #ffffff) 98%, transparent);
  box-shadow: var(--shadow-soft, 0 12px 28px rgba(15, 23, 42, 0.05));
}

.package-create-action-bar strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-strong, #0f172a);
  font-size: 15px;
  font-weight: 950;
}

.package-create-action-bar span {
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 760;
}

.package-create-action-bar .reward-editor-actions {
  display: flex;
  justify-content: flex-end;
}

.package-builder-form {
  background: #eef3fb;
}

.package-builder-form .modal-footer {
  margin: 18px -22px -18px;
  background: #fff;
}

.package-builder-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

body[data-package-mode="create"] .package-builder-form {
  overflow: visible;
  padding: 0;
  background: transparent;
}

body[data-package-mode="create"] .package-builder-form .modal-footer {
  margin: 22px 0 0;
  padding: 18px 0 0;
  background: transparent;
}

.builder-side-card,
.builder-card {
  border: 1px solid #e8edf5;
  border-radius: 13px;
  background: #fff;
}

.builder-side-card {
  position: sticky;
  top: 0;
  display: grid;
  gap: 15px;
  padding: 18px 14px;
}

body[data-package-mode="create"] .package-builder-page {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-package-mode="create"] .package-builder-grid {
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  min-height: 0;
}

body[data-package-mode="create"] .builder-side-card {
  top: calc(var(--app-chrome-height, 131px) + 18px);
  align-self: start;
  gap: 14px;
  max-height: calc(100vh - var(--app-chrome-height, 131px) - 36px);
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  scrollbar-width: thin;
}

body[data-package-mode="create"] .builder-side-card h3 {
  font-size: 18px;
}

body[data-package-mode="create"] .language-link {
  display: inline-flex;
}

body[data-package-mode="create"] .builder-card {
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

body[data-package-mode="create"] .package-create-scroll-panel {
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

body[data-package-mode="create"] .package-create-scroll-panel:focus {
  outline: 0;
}

.builder-side-card h3,
.builder-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.builder-main {
  min-width: 0;
}

.builder-main .resource-editor {
  margin-top: 0;
}

.builder-card {
  padding: 18px 30px 22px;
}

.builder-card + .builder-card {
  margin-top: 12px;
}

.language-link {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

.language-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.package-language-modal {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: var(--surface-raised, #fff);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.package-language-modal-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 24px 30px;
}

.package-language-modal-body h3 {
  margin: 0 0 16px;
  color: var(--text-strong, #0f172a);
  font-size: 18px;
  font-weight: 950;
}

.package-language-modal-body h3:not(:first-child) {
  margin-top: 28px;
}

.package-check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft, #475569);
  font-weight: 800;
}

.package-check-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.package-language-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin: 16px 0 28px;
}

.package-language-check-grid .package-check-item {
  min-width: 136px;
}

.package-language-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 32px;
}

.package-language-field {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border-light, #e7edf6);
  border-radius: 8px;
  background: var(--surface-soft, #f7faff);
}

.package-language-field h4 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 15px;
  font-weight: 950;
}

.package-language-field .field textarea {
  min-height: 92px;
}

.package-language-field .char-count {
  justify-self: end;
  margin-top: -3px;
  color: var(--muted, #64748b);
  font-style: normal;
  font-size: 12px;
  font-weight: 820;
}

.switch-control {
  width: 52px;
  height: 32px;
  position: relative;
  display: inline-flex;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control span {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.switch-control span::after {
  content: "";
  width: 26px;
  height: 26px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease;
}

.switch-control input:checked + span {
  background: #4ade80;
}

.switch-control input:checked + span::after {
  transform: translateX(20px);
}

.small-switch {
  width: 48px;
  height: 30px;
}

.small-switch span::after {
  width: 24px;
  height: 24px;
}

.small-switch input:checked + span::after {
  transform: translateX(18px);
}

.purpose-toggle {
  display: inline-flex;
  gap: 8px;
}

.purpose-toggle button {
  height: 42px;
  min-width: 104px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 900;
}

.purpose-toggle button.active {
  background: #2f7df6;
  color: #fff;
}

body[data-layout-page="permission-package-create"] .purpose-toggle button:disabled,
body[data-layout-page="permission-packages"][data-package-mode="detail"] .purpose-toggle button:disabled {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  opacity: 0.82;
}

.purpose-hint {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.textarea-count {
  margin-top: -10px;
  color: #64748b;
  text-align: right;
  font-weight: 800;
}

body[data-package-mode="create"] .builder-side-card textarea[data-field="description"] {
  min-height: 126px;
}

.compact-field {
  max-width: 470px;
  margin-top: 14px;
}

.compact-field small {
  margin-top: -2px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
}

.builder-subtitle {
  margin: 16px 0 10px;
  color: #0f172a;
  font-weight: 900;
}

.account-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.server-account-list {
  display: grid;
  gap: 10px;
}

.server-account-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid #dbe7fb;
  border-radius: 8px;
  background: #fff;
}

.server-account-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid #e5edf8;
}

.server-account-panel header strong {
  min-width: 0;
  flex: 1 1 220px;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 950;
}

.server-account-panel header small {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue-ink);
  font-size: 11px;
  font-weight: 800;
}

.server-account-types {
  grid-template-columns: repeat(auto-fit, minmax(176px, 220px));
  align-items: stretch;
}

.account-scope-summary {
  display: grid;
  gap: 14px;
}

.account-scope-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #e1eaf5;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff 0%, #f1f6ff 100%);
}

.account-scope-summary-head > div:first-child {
  display: grid;
  gap: 4px;
}

.account-scope-summary-head strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.account-scope-summary-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.account-scope-summary-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex: 0 0 auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.account-scope-summary-count b {
  margin-left: 8px;
  color: var(--blue-ink);
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
}

.account-scope-summary-count b:first-child {
  margin-left: 0;
}

.account-detail-server-list {
  gap: 12px;
}

.account-detail-server-panel {
  padding: 14px 16px 16px;
  border-color: #dbe7fb;
  background: #fbfdff;
}

.account-detail-server-panel header {
  align-items: center;
  padding-bottom: 12px;
}

.account-detail-server-panel header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-detail-server-panel header strong {
  font-size: 14px;
}

.account-server-kicker {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-detail-types {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.account-detail-card {
  min-width: 0;
  min-height: 142px;
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.035);
}

.account-detail-card.is-disabled {
  background: #f8fafc;
  opacity: 0.78;
}

.account-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.account-detail-card-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-detail-card-head strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 950;
}

.account-detail-card-head span {
  overflow-wrap: anywhere;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 650;
}

.account-detail-card-head em {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.account-detail-card.is-disabled .account-detail-card-head em {
  background: #f1f5f9;
  color: #64748b;
}

.account-detail-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.account-detail-card-tags span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: var(--blue-ink);
  font-size: 10px;
  font-weight: 800;
}

.account-detail-card-leverages {
  display: grid;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px solid #edf1f7;
}

.account-detail-card-leverages > span,
.account-detail-leverage-summary > span {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
}

.account-detail-card-leverages .chip-row {
  gap: 5px;
}

.account-detail-card-leverages .resource-chip,
.account-detail-leverage-summary .resource-chip {
  min-height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10px;
}

.account-detail-leverage-summary {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #dbe7fb;
  border-radius: 9px;
  background: #f8fbff;
}

.account-detail-leverage-summary .chip-row {
  gap: 6px;
}

.dependency-empty {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #496174;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 780;
}

.account-type-builder-subtitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.account-type-builder-subtitle small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 760;
}

.account-type-dependency-empty {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 2px 8px;
  width: 100%;
}

.account-type-dependency-empty::before {
  content: "ⓘ";
  grid-row: span 2;
  color: var(--blue-ink);
  font-size: 16px;
  line-height: 1;
}

.account-type-dependency-empty strong {
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 900;
}

.account-type-dependency-empty span {
  color: #496174;
  font-size: 11px;
  font-weight: 700;
}

.dependency-empty[hidden] {
  display: none;
}

.account-leverage-note {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.55;
}

.account-leverage-note strong {
  color: #9a3412;
  font-size: 12px;
  font-weight: 950;
}

.account-leverage-note span {
  font-weight: 780;
}

.account-scope-editor .selected-chip {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
}

.account-scope-editor .selected-chip b {
  font-size: 15px;
}

.account-permission-card {
  min-height: 86px;
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid #d7dce4;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.account-scope-editor .account-permission-card,
.server-account-types .account-permission-card {
  min-height: 78px;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
}

.account-scope-editor .server-account-types {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.account-scope-editor .account-permission-card {
  min-height: 108px;
  gap: 8px;
  padding: 13px;
  border-color: #dbe4f0;
  border-radius: 10px;
}

.account-scope-editor .account-permission-card > span:first-of-type strong {
  color: #0f172a;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 950;
}

.account-scope-editor .account-permission-card > small {
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.account-permission-card input {
  display: none;
}

.account-permission-card:has(input:checked) {
  border-color: #2f7df6;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 246, 0.18);
}

.account-scope-editor .account-permission-card:has(input:checked),
.server-account-types .account-permission-card:has(input:checked) {
  background: #eff6ff;
  box-shadow: none;
}

.account-permission-card.is-disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.account-permission-card > span:first-of-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-info {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  cursor: help;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.mini-info::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: -1px;
  z-index: 30;
  width: max-content;
  max-width: min(320px, calc(100vw - 72px));
  padding: 10px 12px;
  border-radius: 8px;
  background: #334155;
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.6;
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.mini-info:hover::after,
.mini-info:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.mini-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mini-tags em {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 5px;
  border: 1px solid #2f7df6;
  border-radius: 5px;
  color: #2f7df6;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.selected-chip-row,
.outline-chip-row,
.audience-checks {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.selected-chip-row {
  margin-top: 10px;
}

.server-row {
  max-width: 720px;
}

.server-picker-field {
  position: relative;
}

.server-picker {
  position: relative;
  max-width: 470px;
}

.server-picker-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.server-picker-trigger:hover,
.server-picker-trigger[aria-expanded="true"] {
  border-color: #2f7df6;
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.1);
}

.server-picker-caret {
  color: #64748b;
  font-size: 17px;
  line-height: 1;
}

.server-picker-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 260px;
  display: grid;
  gap: 6px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
}

.server-picker-menu[hidden] {
  display: none;
}

.server-picker-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.server-picker-option:hover:not(:disabled),
.server-picker-option.is-selected {
  background: #eff6ff;
}

.server-picker-option:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.72;
}

.server-type-pill {
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.server-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.server-picker-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.selected-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #2f7df6;
  border-radius: 6px;
  background: #2f7df6;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.selected-chip input {
  display: none;
}

.selected-chip:has(input:not(:checked)) {
  border-color: #dbe4f0;
  background: #fff;
  color: #64748b;
}

.selected-chip:has(input:not(:checked)):hover {
  border-color: #93c5fd;
  color: var(--blue-ink);
}

.selected-chip.is-invalid {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.selected-chip b,
.outline-chip-row b {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.selected-chip-remove {
  width: 16px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.selected-chip:has(input:not(:checked)) b {
  color: var(--blue-ink);
  font-weight: 850;
}

.permission-switch-row {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  color: #0f172a;
  font-weight: 900;
}

.audience-card p {
  margin: 8px 0 16px;
  color: #64748b;
}

.audience-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.audience-card-head h3 {
  margin-bottom: 0;
}

.audience-live-preview {
  min-width: 112px;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--blue-ink);
}

.audience-live-preview strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
}

.audience-live-preview span {
  font-size: 12px;
  font-weight: 850;
}

.audience-scheme-picker {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
}

.audience-scheme-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.audience-scheme-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.audience-scheme-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 780;
}

.audience-scheme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 9px;
}

.audience-scheme-card {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.audience-scheme-card input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #2f7df6;
}

.audience-scheme-card span {
  min-width: 0;
  display: grid;
}

.audience-scheme-card strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.audience-scheme-card.is-enabled {
  border-color: #2f7df6;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 246, 0.1);
}

.audience-inline-empty {
  margin: 0;
}

.audience-rule-list,
.audience-group-grid,
.audience-user-table {
  display: grid;
  gap: 10px;
}

.audience-rule-picker-row {
  max-width: 520px;
  margin-bottom: 12px;
}

.audience-rule-block {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfdff;
}

.audience-rule-block[hidden] {
  display: none;
}

.audience-rule-block.is-enabled {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.audience-rule-header,
.audience-rule-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #0f172a;
}

.audience-rule-header {
  justify-content: space-between;
}

.compact-rule-header {
  padding-bottom: 8px;
  border-bottom: 1px solid #e5edf8;
}

.compact-rule-header em {
  flex: 0 0 auto;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.audience-rule-toggle {
  cursor: pointer;
}

.audience-rule-toggle input,
.audience-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: #2f7df6;
}

.audience-rule-header span,
.audience-rule-toggle span,
.audience-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.audience-rule-header span {
  flex: 1 1 auto;
}

.audience-rule-header strong,
.audience-rule-toggle strong,
.audience-option strong {
  color: #0f172a;
  font-weight: 900;
}

.audience-rule-header small,
.audience-rule-toggle small,
.audience-option small {
  overflow: hidden;
  color: #64748b;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-rule-remove {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.audience-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.audience-option-picker {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.audience-option-picker > .field {
  margin: 0;
}

.audience-selected-option-group {
  display: grid;
  gap: 6px;
}

.audience-selected-option-group[hidden] {
  display: none;
}

.audience-selection-label {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.audience-selected-option-group .selected-chip-row {
  margin-top: 0;
}

.audience-multi-select {
  display: grid;
  gap: 10px;
}

.audience-search-control {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.audience-search-control input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.crm-account-selector {
  position: relative;
}

.crm-account-result-menu {
  max-height: 240px;
  grid-template-columns: 1fr;
  padding: 6px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.crm-account-result {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.crm-account-result input {
  display: none;
}

.crm-account-result span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.crm-account-result strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.crm-account-result small {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-account-result:hover {
  background: #eff6ff;
}

.crm-account-result.is-selected {
  display: none;
}

.crm-selected-panel {
  display: grid;
  gap: 7px;
}

.assign-agent-selected-panel {
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #d8e9ff;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
}

.assign-agent-selected-panel[hidden] {
  display: none !important;
}

.assign-agent-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assign-agent-selected-head strong {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.assign-agent-selected-head span {
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 900;
}

.assign-agent-picker .crm-account-result {
  min-height: 52px;
}

.assign-agent-option-menu {
  max-height: 190px;
  grid-template-columns: 1fr !important;
}

.assign-agent-option[hidden] {
  display: none !important;
}

.assign-agent-selected-panel .assign-agent-selected-list {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

[data-assign-modal] .stack-form {
  display: grid;
  gap: 16px;
  padding: 20px 22px 16px;
}

[data-assign-modal] .assign-modal-footer {
  width: 100%;
  gap: 10px;
  margin-top: 2px;
  padding: 14px 0 0;
  border-top: 1px solid #e5edf8;
}

[data-assign-modal] .assign-modal-footer button {
  min-width: 88px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
}

[data-assign-modal] .assign-modal-footer .secondary-action {
  border-color: #dbe4f0;
  background: #f8fafc;
  color: #475569;
}

[data-assign-modal] .assign-modal-footer .primary-action {
  min-width: 108px;
  box-shadow: 0 7px 14px rgba(37, 99, 235, 0.18);
}

[data-assign-modal] .assign-modal-footer .primary-action:disabled {
  box-shadow: none;
}

.crm-selected-panel > strong {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.crm-selected-list {
  min-height: 46px;
}

.audience-selected-list {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.audience-selected-chip {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue-deep);
  font-weight: 900;
}

.audience-selected-chip small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.audience-selected-chip button {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue-deep);
  font-size: 15px;
  line-height: 1;
}

.audience-option-menu {
  max-height: 196px;
  overflow: auto;
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.audience-option-menu.is-open {
  display: grid;
}

.audience-select-option {
  min-width: 0;
  min-height: 54px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.audience-select-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: #2f7df6;
}

.audience-select-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.audience-select-option strong {
  color: #0f172a;
  font-weight: 900;
}

.audience-select-option small {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-select-option.is-selected {
  border-color: #2f7df6;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 246, 0.1);
}

.audience-option {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.audience-option:has(input:checked) {
  border-color: #2f7df6;
  background: #eff6ff;
}

.audience-note-field {
  margin-top: 0;
}

.audience-checks {
  margin-bottom: 16px;
}

.audience-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-weight: 800;
}

.audience-checks input {
  width: 18px;
  height: 18px;
  accent-color: #2f7df6;
}

.outline-chip-row {
  margin: 12px 0 18px;
}

.outline-chip-row span {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid #2f7df6;
  border-radius: 13px;
  color: #2f7df6;
  font-weight: 900;
}

.simple-modal {
  width: min(560px, 100%);
}

.modal-header,
.modal-footer {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid #edf1f7;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid #edf1f7;
  border-bottom: 0;
}

.modal-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
}

.modal-header p {
  margin: 7px 0 0;
  color: #64748b;
}

.modal-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #64748b;
}

.stack-form {
  min-height: 0;
  overflow: auto;
  padding: 18px 22px;
}

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

.field {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.field.required > span::after {
  content: " *";
  color: #dc2626;
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field select {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
  padding: 11px 12px;
}

.link-create-grid {
  grid-template-columns: minmax(240px, 1.35fr) minmax(180px, 0.95fr) minmax(260px, 1.15fr);
  align-items: end;
}

.link-name-field {
  grid-column: span 1;
}

.invite-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invite-code-row input {
  min-width: 0;
  flex: 1 1 auto;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-promo-create-page .invite-code-row input {
  color: var(--admin-create-text, #1e293b);
  font-size: 13px;
  font-weight: 600;
}

.invite-code-row .secondary-action {
  height: 42px;
  flex: 0 0 auto;
  padding: 0 14px;
}

.link-sort-field {
  max-width: 180px;
}

.status-toggle-field {
  align-content: end;
}

.status-switch-row {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-switch-row strong {
  color: #0f172a;
  font-size: 13px;
}

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

.resource-block {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #fbfdff;
}

.resource-block h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.child-resource-head {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.child-resource-head h3 {
  margin: 0;
}

.child-resource-head small {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

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

.check-tile {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
}

.check-tile input {
  margin-top: 3px;
}

.check-tile strong,
.check-tile small {
  display: block;
}

.check-tile small {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
}

.check-tile.is-disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.link-permission-block {
  display: grid;
  gap: 16px;
  background: #fff;
}

.link-permission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.link-permission-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.link-permission-groups {
  display: grid;
  gap: 14px;
}

.permission-choice-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.permission-choice-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.permission-choice-title span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.permission-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
}

.promo-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.link-main-column,
.permission-sidebar {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-items: start;
}

.permission-sidebar {
  position: sticky;
  top: calc(var(--app-chrome-height, 131px) + 18px);
}

.link-main-column .module-toolbar {
  margin-bottom: 0;
}

.agent-summary,
.permission-summary,
.agent-switcher,
.tab-panel {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.agent-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

.agent-summary-main,
.assigned-package {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.assigned-package {
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.assigned-package.is-empty {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.summary-kicker,
.agent-switcher-head span,
.permission-grid section > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.agent-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agent-title-line h2,
.assigned-package h3,
.detail-hero h3 {
  margin: 0;
  color: #0f172a;
}

.agent-title-line h2 {
  font-size: 24px;
}

.assigned-package h3,
.detail-hero h3 {
  font-size: 18px;
}

.agent-summary p,
.assigned-package p,
.detail-hero p,
.detail-note p {
  margin: 0;
  color: #64748b;
}

.summary-stat-row,
.package-meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.summary-stat-row span,
.package-meta span,
.scope-count-row span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.summary-stat-row strong,
.scope-count-row strong {
  color: #0f172a;
  font-size: 15px;
}

.permission-summary {
  overflow: hidden;
}

.permission-summary summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}

.permission-summary summary::-webkit-details-marker {
  display: none;
}

.permission-summary summary span {
  color: #0f172a;
  font-weight: 900;
}

.permission-summary summary small {
  color: #64748b;
  font-weight: 850;
}

.permission-summary summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.permission-summary[open] summary::after {
  transform: rotate(225deg);
}

.permission-summary [data-agent-scope] {
  padding: 0 16px 16px;
  border-top: 1px solid #edf1f7;
}

.permission-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  color: #475569;
  font-weight: 850;
}

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

.permission-sidebar .permission-grid {
  grid-template-columns: 1fr;
}

.permission-grid section {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfdff;
}

.agent-switcher {
  overflow: hidden;
  padding: 0;
}

.agent-switcher-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.agent-switcher-head small {
  color: #64748b;
}

.compact-agent-switcher summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}

.compact-agent-switcher summary::-webkit-details-marker {
  display: none;
}

.compact-agent-switcher summary span {
  color: #0f172a;
  font-weight: 900;
}

.compact-agent-switcher summary small {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-agent-switcher summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.compact-agent-switcher[open] summary::after {
  transform: rotate(225deg);
}

.agent-select-field {
  padding: 14px 16px 16px;
  border-top: 1px solid #edf1f7;
}

.agent-select-field select {
  height: 40px;
}

.permission-sidebar .resource-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.agent-option {
  width: 100%;
  min-height: 84px;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  text-align: left;
}

.agent-option.active {
  border-color: var(--blue);
  background: #eff6ff;
}

.agent-option span,
.agent-option strong,
.agent-option small,
.agent-option em {
  min-width: 0;
}

.agent-option strong,
.agent-option small,
.agent-option em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-option small,
.agent-option em {
  color: #64748b;
}

.agent-option em {
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.tab-panel {
  overflow: hidden;
}

.local-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f7;
  background: #f8fafc;
}

.local-tabs button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-weight: 900;
  padding: 0 13px;
}

.local-tabs button.active {
  background: var(--blue);
  color: #fff;
}

.tab-body {
  padding: 16px;
}

.link-table {
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
}

.link-table th:nth-child(1) {
  width: 48%;
}

.link-table th:nth-child(2) {
  width: 43%;
}

.link-table th:nth-child(3) {
  width: 9%;
}

.link-primary-cell {
  min-width: 280px;
}

.link-url {
  max-width: 320px;
  overflow: hidden;
  color: var(--blue-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-copy-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.link-copy-row-url {
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.copy-mini {
  height: 24px;
  min-width: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #fff;
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 900;
}

.copy-mini svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.status-stack,
.usage-stack {
  display: grid;
  gap: 7px;
}

.status-stack > span {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.usage-stack span {
  color: #64748b;
  font-size: 12px;
}

.link-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.link-stat-grid.compact {
  grid-template-columns: repeat(2, minmax(76px, 1fr));
}

.link-stat-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 0.72fr);
  gap: 10px;
  align-items: stretch;
}

.link-stat-funnel {
  min-width: 0;
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.link-funnel-steps {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.link-funnel-step {
  --stage-color: #3b82f6;
  width: 100%;
  min-width: 0;
  min-height: 15px;
  display: grid;
  grid-template-columns: 32px minmax(80px, 1fr) 46px;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  color: #172033;
  clip-path: none;
  box-shadow: none;
}

.link-funnel-step:nth-child(2) {
  --stage-color: #38a9e8;
}

.link-funnel-step:nth-child(3) {
  --stage-color: #18a58f;
}

.link-funnel-step:nth-child(4) {
  --stage-color: #22a95f;
}

.link-funnel-step small,
.link-funnel-step strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-funnel-step small {
  color: #6f7d91;
  font-size: 10px;
  font-weight: 800;
}

.link-funnel-step strong {
  color: #172033;
  font-size: 11px;
  line-height: 1.1;
  text-align: right;
}

.link-funnel-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.link-funnel-track > i {
  width: var(--funnel-width);
  min-width: 4px;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--stage-color);
}

.link-stat-grid span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
}

.link-stat-grid small {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.link-stat-grid strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-stat-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 8px;
}

.link-card-stat-summary span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
}

.link-card-stat-summary small {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.link-card-stat-summary strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-stack {
  min-width: 160px;
  display: grid;
  gap: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.quality-stack span,
.quality-stack small {
  overflow-wrap: anywhere;
}

.conversion-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.conversion-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-ink), #059669);
}

.link-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
  padding: 16px;
  background: #fbfdff;
}

.promotion-link-card {
  min-width: 0;
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid #dbe7f8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.045);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.promotion-link-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.promotion-link-card:focus-visible {
  outline: 3px solid rgba(var(--blue-rgb), 0.24);
  outline-offset: 2px;
}

.promotion-link-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.link-card-title {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.link-card-title strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-title span,
.link-card-url {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-url {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--blue-ink);
}

.link-card-status {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

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

.link-action-menu {
  position: relative;
}

.link-action-menu summary {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #fff;
  color: var(--blue-ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.link-action-menu summary::-webkit-details-marker {
  display: none;
}

.link-action-menu div {
  min-width: 118px;
  display: grid;
  gap: 4px;
  margin-top: 7px;
  padding: 7px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.link-action-menu button {
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue-ink);
  font-weight: 900;
  text-align: left;
}

.link-action-menu button:hover {
  background: #eff6ff;
}

.link-action-menu button.danger {
  color: #dc2626;
}

.link-stats-detail {
  background: #fbfdff;
}

.link-stats-detail .quality-stack {
  min-width: 0;
}

.scope-count-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-modal-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px 22px;
}

.link-detail-modal {
  width: min(760px, 100%);
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
}

.detail-hero > div:first-child {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.detail-hero p {
  overflow: hidden;
  color: var(--blue-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-copy-line {
  min-width: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.detail-copy-line > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.detail-copy-line strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-copy-line p {
  min-width: 0;
  margin: 0;
}

.detail-hero-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-modal-list {
  padding: 0 2px;
}

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

.account-type-detail-block {
  grid-column: 1 / -1;
}

.detail-resource-block,
.detail-note,
.detail-collapse {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #edf1f7;
  border-radius: 12px;
  background: #fff;
}

.detail-collapse {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.account-type-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf1f7;
}

.account-type-map-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.account-type-map-card.is-invalid {
  border-color: #fecaca;
  background: #fff7f7;
}

.account-type-map-card header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-type-map-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-type-map-title strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-type-info {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--blue-ink);
  padding: 0;
}

.account-type-info svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.account-type-info::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 6;
  width: max-content;
  max-width: min(260px, 62vw);
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

.account-type-info:hover::after,
.account-type-info:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.account-type-route {
  display: grid;
  gap: 8px;
}

.account-type-route span {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #edf1f7;
  border-radius: 7px;
  background: #fff;
}

.account-type-route small {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.account-type-route strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-collapse summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.detail-collapse summary::-webkit-details-marker {
  display: none;
}

.detail-collapse summary span {
  color: #0f172a;
  font-weight: 900;
}

.detail-collapse summary small {
  color: #64748b;
  font-weight: 850;
}

.detail-collapse summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.detail-collapse[open] summary::after {
  transform: rotate(225deg);
}

.detail-collapse-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid #edf1f7;
}

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

.detail-permission-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfdff;
}

.detail-permission-card.is-empty {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.detail-permission-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.detail-permission-card p {
  margin: 0;
  color: #64748b;
}

.detail-resource-block > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.detail-resource-block h3,
.detail-note h3 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
}

.detail-resource-block small {
  color: #64748b;
  font-weight: 850;
}

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

.child-permission-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.child-permission-overview h2 {
  margin: 5px 0 6px;
  color: #0f172a;
  font-size: 18px;
}

.child-permission-overview p {
  margin: 0;
  color: #64748b;
  font-weight: 750;
}

.child-permission-actions {
  flex: 0 0 auto;
}

.child-agent-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
}

.child-agent-section-head,
.subagent-package-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.child-agent-section-head > div,
.subagent-package-line > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.child-agent-section-head strong,
.subagent-package-line strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-agent-combobox {
  position: relative;
}

.child-agent-combobox input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font-weight: 850;
  outline: none;
}

.child-agent-combobox input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.12);
}

.child-agent-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 12;
  display: grid;
  gap: 5px;
  max-height: 220px;
  overflow: auto;
  padding: 7px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.13);
}

.child-agent-dropdown[hidden] {
  display: none;
}

.child-agent-option {
  min-height: 48px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  text-align: left;
}

.child-agent-option:hover,
.child-agent-option:focus-visible {
  background: #eff6ff;
}

.child-agent-option strong,
.child-agent-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-agent-option small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.child-agent-option.empty {
  color: #64748b;
  font-weight: 850;
}

.selected-child-agents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.selected-child-agent,
.selected-child-empty {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #fff;
}

.selected-child-agent > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.selected-child-agent strong,
.selected-child-agent small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-child-agent small,
.selected-child-empty {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.remove-child-agent {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #fff;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
}

.remove-child-agent:hover {
  border-color: #bfdbfe;
  color: var(--blue-ink);
}

.child-inherited-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 14px;
  align-items: center;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.child-inherited-note h3 {
  margin: 0 0 6px;
}

.child-inherited-note p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.inherited-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.inherited-preview-grid span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
}

.inherited-preview-grid small {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.inherited-preview-grid strong {
  color: #0f172a;
  font-size: 13px;
}

.subagent-card {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.subagent-card h3 {
  margin: 0 0 6px;
}

.subagent-card p {
  margin: 0 0 12px;
  color: #64748b;
}

.subagent-scope-list {
  display: grid;
  gap: 9px;
}

.subagent-scope-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfdff;
}

.subagent-scope-row > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.subagent-scope-row.inherited {
  border-color: #dbeafe;
  background: #f8fbff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(520px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .module-grid,
  .promo-workbench,
  .package-builder-grid,
  .package-detail-layout,
  .package-module-stack {
    grid-template-columns: 1fr;
  }

  body[data-package-mode="create"] .package-builder-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .detail-panel,
  .permission-sidebar,
  .package-info-panel,
  body[data-package-mode="create"] .builder-side-card {
    position: static;
  }

  body[data-package-mode="create"] .builder-side-card,
  body[data-package-mode="create"] .package-create-scroll-panel {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .builder-side-card {
    position: static;
  }

  .subagent-grid,
  .package-language-input-grid,
  .permission-grid,
  .detail-resource-grid,
  .detail-agent-grid,
  .child-inherited-note {
    grid-template-columns: 1fr;
  }

  .audience-user-row {
    grid-template-columns: minmax(160px, 1.4fr) minmax(90px, 0.8fr) minmax(76px, 0.6fr) minmax(120px, 1fr);
  }

  .audience-user-row .audience-user-tags,
  .audience-user-row .status-pill {
    grid-column: span 2;
  }

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

  .account-card-grid,
  .server-account-types {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .promotion-page {
    padding: 26px 16px 60px;
  }

  .promotion-heading,
  .module-toolbar,
  .filter-panel,
  .table-footer,
  .child-permission-overview,
  .child-agent-section-head,
  .subagent-package-line,
  .modal-header,
  .modal-footer,
  .detail-hero,
  .detail-title,
  .package-create-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .package-detail-page .section-row {
    align-items: stretch;
    flex-direction: column;
  }

  .account-scope-summary-head {
    align-items: stretch;
    flex-direction: column;
  }

  .account-scope-summary-count {
    justify-content: flex-start;
  }

  .metric-strip,
  .toolbar-left,
  .agent-switcher-head {
    justify-content: flex-start;
  }

  .metric-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .metric-strip span {
    min-width: 0;
  }

  .toolbar-left {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-left .primary-action,
  .toolbar-left .secondary-action,
  .module-toolbar > .secondary-action,
  .view-switch,
  .pager,
  .page-size select {
    width: 100%;
  }

  .view-switch button {
    flex: 1;
  }

  .invite-code-row {
    align-items: stretch;
    flex-direction: column;
  }

  .invite-code-row .secondary-action {
    width: 100%;
  }

  .link-sort-field {
    max-width: none;
  }

  .pager button {
    flex: 1;
  }

  .agent-switcher-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .checkbox-grid,
  .selected-child-agents,
  .inherited-preview-grid,
  .child-inherited-note,
  .account-card-grid,
  .server-account-types,
  .audience-option-grid,
  .audience-option-menu,
  .special-permission-grid,
  .package-detail-summary,
  .package-module-summary,
  .package-inline-lists {
    grid-template-columns: 1fr;
  }

  .server-account-panel {
    grid-template-columns: 1fr;
  }

  .server-account-panel header {
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid #e5edf8;
  }

  .audience-card-head,
  .audience-collapse summary,
  .audience-group summary {
    align-items: stretch;
    flex-direction: column;
  }

  .audience-live-preview {
    width: 100%;
  }

  .audience-user-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .audience-user-row .audience-user-tags,
  .audience-user-row .status-pill {
    grid-column: auto;
  }

  .detail-title-actions {
    justify-content: flex-start;
  }

  .package-detail-meta strong {
    max-width: none;
    text-align: left;
  }

  .wide-modal,
  .simple-modal {
    max-height: 94vh;
  }

  .link-card-grid,
  .link-stat-panel,
  .link-stat-grid {
    grid-template-columns: 1fr;
  }

  .account-type-route span {
    grid-template-columns: 1fr;
  }

  .subagent-scope-row {
    grid-template-columns: 1fr;
  }

  .detail-copy-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .detail-copy-line > span {
    grid-column: 1 / -1;
  }

  .promotion-link-card header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 861px) and (max-width: 1180px) {
  [data-package-modal] .package-builder-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  [data-package-modal] .builder-side-card {
    position: sticky;
  }
}

@media (max-width: 860px) {
  [data-package-modal] .package-builder-grid {
    grid-template-columns: 1fr;
  }

  [data-package-modal] .builder-side-card {
    position: static;
  }
}

@media (max-width: 760px) {
  [data-package-modal] {
    padding: 8px;
  }

  [data-package-modal] .package-editor-modal {
    width: 100%;
    max-height: calc(100vh - 16px);
  }

  [data-package-modal] .package-builder-header,
  [data-package-modal] .package-builder-form .modal-footer {
    align-items: center;
    flex-direction: row;
  }

  [data-package-modal] .package-builder-header {
    min-height: 0;
    padding: 13px 14px;
  }

  [data-package-modal] .package-builder-header p {
    display: none;
  }

  [data-package-modal] .package-builder-grid {
    padding: 10px;
  }

  [data-package-modal] .builder-side-card,
  [data-package-modal] .builder-card {
    padding: 13px;
  }

  [data-package-modal] .package-builder-form .modal-footer {
    min-height: 58px;
    padding: 10px 14px;
  }
}

/* IB promotion center */
body[data-layout-page="promo-links"] .promotion-page {
  background: #f3f7fd;
}

body[data-layout-page="promo-links"] [hidden] {
  display: none !important;
}

.ib-promotion-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.ib-overview-card,
.ib-rebate-card,
.ib-agent-permission-card {
  border: 1px solid #e2eaf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(30, 64, 175, 0.06);
}

.ib-overview-card,
.ib-rebate-card {
  min-height: 194px;
  padding: 16px 18px;
}

.ib-overview-card > header,
.ib-rebate-card > header,
.ib-link-tab-intro,
.ib-current-agent-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ib-rebate-card > header {
  align-items: center;
}

.ib-rebate-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.ib-rebate-title h2 {
  margin: 0;
}

.ib-overview-card h2,
.ib-rebate-card h2,
.ib-link-tab-intro h2 {
  margin: 2px 0 0;
  color: #172033;
  font-size: 17px;
  line-height: 1.2;
}

.ib-overview-period {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.ib-overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.ib-overview-metrics > span {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding-left: 14px;
  border-left: 3px solid #2f7cf6;
}

.ib-overview-metrics small,
.ib-overview-link-metrics,
.ib-rebate-actions small,
.ib-current-agent-line small,
.ib-current-agent-line em,
  .ib-link-tab-intro p {
  color: #6c7890;
}

.ib-overview-metrics small {
  font-size: 12px;
  font-weight: 850;
}

.ib-overview-metrics strong {
  color: #172033;
  font-size: clamp(28px, 2.15vw, 34px);
  line-height: 1;
}

.ib-overview-link-metrics {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf2f8;
  font-size: 11px;
  font-weight: 800;
}

.ib-overview-link-metrics strong {
  color: #172033;
  font-size: 13px;
}

.ib-rebate-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ib-rebate-actions button {
  min-width: 0;
  min-height: 104px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 7px;
  padding: 12px;
  border: 1px solid #e3eaf4;
  border-radius: 12px;
  background: #fbfdff;
  color: #172033;
  text-align: left;
}

.ib-rebate-actions button:hover {
  border-color: #b9d0fb;
  background: #f5f9ff;
}

.ib-rebate-actions button > i:first-child {
  grid-column: 1 / -1;
  color: #ff9c56;
  font-size: 30px;
}

.ib-rebate-actions button:nth-child(2) > i:first-child {
  color: #f1aa1d;
}

.ib-rebate-actions button > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ib-rebate-actions strong,
.ib-rebate-actions small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ib-rebate-actions strong {
  font-size: 13px;
}

.ib-rebate-actions small {
  font-size: 11px;
}

.ib-rebate-actions em {
  font-style: normal;
}

.ib-agent-permission-card {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 0;
  overflow: hidden;
  margin-bottom: 16px;
}

.ib-agent-permission-main,
.ib-agent-permission-meta {
  min-width: 0;
  padding: 16px 20px;
}

.ib-agent-permission-meta {
  border-left: 1px solid #e7edf6;
  background: #fbfdff;
}

.ib-agent-permission-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ib-agent-permission-title > div {
  min-width: 0;
}

.ib-agent-permission-title p {
  margin: 6px 0 0;
  color: #66748c;
  font-size: 13px;
  line-height: 1.45;
}

.ib-permission-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #edf5ff;
  color: var(--blue);
  font-size: 20px;
}

.ib-permission-capabilities {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ib-permission-capabilities span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
}

.ib-permission-capabilities .is-enabled {
  background: #eaf8f0;
  color: #07804b;
}

.ib-permission-capabilities .is-disabled {
  background: #f1f4f8;
  color: #7c879a;
}

.ib-current-agent-line > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ib-current-agent-line strong {
  color: #172033;
  font-size: 14px;
}

.ib-current-agent-line em {
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.ib-agent-permission-meta .summary-stat-row {
  margin-top: 14px;
}

.ib-permission-scope-details {
  margin-top: 12px;
  border-top: 1px solid #e7edf6;
}

.ib-permission-scope-details summary {
  padding: 11px 0 4px;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.ib-permission-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ib-permission-scope-grid section {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e7edf6;
  border-radius: 9px;
  background: #fff;
}

.ib-permission-scope-grid section > span {
  color: #69778f;
  font-size: 11px;
  font-weight: 900;
}

body[data-layout-page="promo-links"] .tab-panel {
  border-color: #e2eaf5;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(30, 64, 175, 0.06);
}

body[data-layout-page="promo-links"] .local-tabs {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 49px;
  padding: 6px 12px 0;
  border-bottom: 1px solid #e3eaf4;
  background: #f6f8fc;
}

body[data-layout-page="promo-links"] .local-tabs button {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  height: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #65738a;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

body[data-layout-page="promo-links"] .local-tabs button:hover {
  border-color: #dce5f2;
  background: rgba(255, 255, 255, 0.76);
  color: #334155;
  transform: none;
}

body[data-layout-page="promo-links"] .local-tabs button.active {
  z-index: 1;
  margin-bottom: -1px;
  border-color: #cddcf0;
  border-bottom-color: #fff;
  border-radius: 9px 9px 0 0;
  background: #fff;
  color: #2674ef;
  box-shadow: 0 -3px 10px rgba(37, 99, 235, 0.07);
}

body[data-layout-page="promo-links"] .local-tabs button.active::after {
  content: none;
}

body[data-layout-page="promo-links"] .local-tabs button:focus-visible {
  outline: 3px solid rgba(38, 116, 239, 0.18);
  outline-offset: 1px;
}

body[data-layout-page="promo-links"] .local-tab-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e9eef6;
  color: #6f7d93;
  font-size: 12px;
}

body[data-layout-page="promo-links"] .local-tabs button.active .local-tab-icon {
  background: #eaf2ff;
  color: #2674ef;
}

body[data-layout-page="promo-links"] .local-tab-check {
  display: none;
}

body[data-layout-page="promo-links"] .local-tab-copy {
  min-width: 0;
  display: block;
}

body[data-layout-page="promo-links"] .local-tab-copy strong,
body[data-layout-page="promo-links"] .local-tab-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-layout-page="promo-links"] .local-tab-copy strong {
  color: inherit;
  font-size: 13px;
  line-height: 1;
}

body[data-layout-page="promo-links"] .local-tab-copy small {
  display: none;
}

body[data-layout-page="promo-links"] .tab-body {
  padding: 18px 20px 22px;
  background: #fff;
}

.ib-link-tab-intro {
  align-items: center;
  margin-bottom: 12px;
}

.ib-link-tab-intro p {
  margin: 4px 0 0;
  font-size: 12px;
}

.ib-link-tab-count {
  min-width: 66px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  background: #eef5ff;
  color: #50617c;
  font-size: 11px;
  font-weight: 850;
}

.ib-link-tab-count strong {
  color: #2674ef;
  font-size: 15px;
}

body[data-layout-page="promo-links"] .promotion-page {
  font-size: 13px;
}

body[data-layout-page="promo-links"] .promotion-heading {
  margin-bottom: 14px;
}

body[data-layout-page="promo-links"] .promotion-heading h1 {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.15;
}

body[data-layout-page="promo-links"] .promotion-heading p {
  margin-top: 6px;
  font-size: 13px;
}

body[data-layout-page="promo-links"] .summary-kicker {
  font-size: 11px;
  font-weight: 800;
}

body[data-layout-page="promo-links"] .ib-overview-metrics small,
body[data-layout-page="promo-links"] .ib-overview-link-metrics,
body[data-layout-page="promo-links"] .ib-permission-capabilities span,
body[data-layout-page="promo-links"] .ib-agent-permission-meta .summary-stat-row span {
  font-weight: 750;
}

body[data-layout-page="promo-links"] .local-tabs button {
  font-weight: 800;
}

body[data-layout-page="promo-links"] .ib-agent-permission-card .agent-title-line h2 {
  font-size: 20px;
  line-height: 1.2;
}

body[data-layout-page="promo-links"] .ib-current-agent-line small {
  font-size: 11px;
}

body[data-layout-page="promo-links"] .ib-agent-permission-meta .summary-stat-row {
  gap: 7px;
  margin-top: 12px;
}

body[data-layout-page="promo-links"] .ib-agent-permission-meta .summary-stat-row span {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
}

body[data-layout-page="promo-links"] .ib-agent-permission-meta .summary-stat-row strong {
  font-size: 14px;
}

body[data-layout-page="promo-links"] .primary-action,
body[data-layout-page="promo-links"] .secondary-action {
  height: 36px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 750;
}

body[data-layout-page="promo-links"] .link-main-column .filter-panel {
  justify-content: flex-start;
  margin-bottom: 14px;
  padding: 12px;
}

body[data-layout-page="promo-links"] .link-type-filter[hidden] {
  display: none;
}

body[data-layout-page="promo-links"] .link-main-column .filter-search {
  height: 38px;
  flex: 0 1 440px;
}

body[data-layout-page="promo-links"] .link-main-column .filter-panel select {
  width: 160px;
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

body[data-layout-page="promo-links"] .link-main-column .view-switch {
  min-height: 38px;
  margin-left: auto;
}

body[data-layout-page="promo-links"] .link-main-column .link-type-filter button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

body[data-layout-page="promo-links"] .link-main-column .view-switch button {
  min-width: 68px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

body[data-layout-page="promo-links"] .link-table th,
body[data-layout-page="promo-links"] .link-table td {
  padding: 12px;
}

body[data-layout-page="promo-links"] .link-table th {
  font-size: 11px;
  font-weight: 800;
}

body[data-layout-page="promo-links"] .link-table td {
  font-size: 13px;
}

body[data-layout-page="promo-links"] .link-table th:nth-child(1) {
  width: 48%;
}

body[data-layout-page="promo-links"] .link-table th:nth-child(2) {
  width: 43%;
}

body[data-layout-page="promo-links"] .link-table th:nth-child(3) {
  width: 9%;
}

.link-name-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ib-rebate-modal .stack-form {
  padding: 20px 22px 0;
}

[data-rebate-account-modal] .ib-rebate-modal {
  width: min(520px, 100%);
}

[data-rebate-account-modal] .modal-header {
  padding: 15px 18px 14px;
}

[data-rebate-account-modal] .modal-header h2 {
  font-size: 19px;
  line-height: 1.2;
}

[data-rebate-account-modal] .modal-header p {
  margin-top: 4px;
  font-size: 12px;
}

[data-rebate-account-modal] .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

[data-rebate-account-modal] .stack-form {
  gap: 14px;
  padding: 16px 18px 18px;
  overflow: visible;
}

[data-rebate-account-modal] .rebate-account-select-field {
  gap: 9px;
  padding: 14px;
  border: 1px solid #dfe8f5;
  border-radius: 11px;
  background: #f8fbff;
}

[data-rebate-account-modal] .rebate-account-select-field > span {
  color: #34425a;
  font-size: 12px;
}

[data-rebate-account-modal] .rebate-account-helper {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #76849a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

[data-rebate-account-modal] .rebate-account-helper i {
  color: #4f83e5;
}

[data-rebate-account-modal] .stack-form > .modal-footer {
  gap: 10px;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid #e8eef6;
}

[data-rebate-account-modal] .modal-footer button {
  min-width: 66px;
}

.ib-rebate-account-options {
  display: grid;
  gap: 8px;
}

.ib-rebate-account-option {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #dde6f2;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.ib-rebate-account-option:hover {
  border-color: #a9c5f7;
  box-shadow: 0 4px 12px rgba(var(--blue-rgb), 0.08);
}

.ib-rebate-account-option:has(input:checked) {
  border-color: #8db6fb;
  background: #f4f8ff;
}

.ib-rebate-account-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.ib-rebate-account-option > i {
  color: var(--blue);
  font-size: 22px;
}

.ib-rebate-account-option > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ib-rebate-account-option small {
  color: #748097;
}

.rebate-account-selected {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid #dce7f5;
  border-radius: 9px;
  background: #fff;
}

.rebate-account-selected[hidden] {
  display: none;
}

.rebate-account-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #51617a;
  font-size: 10px;
  font-weight: 800;
}

.rebate-account-selected-head strong {
  color: var(--blue);
  font-size: 10px;
}

.rebate-account-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rebate-account-selected-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid #dce7f5;
  border-radius: 7px;
  background: #f8fbff;
}

.rebate-account-selected-item strong {
  overflow: hidden;
  color: #172033;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rebate-account-selected-item small {
  color: #748097;
  font-size: 9px;
  line-height: 1.25;
}

.ib-rebate-rule-list {
  display: grid;
  gap: 0;
  padding: 8px 22px 4px;
}

.ib-rebate-rule-list > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid #edf1f7;
}

.ib-rebate-rule-list span {
  color: #6b778f;
  font-weight: 800;
}

.ib-link-qr-body {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 24px 18px;
  text-align: center;
}

.ib-link-qr-body > i {
  color: #172033;
  font-size: 148px;
  line-height: 1;
}

.ib-link-qr-body strong {
  font-size: 18px;
}

.ib-link-qr-body p {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: #66748c;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .ib-promotion-overview,
  .ib-agent-permission-card {
    grid-template-columns: 1fr;
  }

  .ib-agent-permission-meta {
    border-top: 1px solid #e7edf6;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .ib-overview-card,
  .ib-rebate-card,
  .ib-agent-permission-main,
  .ib-agent-permission-meta {
    padding: 18px;
  }

  .ib-overview-metrics,
  .ib-rebate-actions,
  .ib-permission-scope-grid {
    grid-template-columns: 1fr;
  }

  .ib-overview-metrics {
    gap: 14px;
  }

  .ib-overview-metrics > span {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .ib-overview-metrics strong {
    font-size: 30px;
  }

  body[data-layout-page="promo-links"] .local-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 6px 10px 0;
  }

  body[data-layout-page="promo-links"] .local-tabs button {
    width: 100%;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
  }

  body[data-layout-page="promo-links"] .local-tab-copy strong {
    font-size: 12px;
  }

  body[data-layout-page="promo-links"] .tab-body {
    padding: 18px;
  }

  .ib-link-tab-intro,
  .ib-current-agent-line {
    align-items: stretch;
    flex-direction: column;
  }

  .ib-rebate-rule-list > div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* IB permission summary: show owned scope first, without agent-operation noise. */
body[data-layout-page="promo-links"] .ib-agent-permission-card {
  display: block;
  overflow: hidden;
}

body[data-layout-page="promo-links"] .ib-permission-card-content {
  padding: 16px 18px;
  background: linear-gradient(135deg, #ffffff 0%, #fbfdff 72%, #f4f8ff 100%);
}

body[data-layout-page="promo-links"] .ib-agent-permission-title {
  align-items: center;
  gap: 12px;
}

body[data-layout-page="promo-links"] .ib-permission-icon {
  width: 38px;
  height: 38px;
  border: 1px solid #dbeafe;
  border-radius: 11px;
  background: linear-gradient(145deg, #eff6ff, #e0ecff);
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(var(--blue-rgb), 0.1);
}

body[data-layout-page="promo-links"] .ib-permission-card-title {
  min-width: 0;
  flex: 1;
}

body[data-layout-page="promo-links"] .ib-permission-card-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-layout-page="promo-links"] .ib-permission-card-eyebrow .status-pill {
  min-height: 20px;
  padding: 0 7px;
  font-size: 9px;
}

body[data-layout-page="promo-links"] .ib-owned-permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

body[data-layout-page="promo-links"] .ib-owned-permission {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #e4ebf5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.035);
}

body[data-layout-page="promo-links"] .ib-owned-permission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #66748c;
  font-size: 11px;
  font-weight: 800;
}

body[data-layout-page="promo-links"] .ib-owned-permission-head strong {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: #172033;
  font-size: 14px;
}

body[data-layout-page="promo-links"] .ib-owned-permission-head > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

body[data-layout-page="promo-links"] .ib-owned-permission-head > span i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 11px;
}

body[data-layout-page="promo-links"] .ib-owned-permission-head strong small {
  color: #8a97aa;
  font-size: 9px;
}

body[data-layout-page="promo-links"] .ib-owned-permission .chip-row {
  gap: 5px;
}

body[data-layout-page="promo-links"] .ib-owned-permission .resource-chip {
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-layout-page="promo-links"] .link-table {
  min-width: 960px;
}

body[data-layout-page="promo-links"] .link-primary-cell .link-copy-row {
  max-width: 100%;
}

body[data-layout-page="promo-links"] .link-primary-cell .link-url {
  max-width: min(360px, calc(100% - 58px));
}

body[data-layout-page="promo-links"] .link-row-actions .text-action {
  white-space: nowrap;
}

@media (max-width: 760px) {
  body[data-layout-page="promo-links"] .ib-permission-card-content {
    padding: 16px;
  }

  body[data-layout-page="promo-links"] .ib-agent-permission-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-layout-page="promo-links"] .promotion-page {
    padding: 18px 12px 40px;
  }

  body[data-layout-page="promo-links"] .promotion-heading {
    margin-bottom: 12px;
  }

  body[data-layout-page="promo-links"] .promotion-heading h1 {
    font-size: 24px;
  }

  body[data-layout-page="promo-links"] .ib-promotion-overview {
    gap: 12px;
    margin-bottom: 12px;
  }

  body[data-layout-page="promo-links"] .ib-overview-card,
  body[data-layout-page="promo-links"] .ib-rebate-card {
    min-height: 0;
    padding: 14px;
    border-radius: 12px;
  }

  body[data-layout-page="promo-links"] .ib-overview-card h2,
  body[data-layout-page="promo-links"] .ib-rebate-card h2,
  body[data-layout-page="promo-links"] .ib-link-tab-intro h2 {
    font-size: 16px;
  }

  body[data-layout-page="promo-links"] .ib-overview-period {
    min-height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }

  body[data-layout-page="promo-links"] .ib-overview-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
  }

  body[data-layout-page="promo-links"] .ib-overview-metrics > span {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 5px;
    padding-left: 9px;
    border-left-width: 2px;
  }

  body[data-layout-page="promo-links"] .ib-overview-metrics small {
    font-size: 10px;
    line-height: 1.25;
  }

  body[data-layout-page="promo-links"] .ib-overview-metrics strong {
    font-size: 26px;
  }

  body[data-layout-page="promo-links"] .ib-overview-link-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    margin-top: 12px;
    padding-top: 10px;
    font-size: 10px;
  }

  body[data-layout-page="promo-links"] .ib-overview-link-metrics span {
    white-space: nowrap;
  }

  body[data-layout-page="promo-links"] .ib-overview-link-metrics strong {
    font-size: 12px;
  }

  body[data-layout-page="promo-links"] .ib-rebate-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  body[data-layout-page="promo-links"] .ib-rebate-actions button {
    min-height: 86px;
    gap: 6px;
    padding: 10px;
    border-radius: 10px;
  }

  body[data-layout-page="promo-links"] .ib-rebate-actions button > i:first-child {
    font-size: 24px;
  }

  body[data-layout-page="promo-links"] .ib-rebate-actions strong {
    font-size: 11px;
  }

  body[data-layout-page="promo-links"] .ib-rebate-actions small {
    font-size: 9px;
  }

  body[data-layout-page="promo-links"] .ib-agent-permission-card {
    margin-bottom: 12px;
    border-radius: 12px;
  }

  body[data-layout-page="promo-links"] .ib-permission-card-content {
    padding: 14px;
  }

  body[data-layout-page="promo-links"] .ib-agent-permission-title {
    align-items: center;
    flex-wrap: nowrap;
  }

  body[data-layout-page="promo-links"] .ib-permission-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission:first-child {
    grid-column: 1 / -1;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission {
    gap: 6px;
    padding: 8px 9px;
    border-radius: 9px;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission-head {
    gap: 5px;
    font-size: 10px;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission-head > span {
    gap: 5px;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission-head > span i {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission-head strong {
    font-size: 13px;
  }

  body[data-layout-page="promo-links"] .ib-owned-permission .resource-chip {
    min-height: 22px;
    padding: 0 6px;
    font-size: 9px;
  }

  body[data-layout-page="promo-links"] .tab-panel {
    border-radius: 12px;
  }

  body[data-layout-page="promo-links"] .local-tabs {
    min-height: 51px;
    gap: 4px;
    padding: 5px 6px 0;
  }

  body[data-layout-page="promo-links"] .local-tabs button {
    min-height: 40px;
    gap: 5px;
    padding: 0 6px;
  }

  body[data-layout-page="promo-links"] .local-tab-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    font-size: 11px;
  }

  body[data-layout-page="promo-links"] .local-tab-copy strong {
    font-size: 11px;
  }

  body[data-layout-page="promo-links"] .tab-body {
    padding: 12px;
  }

  body[data-layout-page="promo-links"] .ib-link-tab-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  body[data-layout-page="promo-links"] .ib-link-tab-intro p {
    display: none;
  }

  body[data-layout-page="promo-links"] .ib-link-tab-count {
    min-width: 50px;
    min-height: 28px;
  }

  body[data-layout-page="promo-links"] .ib-link-tab-count strong {
    font-size: 13px;
  }

  body[data-layout-page="promo-links"] .link-main-column .filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
  }

  body[data-layout-page="promo-links"] .link-main-column .filter-search {
    grid-column: 1 / -1;
    min-width: 0;
    height: 40px;
  }

  body[data-layout-page="promo-links"] .link-main-column .link-type-filter {
    grid-column: 1 / -1;
    justify-self: start;
  }

  body[data-layout-page="promo-links"] .link-main-column .filter-panel select {
    width: 100%;
    height: 40px;
  }

  body[data-layout-page="promo-links"] .link-main-column .filter-panel > .secondary-action {
    width: auto;
    height: 40px;
    padding: 0 12px;
  }

  body[data-layout-page="promo-links"] .link-main-column .view-switch {
    display: none;
  }

  body[data-layout-page="promo-links"] [data-link-list-view] {
    display: none !important;
  }

  body[data-layout-page="promo-links"] .link-card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  body[data-layout-page="promo-links"] .promotion-link-card {
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    box-shadow: none;
  }

  body[data-layout-page="promo-links"] .promotion-link-card header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  body[data-layout-page="promo-links"] .link-card-title {
    gap: 4px;
  }

  body[data-layout-page="promo-links"] .link-card-title strong {
    font-size: 14px;
  }

  body[data-layout-page="promo-links"] .link-copy-row-url {
    padding: 7px 8px;
  }

  body[data-layout-page="promo-links"] .promotion-link-card .copy-mini {
    height: 28px;
  }

  body[data-layout-page="promo-links"] .link-card-stat-summary {
    gap: 6px;
  }

  body[data-layout-page="promo-links"] .link-card-stat-summary span {
    gap: 4px;
    padding: 8px;
  }

  body[data-layout-page="promo-links"] .link-card-stat-summary small {
    font-size: 9px;
  }

  body[data-layout-page="promo-links"] .link-card-stat-summary strong {
    font-size: 14px;
  }

  body[data-layout-page="promo-links"] .table-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
  }

  body[data-layout-page="promo-links"] .table-footer-left {
    display: block;
    font-size: 10px;
  }

  body[data-layout-page="promo-links"] .page-size {
    display: none;
  }

  body[data-layout-page="promo-links"] .pager {
    width: auto;
  }

  body[data-layout-page="promo-links"] .pager button {
    min-width: 34px;
    height: 36px;
  }
}

/* Account-type permission detail: reuse the server resource-panel language from link creation. */
body[data-layout-page="promo-links"] .ib-owned-permission-head-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body[data-layout-page="promo-links"] .ib-owned-permission-head-actions strong {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: #172033;
  font-size: 14px;
}

body[data-layout-page="promo-links"] .ib-owned-permission-head-actions strong small {
  color: #8a97aa;
  font-size: 9px;
}

body[data-layout-page="promo-links"] .ib-permission-detail-action {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border: 1px solid #dbe7fb;
  border-radius: 6px;
  background: #f5f9ff;
  color: var(--blue);
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

body[data-layout-page="promo-links"] .ib-permission-detail-action:hover,
body[data-layout-page="promo-links"] .ib-permission-detail-action:focus-visible {
  border-color: #9fc0fa;
  background: #eaf2ff;
  outline: 0;
}

body[data-layout-page="promo-links"] .ib-permission-detail-action i {
  font-size: 9px;
}

.account-type-permission-modal .promotion-link-create-dialog {
  width: min(860px, calc(100vw - 32px));
}

.account-type-permission-modal .promotion-link-create-body {
  padding: 14px 16px;
}

body[data-layout-page="promo-links"] .account-type-permission-layout {
  grid-template-columns: minmax(0, 1fr);
}

.account-type-permission-resources {
  align-content: start;
}

.account-type-permission-resources .promotion-create-server-panels {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.account-type-permission-server-panel > header {
  padding: 9px 10px;
}

.account-type-permission-server-panel > header > div {
  grid-template-columns: minmax(0, 1fr);
}

body[data-layout-page="promo-links"] .account-type-permission-row {
  position: relative;
  overflow: visible;
  background: #fff;
}

.account-type-permission-row.is-invalid {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.055);
}

.account-type-permission-row-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
}

.account-type-permission-row-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-type-permission-row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.account-type-permission-tooltip {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #6c7890;
  cursor: help;
  font-size: 12px;
  outline: 0;
}

.account-type-permission-tooltip:hover,
.account-type-permission-tooltip:focus-visible {
  background: #eaf2ff;
  color: var(--blue);
}

.account-type-permission-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 3;
  top: calc(100% + 7px);
  left: 0;
  width: max-content;
  max-width: min(250px, calc(100vw - 60px));
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 7px;
  background: #172033;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: normal;
}

.account-type-permission-tooltip:hover::after,
.account-type-permission-tooltip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

body[data-layout-page="promo-links"] .account-type-permission-row:has(.account-type-permission-tooltip:hover),
body[data-layout-page="promo-links"] .account-type-permission-row:focus-within {
  z-index: 4;
}

body[data-layout-page="promo-links"] .account-type-permission-row:last-child .account-type-permission-tooltip::after {
  top: auto;
  bottom: calc(100% + 7px);
  transform: translateY(3px);
}

body[data-layout-page="promo-links"] .account-type-permission-row:last-child .account-type-permission-tooltip:hover::after,
body[data-layout-page="promo-links"] .account-type-permission-row:last-child .account-type-permission-tooltip:focus-visible::after {
  transform: translateY(0);
}

.account-type-permission-marker {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 11px;
}

.account-type-permission-row strong {
  overflow: hidden;
  color: #172033;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-type-permission-row small {
  overflow: hidden;
  color: #76849a;
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .account-type-permission-layout {
    grid-template-columns: 1fr;
  }

  .account-type-permission-resources .promotion-create-server-panels {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .account-type-permission-modal .promotion-link-create-body {
    padding: 10px;
  }

  body[data-layout-page="promo-links"] .ib-permission-detail-action {
    padding: 0 5px;
    font-size: 9px;
  }
}

/* Keep row actions ordered and visually grouped: edit, detail, delete. */
body[data-layout-page="promo-links"] .link-row-actions {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: nowrap;
  padding: 3px;
  border: 1px solid #e3eaf4;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.04);
  white-space: nowrap;
}

body[data-layout-page="promo-links"] .link-table th:nth-child(3),
body[data-layout-page="promo-links"] .link-table td:nth-child(3) {
  width: 132px;
  min-width: 132px;
}

body[data-layout-page="promo-links"] .link-row-actions .text-action {
  min-width: 38px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #51617a;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}

body[data-layout-page="promo-links"] .link-row-actions .link-action-edit:hover,
body[data-layout-page="promo-links"] .link-row-actions .link-action-edit:focus-visible {
  background: #edf4ff;
  color: var(--blue-ink);
}

body[data-layout-page="promo-links"] .link-row-actions .link-action-detail {
  background: #eaf2ff;
  color: var(--blue-ink);
}

body[data-layout-page="promo-links"] .link-row-actions .link-action-detail:hover,
body[data-layout-page="promo-links"] .link-row-actions .link-action-detail:focus-visible {
  background: #dbeafe;
  color: var(--blue-deep);
}

body[data-layout-page="promo-links"] .link-row-actions .link-action-delete {
  color: #dc2626;
}

body[data-layout-page="promo-links"] .link-row-actions .link-action-delete:hover,
body[data-layout-page="promo-links"] .link-row-actions .link-action-delete:focus-visible {
  background: #fff1f2;
  color: #b91c1c;
}

body[data-layout-page="promo-links"] .link-row-actions .text-action:focus-visible {
  outline: 2px solid rgba(var(--blue-rgb), 0.3);
  outline-offset: 1px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal {
  width: min(520px, calc(100vw - 32px));
  border-color: #f2d6d8;
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(127, 29, 29, 0.2);
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-header {
  padding: 20px 22px 17px;
  background: linear-gradient(180deg, #fffafa 0%, #fff 100%);
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-header .summary-kicker {
  color: #b4232c;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-header h2 {
  margin-top: 5px;
  font-size: 20px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-header p {
  margin-top: 6px;
  font-size: 12px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-body {
  display: grid;
  gap: 14px;
  padding: 18px 22px 20px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-warning {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #fecdd3;
  border-radius: 11px;
  background: #fff4f5;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-warning-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #ffe1e5;
  color: #c62835;
  font-size: 14px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-warning strong {
  display: block;
  color: #9f1d2b;
  font-size: 13px;
  line-height: 1.35;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-warning p {
  margin: 5px 0 0;
  color: #8f4a52;
  font-size: 12px;
  line-height: 1.6;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid #e5ebf4;
  border-radius: 10px;
  background: #f8fafc;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 16px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target small {
  color: #7b8799;
  font-size: 10px;
  font-weight: 800;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target strong,
:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target > div > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target strong {
  color: #172033;
  font-size: 13px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-target > div > span {
  color: #64748b;
  font-size: 11px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #dbe7fb;
  border-radius: 10px;
  background: #f8fbff;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement-head > div {
  display: grid;
  gap: 3px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement-head small,
:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-select-field > span {
  color: #6f7d92;
  font-size: 10px;
  font-weight: 800;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement-head strong {
  color: #172033;
  font-size: 13px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement-optional {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #cfe0fb;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-search-field {
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #fff;
  color: #8a97aa;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-search-field:focus-within,
:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-select-field:focus-within {
  border-color: #8eb5f8;
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.1);
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-search-field i {
  flex: 0 0 auto;
  font-size: 13px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-search-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172033;
  font: inherit;
  font-size: 12px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-search-field input::placeholder {
  color: #9aa6b8;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-select-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-select-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #172033;
  font: inherit;
  font-size: 12px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: #748198;
  font-size: 10px;
  line-height: 1.4;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-replacement-hint i {
  color: #6d9ff1;
  font-size: 12px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #7b8799;
  font-size: 11px;
  line-height: 1.45;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-note i {
  color: #8b98aa;
  font-size: 13px;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal .modal-footer {
  padding: 14px 22px;
  background: #fff;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal .danger-action {
  min-width: 104px;
  gap: 7px;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}

:is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal .promo-delete-confirm-label {
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  line-height: 1;
}

@media (max-width: 760px) {
  body[data-layout-page="promo-links"] .link-row-actions {
    width: fit-content;
    max-width: 100%;
  }

  body[data-layout-page="promo-links"] .link-row-actions .text-action {
    min-width: 36px;
    padding: 0 6px;
    font-size: 10px;
  }

  :is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-header,
  :is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  :is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-header {
    position: relative;
    align-items: flex-start;
    flex-direction: row;
    padding-right: 58px;
  }

  :is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-header .modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    margin: 0;
  }

  :is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-modal-body {
    padding: 14px 16px 16px;
  }

  :is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-warning {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    padding: 11px;
  }

  :is(body[data-layout-page="promo-links"], body[data-layout-page="admin-promo-links"]) .promo-delete-warning p {
    font-size: 11px;
  }
}

/* IB promotion link standalone detail */
body[data-layout-page="promo-link-detail"] .promotion-page {
  padding-top: 24px;
  font-size: 13px;
}

body[data-layout-page="promo-link-detail"] .promo-detail-shell {
  max-width: 1320px;
}

.promo-detail-back {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #536174;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.promo-detail-back i {
  font-size: 15px;
}

.promo-detail-back:hover {
  color: #1f64e8;
}

.promo-detail-back:focus-visible,
.promo-detail-record-tabs button:focus-visible,
.promo-detail-pagination button:focus-visible,
.promo-detail-value-field button:focus-visible,
.promo-detail-qr-button:focus-visible {
  outline: 3px solid rgba(var(--blue-rgb), 0.2);
  outline-offset: 2px;
}

body[data-layout-page="promo-link-detail"] .promo-detail-heading {
  align-items: flex-end;
  margin-bottom: 18px;
}

body[data-layout-page="promo-link-detail"] .promo-detail-heading h1 {
  margin-top: 3px;
  font-size: 28px;
}

.promo-detail-updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #7a889b;
  font-size: 11px;
}

.promo-detail-updated strong {
  color: #46556a;
  font-weight: 750;
}

.promo-detail-statistics-card,
.promo-detail-overview-card,
.promo-detail-record-card {
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(25, 60, 112, 0.05);
}

.promo-detail-statistics-card,
.promo-detail-overview-card {
  margin-bottom: 18px;
  padding: 22px;
}

.promo-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.promo-detail-card-head h2 {
  margin: 3px 0 0;
  color: #111c32;
  font-size: 20px;
  line-height: 1.25;
}

.promo-detail-overview-head {
  align-items: center;
}

.promo-detail-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.promo-detail-title-line .tiny-chip {
  margin-top: 3px;
}

.promo-detail-org-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 8px 0 0;
  color: #5b687a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.promo-detail-org-line[hidden] {
  display: none;
}

.promo-detail-org-line strong {
  color: #243147;
  font-size: 13px;
  font-weight: 800;
}

.promo-detail-org-line small {
  min-width: 0;
  color: #8a94a3;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.promo-detail-link-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(210px, 0.72fr) 112px;
  gap: 10px;
  margin-top: 20px;
}

.promo-detail-value-field {
  min-width: 0;
}

.promo-detail-value-field > span {
  display: block;
  margin: 0 0 7px 2px;
  color: #5b687a;
  font-size: 11px;
  font-weight: 700;
}

.promo-detail-value-field > div {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 14px;
  border: 1px solid #e1e9f4;
  border-radius: 9px;
  background: #f5f8fc;
}

.promo-detail-value-field strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #243147;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-detail-value-field button {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d6e2f3;
  border-radius: 8px;
  background: #fff;
  color: #2868ec;
  cursor: pointer;
}

.promo-detail-value-field button:hover,
.promo-detail-qr-button:hover {
  border-color: #8fb4ff;
  background: #eef5ff;
}

.promo-detail-qr-button {
  min-height: 52px;
  align-self: end;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid #d6e2f3;
  border-radius: 9px;
  background: #f5f8fc;
  color: #2868ec;
  cursor: pointer;
  font-family: inherit;
}

.promo-detail-qr-button i {
  font-size: 23px;
}

.promo-detail-qr-button span {
  color: #60718a;
  font-size: 9px;
  font-weight: 700;
}

.promo-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.promo-detail-metric {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e9f3;
  border-radius: 10px;
  background: #fff;
}

.promo-detail-metric > i {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  font-size: 16px;
}

.promo-detail-metric.blue > i { background: #edf4ff; color: #2f73ef; }
.promo-detail-metric.cyan > i { background: #ecf9ff; color: #2e9fd5; }
.promo-detail-metric.teal > i { background: #eafbf7; color: #0c9d83; }
.promo-detail-metric.green > i { background: #eefbf2; color: #189858; }

.promo-detail-metric span {
  min-width: 0;
  display: grid;
}

.promo-detail-metric small {
  color: #718096;
  font-size: 10px;
  font-weight: 700;
}

.promo-detail-metric strong {
  margin-top: 2px;
  color: #111c32;
  font-size: 22px;
  line-height: 1.15;
}

.promo-detail-metric em {
  margin-top: 3px;
  overflow: hidden;
  color: #8a98aa;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-detail-record-card {
  overflow: hidden;
}

.promo-detail-record-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 22px;
  border-bottom: 1px solid #e3eaf3;
}

.promo-detail-record-tabs button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #65748a;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
}

.promo-detail-record-tabs button:hover {
  color: #2768e8;
}

.promo-detail-record-tabs button.is-active {
  border-bottom-color: #2f73ed;
  color: #1f64e8;
}

.promo-detail-record-tabs button > span {
  min-width: 22px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #edf2f8;
  color: #6c7b90;
  font-size: 9px;
}

.promo-detail-record-tabs button.is-active > span {
  background: #eaf2ff;
  color: #2367e5;
}

.promo-detail-table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-color: #c5d1e1 #f4f7fa;
}

.promo-detail-table {
  width: 100%;
  border-collapse: collapse;
  color: #3a465a;
  font-size: 11px;
}

.promo-client-table {
  min-width: 850px;
}

.promo-account-table {
  min-width: 1260px;
}

.promo-detail-table th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #e1e8f1;
  background: #f5f8fc;
  color: #68778c;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.promo-detail-table td {
  height: 61px;
  padding: 9px 14px;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  vertical-align: middle;
  white-space: nowrap;
}

.promo-detail-table tbody tr:hover td {
  background: #fbfdff;
}

.promo-customer {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.promo-customer strong {
  color: #263348;
  font-size: 11px;
}

.promo-customer span {
  color: #8996a8;
  font-size: 9px;
}

.promo-account-number {
  display: flex;
  align-items: center;
  gap: 7px;
}

.promo-account-number strong {
  color: #28364b;
}

.promo-account-number span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef1f5;
  color: #7b8796;
  font-size: 8px;
  font-weight: 750;
}

.promo-account-number span.is-live {
  background: #eaf8f0;
  color: #14884d;
}

.promo-money {
  color: #223b6a;
}

.promo-record-status {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}

.promo-record-status.is-success { background: #eaf9f0; color: #12854a; }
.promo-record-status.is-info { background: #eaf3ff; color: #2769de; }
.promo-record-status.is-neutral { background: #f0f3f7; color: #6f7c8e; }

.promo-record-empty {
  padding: 22px;
  color: #8996a8;
  text-align: center;
}

.promo-detail-pagination {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 9px 14px 9px 22px;
  border-top: 1px solid #e3eaf3;
  background: #fbfcfe;
  color: #718096;
  font-size: 10px;
}

.promo-detail-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.promo-detail-pagination select {
  min-width: 54px;
  height: 32px;
  border: 1px solid #d7e1ee;
  border-radius: 7px;
  background: #fff;
  color: #37465b;
  font-family: inherit;
}

.promo-detail-pagination > span {
  justify-self: center;
}

.promo-detail-pagination nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.promo-detail-pagination button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e1ee;
  border-radius: 7px;
  background: #fff;
  color: #5d6b7e;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 750;
}

.promo-detail-pagination button:hover:not(:disabled),
.promo-detail-pagination button.is-active {
  border-color: #2f73ed;
  background: #2f73ed;
  color: #fff;
}

.promo-detail-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.promo-page-ellipsis {
  width: 20px;
  color: #8c98a8;
  text-align: center;
}

.promo-detail-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.promo-detail-empty[hidden] {
  display: none;
}

.promo-detail-empty > i {
  color: #8eb1ef;
  font-size: 36px;
}

.promo-detail-empty h2,
.promo-detail-empty p {
  margin: 0;
}

.promo-detail-empty p {
  color: #7b899d;
}

.promo-detail-empty .primary-action {
  margin-top: 10px;
  text-decoration: none;
}

.promo-detail-qr-modal .simple-modal {
  max-width: 440px;
}

.promo-detail-toast {
  z-index: 1005;
}

@media (max-width: 960px) {
  .promo-detail-link-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.7fr) 96px;
  }

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

@media (max-width: 820px) {
  body[data-layout-page="promo-link-detail"] .promotion-page {
    padding: 18px 14px 60px;
  }

  body[data-layout-page="promo-link-detail"] .promo-detail-heading,
  .promo-detail-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .promo-detail-statistics-card,
  .promo-detail-overview-card {
    padding: 16px;
  }

  .promo-detail-link-grid {
    grid-template-columns: 1fr 72px;
  }

  .promo-detail-url-field {
    grid-column: 1 / -1;
  }

  .promo-detail-metrics {
    grid-template-columns: 1fr;
  }

  .promo-detail-record-tabs {
    padding: 0 12px;
  }

  .promo-detail-record-tabs button {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .promo-detail-pagination {
    grid-template-columns: 1fr auto;
    padding: 12px;
  }

  .promo-detail-pagination > span {
    justify-self: end;
  }

  .promo-detail-pagination nav {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 980px) {
  .admin-link-filter-grid,
  .admin-link-filter-advanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .filter-panel.admin-link-filter {
    padding: 14px;
  }

  .admin-link-filter-grid,
  .admin-link-filter-advanced {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-link-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-link-filter-toggle,
  .admin-link-filter-action-group,
  .admin-link-filter-actions .primary-action,
  .admin-link-filter-actions .secondary-action {
    width: 100%;
  }

  .admin-link-filter-action-group {
    flex-direction: column;
  }
}
