* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

body.admin-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.login-panel form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: 24px;
}

.subtitle {
  margin: 6px 0 0;
  color: #4b5563;
  font-size: 13px;
}

.header-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.header-links a {
  text-decoration: none;
  color: #111827;
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.header-links a.header-btn {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.header-links a.header-btn:hover {
  background: #1f2937;
}

.admin-logout-form {
  margin: 0;
}

.admin-logout-form button {
  background: #fff;
  color: #991b1b;
  border-color: #fecaca;
  padding: 6px 10px;
  font-size: 13px;
}

.admin-logout-form button:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.ops-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.ops-link-card {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.ops-link-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.ops-link-card p {
  margin: 0 0 8px;
  font-size: 12px;
  color: #475569;
}

.ops-link-card a {
  text-decoration: none;
  font-size: 12px;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
}

.ops-link-card a:hover {
  border-color: #111827;
}

.panel {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.billing-ops-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px;
}

.billing-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  text-decoration: none;
  color: #111827;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
}

.billing-nav-link:hover {
  border-color: #111827;
  background: #f8fafc;
}

.billing-primary-block,
.billing-settings-heading,
.billing-settings-block {
  scroll-margin-top: 72px;
}

h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

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

.grid-2 {
  grid-template-columns: minmax(260px, 1fr);
}

.config-admin-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 12px;
  align-items: start;
}

.config-table {
  min-width: 620px;
}

.config-schema-list {
  margin: 10px 0;
}

.config-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

input,
select,
textarea,
button {
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
}

input[readonly],
textarea[readonly] {
  color: #475569;
  background: #f8fafc;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

textarea {
  font-family: Consolas, "Courier New", monospace;
  resize: vertical;
}

.actions {
  margin: 10px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions a.action-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #fff;
  color: #111827;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
}

.actions a.action-link:hover {
  border-color: #111827;
}

.panel-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

a.action-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #fff;
  color: #111827;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
}

a.action-link:hover {
  border-color: #111827;
}

button {
  background: #111827;
  color: #fff;
  border-color: #111827;
  cursor: pointer;
}

button:hover {
  background: #1f2937;
}

button.secondary-btn {
  background: #fff;
  color: #111827;
  border-color: #cbd5e1;
}

button.secondary-btn:hover {
  background: #f8fafc;
  border-color: #111827;
}

button.danger,
.row-btn.danger {
  background: #991b1b;
  border-color: #991b1b;
  color: #fff;
}

button.danger:hover,
.row-btn.danger:hover {
  background: #7f1d1d;
  border-color: #7f1d1d;
}

button:disabled,
button:disabled:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.row-btn {
  padding: 6px 9px;
  font-size: 12px;
}

.row-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 9px;
  color: #111827;
  background: #fff;
  font-size: 12px;
}

.row-link:hover {
  border-color: #111827;
}

.row-link.compact-link {
  padding: 2px 7px;
  font-size: 11px;
  vertical-align: middle;
}

.status-line {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  background: #ecfeff;
  color: #155e75;
}

.status-line.error {
  background: #fef2f2;
  color: #991b1b;
}

.community-status-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  max-width: min(440px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid #b9e7cf;
  border-radius: 9px;
  background: #effaf4;
  color: #16764a;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.community-status-toast.error {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.compact-status {
  margin-top: 0;
  align-self: start;
  white-space: nowrap;
}

.table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: auto;
  background: #fff;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.inline-checkbox {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #334155;
}

.inline-checkbox input {
  width: auto;
}

.inline-select {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #334155;
}

.inline-select select {
  min-width: 150px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  background: #f9fafb;
  position: sticky;
  top: 0;
}

code {
  font-size: 12px;
}

.billing-ops-table {
  min-width: 1220px;
}

.billing-product-table {
  min-width: 940px;
}

.inactive-product-row {
  background: #f8fafc;
  color: #64748b;
}

.inactive-product-row code {
  color: #475569;
}

.muted-row td {
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
}

.paywall-scheduled-row td {
  background: #fffdf4;
}

.paywall-expired-row td,
.paywall-inactive-row td {
  color: #64748b;
  background: #f8fafc;
}

.paywall-incomplete-row td {
  background: #fff7ed;
}

.paywall-incomplete-row td:first-child {
  box-shadow: inset 3px 0 0 #f97316;
}

.current-subscription-row td {
  background: #f8fffb;
}

.current-subscription-row td:first-child {
  box-shadow: inset 3px 0 0 #22c55e;
}

.stale-subscription-row td {
  background: #fff7ed;
}

.stale-subscription-row td:first-child {
  box-shadow: inset 3px 0 0 #f97316;
}

.selected-table-row td {
  background: #eff6ff;
}

.selected-table-row td:first-child {
  box-shadow: inset 3px 0 0 #2563eb;
}

.billing-main-cell {
  display: grid;
  gap: 3px;
  max-width: 260px;
}

.billing-main-cell.user-cell {
  max-width: 220px;
}

.billing-main-cell strong {
  font-size: 13px;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
}

.billing-main-cell span,
.billing-main-cell small,
.cell-muted {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-block;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  background: #f8fafc;
}

.badge.ok {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.badge.badge-warning {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #92400e;
}

.badge.muted {
  background: #f5f3ff;
  border-color: #a78bfa;
  color: #5b21b6;
}

.badge.danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

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

.kpi-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.kpi-card.warning-card {
  border-color: #f59e0b;
  background: #fffbeb;
}

.production-kpi-card {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.production-kpi-card.mixed-currency {
  grid-column: span 2;
}

.sandbox-kpi-card {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
}

.billing-environment-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 10px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.billing-environment-banner strong {
  color: #0f172a;
  white-space: nowrap;
}

.billing-environment-banner.production {
  border-color: #86efac;
  background: #f0fdf4;
}

.billing-environment-banner.sandbox {
  border-color: #fdba74;
  background: #fff7ed;
}

.kpi-title {
  margin: 0;
  font-size: 12px;
  color: #475569;
}

.kpi-value {
  margin: 4px 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.4px;
  color: #111827;
  font-weight: 700;
}

.kpi-value.small-kpi {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
  word-break: keep-all;
}

.kpi-meta {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.status-chip {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.status-chip.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.status-chip:hover {
  background: #111827;
  color: #fff;
}

.compact-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.scheduler-filter {
  min-width: min(420px, 100%);
  margin-bottom: 0;
}

.compact-filters .wide-field {
  grid-column: 1 / -1;
}

.compact-filters .actions {
  margin: 0;
  align-self: end;
}

.compact-filters label small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.chat-policy-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.chat-history-cell {
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-width: 360px;
}

.billing-app-picker {
  min-width: 0;
  margin: 0;
  padding: 9px 10px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.billing-app-picker legend {
  padding: 0 5px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.billing-app-picker > small {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
}

.billing-app-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.billing-app-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  text-align: left;
}

.billing-app-option:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.billing-app-option.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.billing-app-option-all {
  border-style: dashed;
}

.billing-app-option-check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 800;
}

.billing-app-option.active .billing-app-option-check {
  background: #2563eb;
  color: #fff;
}

.billing-app-option strong,
.billing-app-option small {
  display: block;
  line-height: 1.25;
}

.billing-app-option small {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 400;
}

.billing-environment-badge {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.billing-environment-badge.production {
  border-color: #86efac;
  background: #ecfdf5;
  color: #166534;
}

.billing-environment-badge.sandbox {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.billing-environment-badge.unknown {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

@media (max-width: 720px) {
  .billing-environment-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .billing-app-option {
    flex: 1 1 calc(50% - 7px);
  }

  .production-kpi-card.mixed-currency {
    grid-column: span 1;
  }
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #dc2626;
  background: #fff7f7;
}

.validation-message {
  min-height: 18px;
  margin-bottom: 0;
}

.validation-message.error {
  color: #991b1b;
}

.push-queue-config-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.push-queue-config-cards article {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.push-queue-config-cards strong,
.push-queue-config-cards span,
.push-queue-config-cards small {
  display: block;
  line-height: 1.4;
}

.push-queue-config-cards strong {
  color: #0f172a;
  font-size: 12px;
}

.push-queue-config-cards span {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.push-queue-config-cards small {
  color: #64748b;
  font-size: 12px;
}

.editor-card {
  border: 1px solid #dbe2ea;
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.archive-editor {
  border-color: #fecaca;
  background: #fff7f7;
}

.form-help {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 13px;
}

.intake-flow-panel {
  background: #f8fafc;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.flow-step strong {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 13px;
}

.flow-step span {
  font-size: 13px;
  font-weight: 700;
}

.quick-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.quick-toolbar .wide-field {
  min-width: 240px;
}

.selected-summary {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 10px;
  color: #64748b;
  font-size: 13px;
}

.selected-summary.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.intake-easy-grid {
  margin-bottom: 10px;
}

.option-row {
  margin: 4px 0 10px;
}

.admin-advanced {
  margin-top: 10px;
}

.admin-advanced > summary {
  cursor: pointer;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}

.actions .danger {
  background: #991b1b;
  border-color: #991b1b;
  color: #fff;
}

.is-hidden {
  display: none;
}

.app-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.app-tab {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  padding: 6px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.app-tab.active {
  border-color: #2563eb;
  color: #fff;
  background: #2563eb;
}

.app-tab:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.app-tab.active:hover {
  filter: brightness(0.95);
}

.app-tab:disabled {
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
  cursor: not-allowed;
}

.app-tab:disabled:hover {
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.intake-app-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.intake-app-summary article {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.intake-app-summary strong,
.intake-app-summary span,
.intake-app-summary code {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.intake-app-summary strong {
  color: #0f172a;
}

.intake-limit-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.page-list-filters {
  grid-template-columns: minmax(170px, 220px) minmax(140px, 190px) minmax(260px, 1fr) minmax(120px, 150px);
}

.link-cell {
  min-width: 260px;
}

.link-cell a.public-url-link {
  display: inline-block;
  max-width: 360px;
  word-break: break-all;
  color: #0f172a;
  font-weight: 700;
}

.danger-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #fee2e2;
}

.link-check-badge {
  margin: 5px 0;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  min-height: 150px;
  max-height: 290px;
  overflow: auto;
}

.recent-item {
  display: grid;
  gap: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  font-size: 12px;
}

.recent-item strong {
  font-size: 12px;
}

.recent-item em {
  color: #64748b;
}

.recent-item span,
.recent-item small {
  color: #475569;
  word-break: break-all;
}

.meta-block {
  margin: 0;
  min-height: 90px;
  max-height: 220px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
}

.content-block {
  margin: 0;
  min-height: 120px;
  max-height: 320px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
}

.danger-details summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.danger-details summary small {
  font-size: 12px;
  font-weight: 500;
  color: #b45309;
}

.danger-details[open] summary {
  margin-bottom: 10px;
}

.warning-help {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff7ed;
  color: #9a3412;
}

.table-row-selected td {
  background: #ecfeff;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #f8fafc;
}

.clickable-post-row {
  cursor: pointer;
}

.clickable-post-row:hover td {
  background: #f8fafc;
}

.cell-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cell-actions .row-btn {
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.detail-item {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.detail-label {
  margin: 0;
  font-size: 11px;
  color: #64748b;
}

.detail-value {
  margin: 4px 0 0;
  font-size: 14px;
  color: #0f172a;
  word-break: break-all;
}

@media (max-width: 760px) {
  .quick-toolbar {
    grid-template-columns: 1fr;
  }

  .page-header {
    display: grid;
  }

  .config-admin-layout {
    grid-template-columns: 1fr;
  }
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.result {
  margin: 0;
  min-height: 140px;
  max-height: 380px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
}

.community-container {
  max-width: none;
  padding: 14px;
}

.community-status-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.community-board-shell {
  display: grid;
  gap: 12px;
}

.section-heading,
.board-heading,
.settings-title-row,
.reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2,
.board-heading h2,
.reader-header h2 {
  margin-bottom: 4px;
}

.board-mode-chips {
  justify-content: flex-end;
  margin: 0;
}

.community-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}

.community-metrics article {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
}

.community-metrics span {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.community-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  color: #0f172a;
  word-break: keep-all;
}

.board-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(260px, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: end;
}

.app-selector-control {
  min-width: 220px;
}

.report-review-box {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.report-review-box summary,
.settings-details summary {
  cursor: pointer;
  font-weight: 700;
}

.settings-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-details > summary small {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.settings-details:not([open]) {
  background: #f8fafc;
}

.report-card-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.report-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.report-card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.report-card p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.report-card.is-selected {
  border-color: #0891b2;
  background: #ecfeff;
}

.community-workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: start;
}

.board-list-panel,
.reader-panel {
  min-width: 0;
  min-height: min(720px, calc(100vh - 240px));
}

.board-post-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 2px;
}

.post-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.post-card-row:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.post-card-row.is-selected {
  border-color: #0891b2;
  background: #ecfeff;
}

.post-card-main {
  min-width: 0;
}

.post-card-title-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.post-card-title-line h3 {
  margin: 0;
  flex: 1 1 220px;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}

.post-card-type-summary {
  margin-top: 8px;
  color: #0369a1;
  font-size: 13px;
  font-weight: 800;
}

.post-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.post-card-id,
.muted-meta {
  color: #94a3b8;
  font-size: 12px;
}

.reader-panel {
  position: static;
  max-height: none;
  overflow: visible;
}

.reader-eyebrow {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 12px;
}

.reader-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.reader-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin: 10px 0;
  padding: 10px 0;
  color: #475569;
  font-size: 12px;
}

.reader-author-badge {
  display: none;
}

.post-reader-body {
  min-height: 220px;
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
  line-height: 1.65;
  font-size: 14px;
}

.community-post-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  white-space: normal;
}

.community-post-image-link {
  display: grid;
  min-height: 160px;
  overflow: hidden;
  place-items: center;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
}

.community-post-image {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
}

.community-post-body {
  white-space: pre-wrap;
}

.type-meta-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  white-space: normal;
}

.type-meta-card p {
  margin: 6px 0 0;
  color: #075985;
  font-weight: 700;
}

.type-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
}

.row-btn.active {
  border-color: #0284c7;
  background: #0284c7;
  color: #fff;
}

.reader-actions-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin: 12px 0;
}

.moderation-filters {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.reader-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.reader-actions button {
  min-height: 38px;
}

.reader-section {
  margin-top: 14px;
}

.comment-write-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.comment-write-card textarea {
  width: 100%;
  resize: vertical;
}

.compact-table-wrap table {
  min-width: 560px;
}

.compact-table-wrap {
  max-height: 260px;
  overflow: auto;
}

/* Let the page scroll through all comments/reports; retain horizontal table scrolling. */
.reader-panel .compact-table-wrap {
  max-height: none;
}

.settings-details {
  margin-top: 12px;
}

.settings-body {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.settings-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
}

.structure-section {
  border-top: 0;
  padding-top: 0;
}

.danger-help {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
}

.danger-help code {
  color: #7f1d1d;
  font-weight: 700;
}

.ops-note {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.ops-note summary {
  display: inline-flex;
  cursor: pointer;
  font-weight: 700;
}

.ops-note p {
  margin: 6px 0 0;
}

.ops-guide-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}

.ops-guide-card strong {
  color: #172554;
}

.structure-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #f8fafc;
}

.structure-result {
  margin-top: 10px;
}

.structure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.structure-grid section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.structure-grid h4 {
  margin: 0 0 8px;
}

.structure-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.small-text {
  font-size: 12px;
}

.app-text-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #f0f9ff;
  color: #075985;
  padding: 2px 7px;
  font-weight: 700;
}

.inline-actions {
  margin: 0;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  padding: 18px;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 980px) {
  .community-metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .board-toolbar,
  .community-workbench {
    grid-template-columns: 1fr;
  }

  .structure-grid {
    grid-template-columns: 1fr;
  }

  .reader-panel {
    position: static;
  }

  .board-heading,
  .settings-title-row,
  .reader-header {
    flex-direction: column;
  }

  .board-mode-chips,
  .reader-badges {
    justify-content: flex-start;
  }
}
.visibility-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #fff;
}

.check-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}

.check-chip input {
  width: auto;
  margin: 0;
}

.mini-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 700;
}

.muted {
  color: #64748b;
}
.notice-editor,
.admin-post-editor {
  margin-top: 12px;
}

.notice-editor textarea,
.admin-post-editor textarea {
  width: 100%;
  resize: vertical;
}

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

.editor-heading h3 {
  margin: 0;
}

.post-editor-schema {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin: 10px 0;
}

.post-editor-schema h4 {
  margin: 0 0 10px;
}

.admin-post-image-fieldset {
  min-width: 0;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #fff;
}

.admin-post-image-fieldset legend {
  padding: 0 6px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.admin-post-image-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.admin-post-image-picker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.admin-post-image-picker input {
  width: min(100%, 340px);
}

.admin-post-image-toolbar .form-help {
  margin: 0;
}

.admin-post-image-status {
  min-height: 20px;
  margin-top: 8px;
  color: #0369a1;
  font-size: 13px;
  font-weight: 700;
}

.admin-post-image-status.error {
  color: #b91c1c;
}

.admin-post-image-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.admin-post-image-preview {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 9px;
  background: #f8fafc;
}

.admin-post-image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e2e8f0;
}

.admin-post-image-preview figcaption {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  padding: 7px 8px;
  font-size: 11px;
}

.admin-post-image-preview figcaption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-post-image-preview figcaption small {
  flex: 0 0 auto;
  color: #64748b;
}

.admin-post-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 5px 8px;
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(15, 23, 42, 0.84);
  color: #fff;
  font-size: 11px;
}

.post-card-row.is-notice {
  border-color: #f59e0b;
  background: #fff7ad;
  color: #7c2d12;
  box-shadow: inset 4px 0 0 #f59e0b;
}

.post-card-row.is-notice .post-card-meta,
.post-card-row.is-notice .post-card-id {
  color: #92400e;
}

.notice-ribbon {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* RevenueCat-inspired billing overview */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.billing-overview-page {
  min-height: 100vh;
  background: #f6f7f9;
  color: #151922;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

.billing-overview-page [hidden] {
  display: none !important;
}

.billing-overview-page .container {
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 160px;
  padding: 26px 30px 48px;
}

.billing-overview-page .billing-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: block;
  width: 160px;
  margin: 0;
  padding: 18px 10px;
  overflow-y: auto;
  border-right: 1px solid #e5e7eb;
  background: #fff;
}

.billing-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 8px 18px;
}

.billing-brand-mark {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #151b29;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 800;
}

.billing-sidebar-brand h1 {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.billing-sidebar-brand .subtitle {
  margin-top: 2px;
  color: #7b8494;
  font-size: 10px;
}

.billing-sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  margin-left: auto;
  padding: 9px;
  border: 0;
  background: transparent;
  color: #151b29;
}

.billing-sidebar-toggle svg,
.billing-nav-icon svg,
.overview-kpi-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.billing-overview-page .header-links {
  display: grid;
  gap: 3px;
}

.billing-overview-page .header-links a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4b5565;
  font-size: 13px;
  font-weight: 650;
}

.billing-overview-page .header-links a:hover {
  background: #f4f6f9;
  color: #151922;
}

.billing-overview-page .header-links a.active {
  position: relative;
  background: #eef4ff;
  color: #1769e0;
}

.billing-overview-page .header-links a.active::before {
  position: absolute;
  inset: 4px auto 4px -10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1d6ff2;
  content: "";
}

.billing-nav-icon {
  display: inline-grid;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  place-items: center;
}

.billing-overview-page #billingConnectionPanel {
  position: fixed;
  z-index: 31;
  bottom: 12px;
  left: 11px;
  width: 138px;
  margin: 0;
  padding: 8px;
  border-color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.billing-overview-page #billingConnectionPanel .panel-toolbar {
  display: block;
}

.billing-overview-page #billingConnectionPanel #checkHealthBtn,
.billing-overview-page #billingConnectionPanel .action-link {
  display: none;
}

.billing-overview-page #billingConnectionPanel #billingOpsRefreshBtn {
  width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  background: #151b29;
  font-size: 11px;
}

.billing-overview-page #billingConnectionPanel .status-line {
  margin-top: 6px;
  padding: 5px 6px;
  overflow: hidden;
  border: 0;
  background: #f6f7f9;
  color: #697386;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-overview-page #billingOpsNav {
  display: none;
}

.billing-overview-page .billing-overview-dashboard {
  padding: 0;
  border: 0;
  background: transparent;
}

.billing-overview-header {
  align-items: center;
  margin: 2px 0 16px;
}

.billing-overview-header h2 {
  margin-bottom: 4px;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.billing-overview-header .form-help {
  margin: 0;
  color: #727c8d;
  font-size: 12px;
}

.billing-date-presets {
  gap: 0;
  padding: 3px;
  border: 1px solid #dfe3e8;
  border-radius: 9px;
  background: #fff;
}

.billing-date-presets button {
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #596273;
  font-size: 11px;
}

.billing-date-presets button:hover {
  background: #f0f3f7;
  color: #111827;
}

.billing-overview-page .billing-project-picker {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.billing-project-picker legend,
.billing-project-picker > small {
  display: none;
}

.billing-app-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.billing-app-picker-toolbar > strong {
  color: #344054;
  font-size: 12px;
}

.billing-app-picker-bulk-actions {
  display: flex;
  gap: 6px;
}

.billing-app-picker-bulk-actions button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #d8dde5;
  border-radius: 7px;
  background: #fff;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
}

.billing-app-picker-bulk-actions button:hover:not(:disabled) {
  border-color: #1d6ff2;
  background: #f5f8ff;
  color: #175fce;
}

.billing-app-picker-bulk-actions button:disabled {
  cursor: default;
  opacity: 0.45;
}

.billing-project-picker .billing-app-picker-options {
  gap: 8px;
}

.billing-project-picker .billing-app-option {
  min-height: 40px;
  padding: 7px 13px;
  border-color: #d8dde5;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.billing-project-picker .billing-app-option strong {
  font-size: 12px;
}

.billing-project-picker .billing-app-option small {
  display: none;
}

.billing-project-picker .billing-app-option-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 11px;
}

.billing-project-picker .billing-app-option.active {
  border-color: #1d6ff2;
  background: #f5f8ff;
  color: #175fce;
  box-shadow: inset 0 0 0 1px #1d6ff2;
}

.billing-project-picker .billing-app-option-all.active {
  border-style: solid;
  background: #176ff2;
  color: #fff;
  box-shadow: none;
}

.billing-project-picker .billing-app-option-all.active small,
.billing-project-picker .billing-app-option-all.active strong {
  color: #fff;
}

.billing-project-picker .billing-app-option-all.active .billing-app-option-check {
  background: rgba(255, 255, 255, 0.22);
}

.billing-overview-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(160px, 0.85fr) minmax(160px, 0.85fr) minmax(310px, 1.35fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.billing-overview-filters label {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}

.billing-overview-filters select,
.billing-overview-filters input {
  min-height: 40px;
  border-color: #dfe3e8;
  border-radius: 8px;
  background: #fff;
  color: #222936;
  font-size: 13px;
  font-weight: 650;
}

.billing-environment-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 40px;
  overflow: hidden;
  border: 1px solid #d8dde5;
  border-radius: 8px;
  background: #fff;
}

.billing-environment-segments button {
  min-height: 40px;
  padding: 7px 14px;
  border: 0;
  border-right: 1px solid #d8dde5;
  border-radius: 0;
  background: #fff;
  color: #3d4655;
  font-size: 13px;
  font-weight: 750;
}

.billing-environment-segments button:last-child {
  border-right: 0;
  color: #f26a21;
}

.billing-environment-segments button.active {
  background: #151b29;
  color: #fff;
}

.billing-environment-segments button[data-billing-environment="Sandbox"].active {
  background: #fff7ed;
  color: #e95b12;
  box-shadow: inset 0 0 0 1px #f97316;
}

.billing-overview-dashboard .billing-environment-banner {
  display: none;
}

.billing-overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.billing-overview-kpis .production-kpi-card.mixed-currency {
  grid-column: auto;
}

.overview-kpi-card {
  display: flex;
  min-width: 0;
  min-height: 164px;
  flex-direction: column;
  padding: 17px 18px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  background: #fff;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.overview-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.overview-kpi-card.production-kpi-card,
.overview-kpi-card.active-kpi-card {
  border-color: #9eddb3;
  background: #fff;
}

.overview-kpi-card.events-kpi-card {
  border-color: #a7c8ff;
}

.overview-kpi-card.sandbox-kpi-card {
  border-color: #fdba8c;
  background: #fff;
}

.overview-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.overview-kpi-card .kpi-title {
  color: #475163;
  font-size: 13px;
  font-weight: 750;
}

.overview-kpi-card .kpi-value {
  margin: 10px 0 7px;
  color: #138a3c;
  font-size: clamp(24px, 2.15vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  white-space: normal;
}

.overview-kpi-card.events-kpi-card .kpi-value {
  color: #1769e0;
}

.overview-kpi-card.sandbox-kpi-card .kpi-value {
  color: #ea5b10;
}

.overview-kpi-card .kpi-value small {
  display: inline-flex;
  margin-left: 5px;
  padding: 3px 7px;
  border: 1px solid #fdba8c;
  border-radius: 999px;
  background: #fff7ed;
  color: #e85e14;
  font-size: 9px;
  letter-spacing: 0;
  vertical-align: middle;
}

.overview-kpi-card .kpi-meta {
  min-height: 30px;
  color: #6f7888;
  font-size: 11px;
  line-height: 1.45;
}

.overview-kpi-icon {
  display: inline-grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 11px;
  border-radius: 50%;
  background: #e8f7ed;
  color: #159344;
}

.events-kpi-card .overview-kpi-icon {
  background: #e8f0ff;
  color: #176ff2;
}

.sandbox-kpi-card .overview-kpi-icon {
  background: #fff0e6;
  color: #f0661c;
}

.overview-kpi-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  margin-top: auto;
  color: #15803d;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.overview-kpi-link::after {
  content: "→";
}

.events-kpi-card .overview-kpi-link {
  color: #1769e0;
}

.sandbox-kpi-card .overview-kpi-link {
  color: #e85e14;
}

.billing-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.9fr);
  gap: 14px;
}

.billing-analytics-panel {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  background: #fff;
}

.billing-analytics-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.billing-analytics-heading h3 {
  margin: 0;
  font-size: 14px;
}

.billing-analytics-heading > span {
  color: #7b8494;
  font-size: 11px;
}

.billing-status-content {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.billing-status-donut {
  --active-end: 0%;
  --trial-end: 0%;
  --paused-end: 0%;
  --canceled-end: 0%;
  --expired-end: 0%;
  position: relative;
  display: grid;
  width: 126px;
  height: 126px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    #28a451 0 var(--active-end),
    #6ca6ff var(--active-end) var(--trial-end),
    #f59e0b var(--trial-end) var(--paused-end),
    #f9735b var(--paused-end) var(--canceled-end),
    #cfd5dd var(--canceled-end) var(--expired-end),
    #eef1f4 var(--expired-end) 100%
  );
}

.billing-status-donut::after {
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.billing-status-donut > div {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}

.billing-status-donut strong {
  font-size: 26px;
  letter-spacing: -0.04em;
}

.billing-status-donut span {
  color: #7a8392;
  font-size: 9px;
}

.billing-status-breakdown {
  display: grid;
  gap: 8px;
}

.billing-status-row {
  display: grid;
  grid-template-columns: 8px 82px 34px 54px minmax(60px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-size: 11px;
}

.billing-status-row strong {
  font-size: 11px;
}

.billing-status-row b {
  color: #313845;
  font-size: 11px;
}

.billing-status-row .status-percent {
  color: #535d6c;
  text-align: right;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cfd5dd;
}

.status-dot.active { background: #28a451; }
.status-dot.trial { background: #6ca6ff; }
.status-dot.paused { background: #f59e0b; }
.status-dot.canceled { background: #f9735b; }
.status-dot.expired { background: #cfd5dd; }

.billing-status-row i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}

.billing-status-row i > em {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #28a451;
  transition: width 0.28s ease;
}

.billing-status-row[data-status-row="trial"] i > em { background: #6ca6ff; }
.billing-status-row[data-status-row="paused"] i > em { background: #f59e0b; }
.billing-status-row[data-status-row="canceled"] i > em { background: #f9735b; }
.billing-status-row[data-status-row="expired"] i > em { background: #aeb7c3; }

.billing-environment-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 146px;
}

.billing-environment-compare article {
  position: relative;
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 18px;
  border-right: 1px solid #e5e7eb;
}

.billing-environment-compare article:last-child {
  border-right: 0;
}

.billing-environment-compare article > span {
  color: #178a41;
  font-size: 12px;
  font-weight: 750;
}

.billing-environment-compare article.sandbox > span {
  color: #e65d16;
}

.billing-environment-compare strong {
  font-size: 22px;
}

.billing-environment-compare strong b {
  font-size: inherit;
}

.billing-environment-compare small {
  min-height: 28px;
  color: #565f6e;
  font-size: 11px;
  line-height: 1.4;
}

.billing-environment-compare article > div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}

.billing-environment-compare article > div > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #159344;
  transition: width 0.28s ease;
}

.billing-environment-compare article.sandbox > div > i {
  background: #f26a21;
}

.billing-environment-compare article > em {
  position: absolute;
  right: 18px;
  bottom: 7px;
  color: #353c48;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.billing-overview-page .billing-recent-subscriptions {
  padding: 0;
  overflow: hidden;
  border-color: #dfe3e8;
  border-radius: 10px;
}

.billing-table-heading {
  padding: 15px 18px 0;
}

.billing-table-heading h2 {
  margin-bottom: 3px;
  font-size: 16px;
}

.billing-table-heading .form-help {
  margin: 0;
  font-size: 11px;
}

.billing-table-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px minmax(130px, 0.45fr) 90px auto;
  gap: 10px;
  align-items: end;
  padding: 12px 18px 14px;
}

.billing-table-toolbar label {
  color: #697386;
  font-size: 11px;
  font-weight: 700;
}

.billing-table-toolbar input,
.billing-table-toolbar select {
  min-height: 36px;
  border-color: #dfe3e8;
  border-radius: 8px;
  font-size: 12px;
}

.billing-table-actions {
  align-items: end;
  gap: 7px;
  margin: 0;
}

.billing-table-actions > button,
.billing-table-ops-menu > summary {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d8dde5;
  border-radius: 8px;
  background: #fff;
  color: #303846;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.billing-table-actions > button {
  background: #151b29;
  color: #fff;
}

.billing-table-ops-menu {
  position: relative;
}

.billing-table-ops-menu > summary {
  display: flex;
  align-items: center;
  list-style: none;
}

.billing-table-ops-menu > summary::-webkit-details-marker {
  display: none;
}

.billing-table-ops-menu[open] > div {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 170px;
  gap: 6px;
  padding: 8px;
  border: 1px solid #dfe3e8;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
}

.billing-table-ops-menu > div button {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  background: #f6f7f9;
  color: #343d4b;
  text-align: left;
  font-size: 10px;
}

.billing-recent-subscriptions .table-wrap {
  margin: 0;
  border-top: 1px solid #e5e7eb;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.billing-overview-page .billing-ops-table {
  min-width: 1260px;
}

.billing-overview-page .billing-ops-table th {
  padding: 9px 10px;
  background: #fafbfc;
  color: #5e6878;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.billing-overview-page .billing-ops-table td {
  padding: 10px;
  border-top-color: #e8ebef;
  background: #fff;
  font-size: 11px;
}

.billing-overview-page .billing-ops-table tr.current-subscription td {
  background: #fff;
}

.billing-overview-page .billing-ops-table tr.current-subscription td:first-child {
  box-shadow: inset 3px 0 0 #28a451;
}

.billing-overview-page .billing-main-cell {
  gap: 3px;
}

.billing-overview-page .billing-main-cell strong {
  font-size: 12px;
}

.billing-overview-page .billing-main-cell span,
.billing-overview-page .cell-muted {
  color: #707a8b;
  font-size: 10px;
}

.billing-recent-subscriptions .status-chips.is-hidden,
.billing-recent-subscriptions .app-tabs.is-hidden {
  display: none;
}

.billing-source-cell {
  display: grid;
  min-width: 112px;
  gap: 4px;
}

.billing-source-cell .acquisition-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #d7dde5;
  border-radius: 5px;
  background: #f5f7f9;
  color: #394354;
  font-size: 10px;
  font-weight: 800;
}

.billing-source-cell strong {
  color: #222b38;
  font-size: 11px;
}

.billing-source-cell small {
  color: #707a8b;
  font-size: 9px;
}

.billing-source-cell.source-store .acquisition-badge {
  border-color: #b9ddc5;
  background: #edf8f0;
  color: #176b37;
}

.billing-source-cell.source-promotion .acquisition-badge {
  border-color: #ead39c;
  background: #fff8e8;
  color: #805b08;
}

.billing-source-cell.source-referral_recipient .acquisition-badge {
  border-color: #acd8e8;
  background: #edf9fd;
  color: #12627f;
}

.billing-source-cell.source-referral_reward .acquisition-badge {
  border-color: #c9c3e7;
  background: #f4f2fb;
  color: #514287;
}

.billing-source-cell.source-manual .acquisition-badge {
  border-color: #d4d8de;
  background: #f3f4f6;
  color: #535c69;
}

.billing-overview-page .danger-details {
  padding: 0;
  overflow: hidden;
  border-color: #dfe3e8;
  border-radius: 10px;
  background: #fff;
}

.billing-overview-page .danger-details > summary {
  min-height: 52px;
  padding: 15px 18px;
  background: #fff;
}

.billing-overview-page .danger-details > summary span {
  font-size: 13px;
}

.billing-overview-page .danger-details > summary small {
  color: #778191;
}

@media (max-width: 1180px) {
  .billing-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .billing-overview-page .container {
    margin-left: 0;
    padding: 18px 16px 36px;
  }

  .billing-overview-page .billing-sidebar {
    position: sticky;
    inset: 0 auto auto 0;
    display: block;
    width: calc(100% + 32px);
    max-height: none;
    margin: -18px -16px 18px;
    padding: 12px 16px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .billing-sidebar-brand {
    min-height: 40px;
    padding: 0;
  }

  .billing-sidebar-brand h1 {
    font-size: 17px;
  }

  .billing-sidebar-brand .subtitle {
    display: none;
  }

  .billing-sidebar-toggle {
    display: inline-grid;
  }

  .billing-overview-page .header-links {
    position: absolute;
    top: calc(100% + 1px);
    right: 12px;
    left: 12px;
    display: none;
    max-height: min(70vh, 520px);
    padding: 8px;
    overflow-y: auto;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
  }

  .billing-sidebar-open .header-links {
    display: grid;
  }

  .billing-overview-page #billingConnectionPanel {
    display: none;
  }

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

  .billing-environment-segments {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .billing-overview-page .container {
    padding-right: 12px;
    padding-left: 12px;
  }

  .billing-overview-page .billing-sidebar {
    width: calc(100% + 24px);
    margin-right: -12px;
    margin-left: -12px;
  }

  .billing-overview-header {
    align-items: flex-start;
  }

  .billing-overview-header h2 {
    font-size: 26px;
  }

  .billing-date-presets {
    display: none;
  }

  .billing-project-picker .billing-app-picker-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .billing-app-picker-toolbar {
    margin-bottom: 8px;
  }

  .billing-project-picker .billing-app-option {
    flex: 0 0 auto;
  }

  .billing-overview-filters {
    grid-template-columns: 1fr 1fr;
  }

  .billing-date-field {
    grid-column: 1 / -1;
  }

  .billing-environment-segments {
    grid-column: 1 / -1;
  }

  .billing-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .overview-kpi-card {
    min-height: 154px;
    padding: 15px;
  }

  .billing-overview-kpis .overview-kpi-card.production-kpi-card {
    grid-column: 1 / -1;
  }

  .overview-kpi-card.sandbox-kpi-card {
    grid-column: 1 / -1;
  }

  .overview-kpi-card .kpi-value {
    font-size: 26px;
  }

  .billing-status-content {
    display: block;
  }

  .billing-status-donut {
    display: none;
  }

  .billing-status-row {
    grid-template-columns: 8px 72px 28px 46px minmax(56px, 1fr);
  }

  .billing-environment-compare {
    grid-template-columns: 1fr;
  }

  .billing-environment-compare article {
    min-height: 112px;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .billing-environment-compare article:last-child {
    border-bottom: 0;
  }

  .billing-table-toolbar {
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  .billing-search-field,
  .billing-table-actions {
    grid-column: 1 / -1;
  }

  .billing-table-actions {
    justify-content: flex-end;
  }

  .billing-recent-subscriptions .table-wrap {
    position: relative;
  }

  .billing-recent-subscriptions .table-wrap::after {
    position: absolute;
    inset: 0 0 0 auto;
    width: 26px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.08));
    content: "";
  }
}

.event-section-kicker {
  display: block;
  margin-bottom: 4px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.event-command-bar,
.event-overview-top,
.event-public-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.event-command-bar h2,
.event-overview h2 {
  margin-bottom: 4px;
}

.event-campaign-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 520px);
}

.event-campaign-picker select {
  flex: 1;
  min-width: 220px;
}

.event-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.event-title-row code {
  color: #475569;
  font-size: 11px;
}

.event-overview {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

.event-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #fff;
}

.event-metrics article {
  display: grid;
  gap: 3px;
  min-height: 78px;
  padding: 14px 16px;
  border-right: 1px solid #e5eaf1;
}

.event-metrics article:last-child {
  border-right: 0;
}

.event-metrics small {
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.event-metrics strong {
  color: #172b4d;
  font-size: 25px;
}

.event-public-link {
  align-items: end;
  margin-top: 16px;
}

.event-public-link label {
  flex: 1;
}

.event-public-link .actions {
  margin: 0;
}

.event-account-search {
  grid-template-columns: minmax(280px, 1fr) auto;
}

.event-select-account-btn,
.event-selected-account > button {
  padding: 6px 11px;
  color: #fff;
  border-color: #1e3a5f;
  background: #1e3a5f;
  font-size: 12px;
  font-weight: 750;
}

.event-provider-tag {
  display: inline-flex;
  margin: 1px 2px 1px 0;
  border-radius: 999px;
  padding: 3px 7px;
  color: #334155;
  background: #e8eef6;
  font-size: 10px;
  font-weight: 700;
}

.event-selected-account {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid #86efac;
  border-radius: 9px;
  padding: 13px;
  background: #f0fdf4;
}

.event-selected-account[hidden] {
  display: none;
}

.event-selected-account div {
  display: grid;
  gap: 4px;
}

.event-selected-account small,
.table-subline {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}

.event-selected-account strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-selected-account code {
  overflow: hidden;
  color: #475569;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-revoke-btn {
  padding: 5px 9px;
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
  font-size: 11px;
}

.danger-button {
  color: #b91c1c !important;
  border-color: #fecaca !important;
  background: #fff5f5 !important;
}

.event-settings-panel details > summary {
  cursor: pointer;
  list-style: none;
}

.event-settings-panel details > summary::-webkit-details-marker {
  display: none;
}

.event-settings-panel details > summary span {
  display: grid;
  gap: 4px;
}

.event-settings-panel details > summary small {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.event-campaign-form {
  margin-top: 18px;
  border-top: 1px solid #e5eaf1;
  padding-top: 18px;
}

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

.event-wide-field {
  grid-column: 1 / -1;
}

.event-reward-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
}

.event-reward-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-reward-heading > div {
  display: grid;
  gap: 3px;
}

.event-reward-heading small {
  color: #64748b;
  font-size: 11px;
}

.event-reward-heading button,
.event-remove-reward-btn {
  width: auto;
  min-height: 36px;
  white-space: nowrap;
}

.event-reward-rows {
  display: grid;
  gap: 8px;
}

.event-reward-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(120px, 0.45fr) minmax(130px, 0.6fr) auto;
  align-items: end;
  gap: 8px;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e5eaf1;
}

.event-reward-row label {
  gap: 5px;
  font-size: 11px;
}

.event-reward-preview {
  display: grid;
  min-height: 59px;
  align-content: center;
  gap: 3px;
  border-radius: 7px;
  padding: 8px 10px;
  background: #eff6ff;
}

.event-reward-preview small {
  color: #64748b;
  font-size: 10px;
}

.event-reward-preview strong {
  color: #172b4d;
  font-size: 16px;
}

.event-remove-reward-btn {
  color: #64748b;
  border-color: #cbd5e1;
  background: #fff;
}

.event-draw-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.event-draw-summary-item {
  display: grid;
  min-width: 0;
  min-height: 76px;
  align-content: center;
  justify-items: stretch;
  gap: 5px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  background: #fff;
}

.event-draw-summary-item small,
.event-draw-summary-item > span {
  color: #64748b;
  font-size: 10px;
}

.event-draw-summary-item strong {
  color: #172b4d;
  font-size: 22px;
}

.event-draw-total-input input {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.event-draw-summary.is-invalid .event-draw-total-input,
.event-draw-summary.is-invalid .event-draw-summary-item:last-child {
  border-color: #dc2626;
  background: #fef2f2;
}

.event-draw-summary.is-invalid .event-draw-summary-item:last-child strong {
  color: #b91c1c;
}

.event-settings-actions {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .event-command-bar,
  .event-overview-top,
  .event-public-link {
    align-items: stretch;
    flex-direction: column;
  }

  .event-campaign-picker,
  .event-public-link label {
    width: 100%;
  }

  .event-reward-editor {
    grid-template-columns: 1fr;
  }

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

  .event-reward-preview {
    min-height: 50px;
  }

}

@media (max-width: 680px) {
  .event-campaign-picker,
  .event-public-link .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .event-campaign-picker select,
  .event-public-link label {
    grid-column: 1 / -1;
  }

  .event-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .event-metrics article:nth-child(2) {
    border-right: 0;
  }

  .event-metrics article:nth-child(-n + 2) {
    border-bottom: 1px solid #e5eaf1;
  }

  .event-account-search,
  .event-selected-account,
  .event-campaign-fields {
    grid-template-columns: 1fr;
  }

  .event-wide-field {
    grid-column: auto;
  }

  .event-reward-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .event-reward-heading button,
  .event-remove-reward-btn {
    width: 100%;
  }

  .event-reward-row {
    grid-template-columns: 1fr;
  }

  .event-draw-summary {
    grid-template-columns: 1fr;
  }
}

/* Workers Note photo operations */
.workers-photo-metrics {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.workers-photo-filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(160px, 0.8fr) minmax(150px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
}

.workers-photo-filter-actions,
.workers-photo-pagination,
.workers-photo-preview-header,
.workers-photo-preview-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workers-photo-filter-actions {
  padding-bottom: 1px;
}

.workers-photo-list-panel .dashboard-header {
  align-items: end;
}

.workers-photo-reason-field {
  width: min(360px, 100%);
}

.workers-photo-table {
  min-width: 1030px;
}

.workers-photo-table th:first-child {
  width: 100px;
}

.workers-photo-table th:last-child {
  width: 126px;
}

.workers-photo-account-cell,
.workers-photo-schedule-cell,
.workers-photo-file-cell {
  min-width: 170px;
}

.workers-photo-account-cell > *,
.workers-photo-schedule-cell > *,
.workers-photo-file-cell > * {
  display: block;
  margin-bottom: 4px;
}

.workers-photo-account-cell small,
.workers-photo-schedule-cell small,
.workers-photo-file-cell small {
  color: #64748b;
  font-size: 12px;
}

.workers-photo-account-cell code,
.workers-photo-schedule-cell code,
.workers-photo-file-cell code {
  max-width: 190px;
  overflow: hidden;
  color: #475569;
  font-size: 11px;
  text-overflow: ellipsis;
}

.workers-photo-account-cell .compact-link {
  display: inline-flex;
  margin-top: 2px;
}

.workers-photo-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 118px;
}

.workers-photo-empty {
  padding: 36px 12px;
  color: #64748b;
  text-align: center;
}

.workers-photo-pagination {
  justify-content: center;
  margin-top: 14px;
}

.workers-photo-pagination span {
  min-width: 72px;
  color: #475569;
  font-size: 13px;
  text-align: center;
}

.workers-photo-preview-dialog {
  width: min(900px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.32);
}

.workers-photo-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(3px);
}

.workers-photo-preview-header,
.workers-photo-preview-footer {
  justify-content: space-between;
  padding: 16px 18px;
}

.workers-photo-preview-header {
  align-items: flex-start;
  border-bottom: 1px solid #e2e8f0;
}

.workers-photo-preview-header h2 {
  margin: 7px 0 2px;
}

.workers-photo-preview-frame {
  display: grid;
  min-height: 260px;
  max-height: calc(100vh - 240px);
  padding: 18px;
  overflow: auto;
  place-items: center;
  background: #0f172a;
}

.workers-photo-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 278px);
  object-fit: contain;
  border-radius: 7px;
}

.workers-photo-preview-footer {
  border-top: 1px solid #e2e8f0;
}

.workers-photo-preview-footer p {
  margin: 0;
  color: #475569;
  font-size: 13px;
}

@media (max-width: 900px) {
  .workers-photo-metrics {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .workers-photo-filter-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .workers-photo-filter-form {
    grid-template-columns: 1fr;
  }

  .workers-photo-filter-actions button {
    flex: 1;
  }

  .workers-photo-list-panel .dashboard-header,
  .workers-photo-preview-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .workers-photo-reason-field {
    width: 100%;
  }

  .workers-photo-preview-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .workers-photo-preview-frame {
    min-height: 220px;
    padding: 10px;
  }
}

/* Admin accounts and permission management */
.login-panel header {
  text-align: center;
}

.login-brand-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 50%;
  background: #172033;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.admin-key-login {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e3e8ef;
}

.admin-key-login summary {
  cursor: pointer;
  color: #687386;
  font-size: 13px;
  text-align: center;
}

.admin-key-login form {
  margin-top: 14px;
}

.admin-session-state > div {
  display: grid;
  min-width: 0;
}

.admin-session-state strong,
.admin-session-state small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-session-state small {
  margin-top: 1px;
  color: #8490a2;
  font-size: 10px;
  font-weight: 500;
}

.admin-readonly-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 18px;
  padding: 12px 14px;
  border: 1px solid #bfd5ff;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-readonly-notice .admin-nav-icon {
  width: 19px;
  height: 19px;
}

.admin-readonly-notice > div {
  display: grid;
  gap: 2px;
}

.admin-readonly-notice span {
  color: #55709f;
  font-size: 12px;
}

.admin-access-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  background: #fff;
}

.admin-access-summary article {
  display: grid;
  min-height: 104px;
  padding: 17px 20px;
  border-right: 1px solid #e6ebf1;
}

.admin-access-summary article:last-child {
  border-right: 0;
}

.admin-access-summary small,
.admin-access-summary span {
  color: #718096;
  font-size: 12px;
}

.admin-access-summary strong {
  margin: 4px 0;
  color: #172033;
  font-size: 27px;
}

.admin-access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(480px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.admin-access-list-panel,
.admin-access-editor {
  min-width: 0;
}

.admin-access-toolbar {
  align-items: center;
  margin-bottom: 14px;
}

.admin-access-toolbar h2,
.admin-access-editor h2,
.admin-permission-heading h3 {
  margin: 0;
}

.admin-access-table th:last-child,
.admin-access-table td:last-child {
  width: 110px;
  text-align: right;
}

.admin-access-table {
  min-width: 790px;
}

.admin-access-table [data-edit-admin] {
  min-height: 32px !important;
  padding: 5px 8px !important;
  white-space: nowrap;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.admin-user-cell > div {
  display: grid;
  gap: 3px;
}

.admin-user-cell small {
  color: #7b8798;
  font-size: 11px;
}

.admin-user-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.admin-user-avatar.root {
  background: #172033;
  color: #fff;
}

.admin-access-root-row {
  background: #fafcff;
}

.admin-lock-label {
  color: #8a94a5;
  font-size: 12px;
}

.empty-cell {
  padding: 34px !important;
  color: #758196;
  text-align: center !important;
}

.admin-access-editor {
  position: sticky;
  top: 18px;
}

.admin-access-editor-heading,
.admin-permission-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-access-editor-heading > div,
.admin-permission-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.admin-access-editor-heading span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-access-identity-grid {
  margin-bottom: 22px;
}

.admin-permission-heading {
  padding-top: 18px;
  border-top: 1px solid #e6ebf1;
}

.admin-permission-heading p {
  margin: 0;
  color: #718096;
  font-size: 12px;
}

.admin-permission-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-permission-presets button {
  min-height: 32px !important;
  padding: 5px 9px !important;
  font-size: 11px !important;
}

.admin-permission-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-permission-group {
  overflow: hidden;
  border: 1px solid #e0e6ee;
  border-radius: 8px;
}

.admin-permission-group h4 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #e0e6ee;
  background: #f7f9fc;
  font-size: 12px;
}

.admin-permission-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 56px 56px;
  align-items: center;
  gap: 6px;
  min-height: 39px;
  padding: 7px 10px;
  border-bottom: 1px solid #eef1f5;
  font-size: 11px;
}

.admin-permission-row:last-child {
  border-bottom: 0;
}

.admin-permission-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #536177;
  font-weight: 600;
}

.admin-permission-row input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.admin-permission-na {
  color: #a5adba;
  text-align: center;
}

.admin-app-scope-section {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid #dfe6ef;
  border-radius: 9px;
  background: #fafcff;
}

.admin-app-scope-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.admin-app-scope-heading h3,
.admin-app-scope-heading p,
.admin-app-scope-summary {
  margin: 0;
}

.admin-app-scope-heading p,
.admin-app-scope-summary {
  color: #718096;
  font-size: 12px;
}

.admin-app-scope-heading p {
  margin-top: 4px;
}

.admin-app-scope-all {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #cfd9e6;
  border-radius: 7px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.admin-app-scope-all input,
.admin-app-scope-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.admin-app-scope-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.admin-app-scope-list.disabled {
  opacity: 0.48;
}

.admin-app-scope-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e1e7ef;
  border-radius: 7px;
  background: #fff;
}

.admin-app-scope-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-app-scope-option strong,
.admin-app-scope-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-app-scope-option strong {
  color: #344054;
  font-size: 12px;
}

.admin-app-scope-option small,
.admin-app-scope-cell,
.admin-app-scope-empty {
  color: #718096;
  font-size: 11px;
}

.admin-access-form-actions {
  justify-content: flex-end;
}

@media (max-width: 1280px) {
  .admin-access-layout {
    grid-template-columns: 1fr;
  }

  .admin-access-editor {
    position: static;
  }
}

@media (max-width: 680px) {
  .admin-access-summary {
    grid-template-columns: 1fr;
  }

  .admin-access-summary article {
    min-height: 82px;
    border-right: 0;
    border-bottom: 1px solid #e6ebf1;
  }

  .admin-access-summary article:last-child {
    border-bottom: 0;
  }

  .admin-access-toolbar,
  .admin-access-editor-heading,
  .admin-permission-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-permission-presets {
    justify-content: flex-start;
  }

  .admin-permission-matrix {
    grid-template-columns: 1fr;
  }

  .admin-app-scope-heading {
    flex-direction: column;
  }

  .admin-app-scope-list {
    grid-template-columns: 1fr;
  }
}

/* Keep sidebar utility controls quiet even on pages with dark primary actions. */
.admin-shell-page:not(.billing-overview-page) button.billing-sidebar-toggle:not(:disabled),
.admin-shell-page:not(.billing-overview-page) .admin-sidebar-footer .admin-sidebar-refresh {
  border-color: #cdd6e2;
  background: #fff;
  color: #263247;
}

.admin-shell-page:not(.billing-overview-page) .admin-sidebar-footer .admin-logout-form button {
  border-color: transparent;
  background: transparent;
  color: #687386;
}

.admin-shell-page:not(.billing-overview-page) button.admin-mobile-refresh:not(:disabled) {
  border-color: #2563eb;
  background: rgba(255, 255, 255, 0.97);
  color: #2563eb;
}

@media (prefers-reduced-motion: reduce) {
  .overview-kpi-card,
  .billing-status-row i > em,
  .billing-environment-compare article > div > i {
    transition: none;
  }
}

/* Shared Workersnote admin shell */
.admin-shell-page {
  min-height: 100vh;
  background: #f6f8fb;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.admin-shell-page [hidden] {
  display: none !important;
}

.admin-shell-page .container,
.billing-overview-page.admin-shell-page .container {
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 220px;
  padding: 28px 32px 48px;
}

.admin-shell-page .admin-sidebar,
.billing-overview-page.admin-shell-page .billing-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 220px;
  margin: 0;
  padding: 18px 12px 14px;
  overflow: hidden;
  border-right: 1px solid #e1e7ef;
  background: #fff;
}

.admin-sidebar-brand,
.admin-shell-page .billing-sidebar-brand {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 8px 17px;
}

.admin-sidebar-brand .billing-brand-mark,
.admin-shell-page .billing-brand-mark {
  flex-basis: 32px;
  width: 32px;
  height: 32px;
  background: #172033;
  font-size: 18px;
}

.admin-sidebar-brand h1,
.admin-shell-page .billing-sidebar-brand h1 {
  color: #172033;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.admin-sidebar-brand .subtitle,
.admin-shell-page .billing-sidebar-brand .subtitle {
  margin-top: 2px;
  color: #7a8495;
  font-size: 11px;
}

.admin-shell-page .admin-nav,
.billing-overview-page.admin-shell-page .header-links.admin-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 15px;
  min-width: 0;
  min-height: 0;
  padding: 2px 0 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.admin-nav-group {
  display: grid;
  flex: 0 0 auto;
  min-width: 0;
  gap: 2px;
}

.admin-nav-label {
  display: block;
  padding: 5px 11px 6px;
  color: #8a94a5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.admin-shell-page .admin-nav a,
.billing-overview-page.admin-shell-page .header-links.admin-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4b5669;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.admin-shell-page .admin-nav a:hover,
.billing-overview-page.admin-shell-page .header-links.admin-nav a:hover {
  background: #f3f6fa;
  color: #172033;
}

.admin-shell-page .admin-nav a.active,
.billing-overview-page.admin-shell-page .header-links.admin-nav a.active {
  background: #eaf2ff;
  color: #1769e0;
}

.admin-shell-page .admin-nav a.active::before,
.billing-overview-page.admin-shell-page .header-links.admin-nav a.active::before {
  position: absolute;
  inset: 4px auto 4px -12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #2563eb;
  content: "";
}

.admin-nav-icon,
.admin-menu-icon,
.admin-home-link-icon {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
}

.admin-nav-icon svg,
.admin-menu-icon svg,
.admin-home-link-icon svg,
.admin-sidebar-refresh svg,
.admin-logout-form svg,
.admin-mobile-refresh svg,
.ops-link-card > a svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-sidebar-footer {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #edf0f4;
}

.admin-sidebar-refresh,
.admin-shell-page .admin-sidebar-footer #billingOpsRefreshBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #cdd6e2;
  border-radius: 7px;
  background: #fff;
  color: #263247;
  font-size: 12px;
  font-weight: 700;
}

.admin-sidebar-refresh .admin-nav-icon,
.admin-shell-page .admin-sidebar-footer #billingOpsRefreshBtn .admin-nav-icon {
  width: 15px;
  height: 15px;
}

.admin-session-state,
.admin-sidebar-footer .status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin: 0;
  padding: 5px 8px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #198754;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-session-state > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #19a966;
}

.admin-logout-form {
  margin: 0;
}

.admin-shell-page .admin-logout-form button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: #687386;
  font-size: 12px;
  font-weight: 600;
}

.admin-shell-page .admin-logout-form button:hover {
  background: #fff3f3;
  color: #b42318;
}

.admin-logout-form .admin-nav-icon {
  width: 16px;
  height: 16px;
}

.admin-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px;
}

.admin-page-heading h1 {
  margin: 0;
  color: #111827;
  font-size: 31px;
  font-weight: 790;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.admin-page-heading p {
  margin: 7px 0 0;
  color: #6d7889;
  font-size: 14px;
  line-height: 1.55;
}

.admin-shell-page:not(.billing-overview-page) .panel {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.admin-shell-page:not(.billing-overview-page) h2 {
  margin-bottom: 12px;
  color: #172033;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.admin-shell-page:not(.billing-overview-page) h3 {
  color: #172033;
  font-size: 14px;
}

.admin-shell-page:not(.billing-overview-page) .subtitle,
.admin-shell-page:not(.billing-overview-page) .form-help {
  color: #6f7b8d;
  line-height: 1.55;
}

.admin-shell-page:not(.billing-overview-page) label {
  color: #4f5b6d;
  font-size: 12px;
  font-weight: 650;
}

.admin-shell-page:not(.billing-overview-page) input,
.admin-shell-page:not(.billing-overview-page) select,
.admin-shell-page:not(.billing-overview-page) textarea {
  min-height: 40px;
  border-color: #cfd8e4;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  font-family: inherit;
  font-size: 13px;
}

.admin-shell-page:not(.billing-overview-page) input:focus,
.admin-shell-page:not(.billing-overview-page) select:focus,
.admin-shell-page:not(.billing-overview-page) textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
}

.admin-shell-page:not(.billing-overview-page) button,
.admin-shell-page:not(.billing-overview-page) .action-link {
  min-height: 36px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.admin-shell-page:not(.billing-overview-page) button:not(:disabled) {
  background: #172033;
}

.admin-shell-page:not(.billing-overview-page) .workers-note-admin-page button.secondary-btn:not(:disabled) {
  border-color: #cfd8e4;
  background: #fff;
  color: #172033;
}

.admin-shell-page:not(.billing-overview-page) .workers-note-admin-page button.secondary-btn:not(:disabled):hover {
  border-color: #172033;
  background: #f8fafc;
}

.admin-shell-page:not(.billing-overview-page) .action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #cfd8e4;
  background: #fff;
  color: #245fbe;
}

.admin-shell-page:not(.billing-overview-page) .status-line {
  border-color: #dce3ec;
  border-radius: 7px;
  background: #f7f9fc;
  color: #526074;
}

.admin-shell-page:not(.billing-overview-page) .status-line.ok {
  border-color: #b9e7cf;
  background: #effaf4;
  color: #16764a;
}

.admin-shell-page:not(.billing-overview-page) .status-line.error {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.admin-shell-page:not(.billing-overview-page) .table-wrap {
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
}

.admin-shell-page:not(.billing-overview-page) table {
  font-size: 12px;
}

.admin-shell-page:not(.billing-overview-page) th {
  padding: 10px 12px;
  border-bottom-color: #dce3ec;
  background: #f7f9fc;
  color: #637085;
  font-size: 11px;
  font-weight: 750;
}

.admin-shell-page:not(.billing-overview-page) td {
  padding: 11px 12px;
  border-bottom-color: #edf0f4;
  color: #354156;
}

.admin-shell-page:not(.billing-overview-page) tbody tr:hover td {
  background: #f7faff;
}

.admin-shell-page:not(.billing-overview-page) .badge {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.admin-home-status-strip {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 0.9fr;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  background: #fff;
}

.admin-home-status-strip article {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  padding: 14px 18px;
  border-right: 1px solid #e6ebf1;
}

.admin-home-status-strip article:last-child {
  border-right: 0;
}

.admin-home-status-strip small,
.admin-home-status-strip strong {
  display: block;
}

.admin-home-status-strip small {
  margin-bottom: 4px;
  color: #738095;
  font-size: 11px;
  font-weight: 650;
}

.admin-home-status-strip strong {
  max-width: 420px;
  overflow: hidden;
  color: #263247;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-home-status-strip #homeConnectionStatus {
  color: #168a54;
}

.admin-home-status-strip #homeConnectionStatus.error {
  color: #b42318;
}

.admin-home-status-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #19a966;
  box-shadow: 0 0 0 4px #e8f8ef;
}

.admin-home-status-icon {
  display: inline-grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  color: #536176;
  font-size: 9px;
  font-weight: 800;
}

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

.admin-home-section {
  margin-bottom: 22px;
}

.admin-home-section > h2 {
  margin: 0 0 10px;
}

.admin-home-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.admin-home-section-heading h2,
.admin-home-section-heading p {
  margin: 0;
}

.admin-home-section-heading p {
  margin-top: 4px;
  color: #718095;
  font-size: 12px;
}

.admin-home-section-heading button {
  flex: 0 0 auto;
  min-height: 32px !important;
  padding: 6px 10px;
  border: 1px solid #d5dde8;
  background: #fff !important;
  color: #405069;
}

.admin-home-note-ops-status {
  margin: -2px 0 10px;
  color: #66758a;
  font-size: 11px;
}

.admin-home-note-ops-status.error {
  color: #b42318;
}

.admin-home-note-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-note-ops-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  background: #fff;
}

.admin-note-ops-card.loading {
  min-height: 240px;
  color: #718095;
  font-size: 12px;
}

.admin-note-ops-card > header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-note-app-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: #edf4ff;
  color: #1769e0;
  font-size: 14px;
  font-weight: 850;
}

.admin-note-ops-card.store .admin-note-app-mark {
  background: #ecf9f1;
  color: #168a54;
}

.admin-note-ops-card h3,
.admin-note-ops-card code {
  display: block;
  margin: 0;
}

.admin-note-ops-card h3 {
  font-size: 15px !important;
  font-weight: 780;
}

.admin-note-ops-card code {
  margin-top: 3px;
  color: #7a8799;
  font-family: inherit;
  font-size: 10px;
}

.admin-note-ops-card > header a {
  color: #2667bf;
  font-size: 11px;
  font-weight: 720;
  text-decoration: none;
}

.admin-note-ops-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #e2e7ee;
  border-radius: 8px;
}

.admin-note-ops-metric {
  min-height: 78px;
  padding: 11px 12px;
  border-right: 1px solid #e8ecf2;
  border-bottom: 1px solid #e8ecf2;
  background: #fbfcfe;
}

.admin-note-ops-metric:nth-child(2n) {
  border-right: 0;
}

.admin-note-ops-metric:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.admin-note-ops-metric.primary {
  background: #f4f8ff;
}

.admin-note-ops-card.store .admin-note-ops-metric.primary {
  background: #f2fbf6;
}

.admin-note-ops-metric span,
.admin-note-ops-metric strong,
.admin-note-ops-metric small {
  display: block;
}

.admin-note-ops-metric span {
  color: #69778b;
  font-size: 10px;
  font-weight: 700;
}

.admin-note-ops-metric strong {
  margin-top: 5px;
  color: #172033;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.admin-note-ops-metric.primary strong {
  color: #1769e0;
}

.admin-note-ops-card.store .admin-note-ops-metric.primary strong {
  color: #168a54;
}

.admin-note-ops-metric small {
  margin-top: 2px;
  color: #8290a2;
  font-size: 9px;
}

.admin-note-ops-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #e6ebf1;
  border-radius: 8px;
  background: #e6ebf1;
}

.admin-note-ops-facts > span {
  min-width: 0;
  padding: 8px 9px;
  background: #fff;
}

.admin-note-ops-facts small,
.admin-note-ops-facts strong {
  display: block;
}

.admin-note-ops-facts small {
  overflow: hidden;
  color: #7a8799;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-note-ops-facts strong {
  margin-top: 3px;
  color: #354156;
  font-size: 12px;
}

.admin-note-ops-card.error {
  border-color: #fecaca;
  background: #fffafa;
}

.admin-note-ops-card.error > p {
  margin: 24px 0 0;
  color: #b42318;
  font-size: 12px;
}

.admin-note-ops-card.error > p small {
  display: block;
  margin-top: 5px;
  color: #95615d;
}

.admin-home-main .ops-links {
  display: block;
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  background: #fff;
}

.admin-home-main .ops-link-card {
  position: relative;
  display: grid;
  grid-template: "icon title action" auto "icon desc action" auto / 46px minmax(0, 1fr) 38px;
  column-gap: 13px;
  min-height: 78px;
  padding: 15px 14px;
  border: 0;
  border-bottom: 1px solid #e5eaf1;
  border-radius: 0;
  background: #fff;
}

.admin-home-main .ops-link-card:last-child {
  border-bottom: 0;
}

.admin-home-main .ops-link-card:hover {
  background: #f7faff;
}

.admin-home-link-icon {
  grid-area: icon;
  align-self: center;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
}

.admin-home-main .ops-link-card h3 {
  grid-area: title;
  align-self: end;
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 760;
}

.admin-home-main .ops-link-card p {
  grid-area: desc;
  align-self: start;
  margin: 0;
  overflow: hidden;
  color: #718095;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-home-main .ops-link-card > a {
  display: grid;
  grid-area: action;
  align-self: center;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #617087;
}

.admin-home-main .ops-link-card > a::before {
  position: absolute;
  inset: 0;
  content: "";
}

.admin-home-main .ops-link-card > a:hover {
  background: #eaf2ff;
  color: #1769e0;
}

.admin-home-connection {
  position: sticky;
  top: 24px;
}

.admin-home-connection label {
  display: grid;
  gap: 7px;
}

.admin-home-connection .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.admin-home-connection .status-line {
  margin-top: 12px;
}

.admin-home-resource-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.admin-mobile-refresh {
  display: none;
}

.billing-overview-page.admin-shell-page #billingConnectionPanel {
  display: none !important;
}

@media (max-width: 1120px) {
  .admin-home-layout {
    grid-template-columns: 1fr;
  }

  .admin-home-connection {
    position: static;
  }
}

@media (max-width: 900px) {
  .admin-shell-page .container,
  .billing-overview-page.admin-shell-page .container {
    margin-left: 0;
    padding: 18px 16px 86px;
  }

  .admin-shell-page .admin-sidebar,
  .billing-overview-page.admin-shell-page .billing-sidebar {
    position: sticky;
    inset: 0 auto auto 0;
    z-index: 40;
    display: flex;
    width: calc(100% + 32px);
    max-height: none;
    margin: -18px -16px 20px;
    padding: 12px 16px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #e1e7ef;
  }

  .admin-sidebar-brand,
  .admin-shell-page .billing-sidebar-brand {
    width: 100%;
    min-height: 42px;
    padding: 0;
  }

  .admin-sidebar-brand h1,
  .admin-shell-page .billing-sidebar-brand h1 {
    font-size: 18px;
  }

  .admin-sidebar-brand .subtitle,
  .admin-shell-page .billing-sidebar-brand .subtitle {
    display: none;
  }

  .admin-shell-page .billing-sidebar-toggle {
    display: inline-grid;
  }

  .admin-shell-page .admin-nav,
  .billing-overview-page.admin-shell-page .header-links.admin-nav {
    position: static;
    display: none;
    flex: 0 1 auto;
    width: 100%;
    max-height: 58vh;
    margin-top: 10px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  }

  .admin-shell-page .admin-sidebar-footer {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    background: #fff;
  }

  .admin-sidebar-open .admin-sidebar,
  .billing-overview-page.admin-sidebar-open .billing-sidebar {
    max-height: 88vh;
    overflow-y: auto;
  }

  .admin-sidebar-open .admin-nav,
  .billing-overview-page.admin-sidebar-open .header-links.admin-nav,
  .admin-sidebar-open .admin-sidebar-footer {
    display: flex;
  }

  .admin-sidebar-open .admin-sidebar-footer {
    display: grid;
  }

  .admin-page-heading {
    margin-bottom: 18px;
  }

  .admin-page-heading h1 {
    font-size: 28px;
  }

  .admin-home-status-strip {
    grid-template-columns: 1fr 1fr;
  }

  .admin-home-status-strip article:nth-child(2) {
    display: none;
  }

  .admin-home-status-strip article:first-child {
    border-right: 1px solid #e6ebf1;
  }

  .admin-home-status-strip article:last-child {
    border-right: 0;
  }

  .admin-mobile-refresh {
    position: fixed;
    z-index: 35;
    right: 16px;
    bottom: 14px;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border: 1px solid #2563eb;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.97);
    color: #2563eb;
    font-size: 14px;
    font-weight: 750;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(8px);
  }

  .admin-mobile-refresh .admin-nav-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 680px) {
  .admin-shell-page .container,
  .billing-overview-page.admin-shell-page .container {
    padding-right: 12px;
    padding-left: 12px;
  }

  .admin-shell-page .admin-sidebar,
  .billing-overview-page.admin-shell-page .billing-sidebar {
    width: calc(100% + 24px);
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .admin-page-heading p {
    font-size: 13px;
  }

  .admin-home-status-strip {
    display: block;
    margin-bottom: 20px;
  }

  .admin-home-status-strip article {
    min-height: 70px;
    border-right: 0 !important;
    border-bottom: 1px solid #e6ebf1;
  }

  .admin-home-status-strip article:last-child {
    border-bottom: 0;
  }

  .admin-home-main .ops-link-card {
    min-height: 82px;
    padding: 15px 12px;
  }

  .admin-home-main .ops-link-card p {
    max-width: 230px;
  }

  .admin-home-section-heading {
    align-items: flex-start;
  }

  .admin-home-section-heading p {
    max-width: 230px;
  }

  .admin-home-note-ops-grid {
    grid-template-columns: 1fr;
  }

  .admin-home-connection .actions,
  .admin-home-resource-links {
    grid-template-columns: 1fr;
  }

  .admin-shell-page:not(.billing-overview-page) .panel {
    padding: 15px;
  }

  .admin-shell-page:not(.billing-overview-page) .grid,
  .admin-shell-page:not(.billing-overview-page) .compact-filters,
  .admin-shell-page:not(.billing-overview-page) .config-admin-layout {
    grid-template-columns: 1fr;
  }
}
#calendarCountryHeader {
  flex-wrap: wrap;
  gap: 12px;
}

#calendarCountryHeader > div:first-child {
  flex: 1 1 300px;
  min-width: 0;
}

#calendarManifestStatus {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Shared map content moderation */
.places-admin [hidden] { display: none !important; }
.places-admin [role="tab"][aria-selected="true"] { background: var(--accent, #315bdb); color: #fff; }
.places-admin td { white-space: pre-line; overflow-wrap: anywhere; max-width: 480px; }
.places-admin .panel-toolbar { flex-wrap: wrap; gap: 10px; }
.places-dialog { width: min(760px, calc(100vw - 32px)); max-height: 88vh; box-sizing: border-box; border: 1px solid #dce2ee; border-radius: 16px; padding: 24px; color: #172338; }
.places-dialog::backdrop { background: #17233888; }
.places-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.places-dialog p { white-space: pre-wrap; overflow-wrap: anywhere; }
.places-dialog textarea { width: 100%; box-sizing: border-box; margin: 8px 0 14px; }
.places-dialog button { min-height: 44px; }
.places-photos { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.places-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
@media(max-width:600px) { .places-dialog { padding:16px; } .places-photos { grid-template-columns: 1fr; } }
.admin-shell-page .places-admin button[role="tab"][aria-selected] { background:#eef2f8; color:#334155; min-height:44px; }
.admin-shell-page .places-admin button[role="tab"][aria-selected="true"] { background:#315bdb; color:#fff; }
.places-admin .panel-toolbar { display:flex; align-items:end; margin-bottom:12px; }
@media(max-width:600px) {
  .places-admin table { min-width:0; width:100%; }
  .places-admin th:nth-child(3), .places-admin td:nth-child(3) { display:none; }
  .places-admin td, .places-admin th { padding:10px 6px; }
  .places-admin td:last-child button { white-space:nowrap; min-height:44px; }
}
