/* Collapsed ReactWoo Geo hub: hide wp-admin flyout but keep submenu registered for ?page= access */
body.rwgc-admin-sidebar-collapsed #toplevel_page_rwgc-dashboard .wp-submenu,
body.rwgc-admin-sidebar-collapsed #toplevel_page_rwgc-dashboard.wp-has-submenu .wp-submenu {
  display: none !important;
}

body.rwgc-admin-sidebar-collapsed #toplevel_page_rwgc-dashboard.wp-has-submenu:hover .wp-submenu,
body.rwgc-admin-sidebar-collapsed #toplevel_page_rwgc-dashboard.wp-has-submenu.wp-menu-open .wp-submenu {
  display: none !important;
}

.rwgc-wrap {
  max-width: 1240px;
  margin: 20px auto;
  padding: 8px 12px 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  background: transparent;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.rwgc-wrap h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  margin: 0 0 6px;
}

.rwgc-wrap h2 {
  font-size: 21px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #111827;
  margin: 0 0 10px;
}

.rwgc-wrap h3 {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: #111827;
  margin: 20px 0 6px;
}

.rwgc-wrap .description {
  color: #4b5563;
  font-size: 13px;
  margin-top: 0;
  margin-bottom: 10px;
}

.rwgc-inner-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 20px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.rwgc-inner-nav__link {
  text-decoration: none;
  color: #344054;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.005em;
  text-transform: none;
  line-height: 1.2;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.rwgc-inner-nav__link:hover {
  background: #eff6ff;
  color: #0a4f8a;
}

.rwgc-inner-nav__link.is-active {
  background: #2271b1;
  color: #fff;
  border-color: #1f6398;
}

.rwgc-wrap .rwgc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.rwgc-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px;
  line-height: 1.55;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.rwgc-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.rwgc-card p {
  margin: 0 0 12px;
}

.rwgc-card ul,
.rwgc-card ol {
  margin: 0;
  padding-left: 18px;
}

.rwgc-card li {
  margin-bottom: 8px;
}

.rwgc-card li:last-child {
  margin-bottom: 0;
}

.rwgc-card--highlight {
  border-color: #dbeafe;
  box-shadow: 0 6px 18px rgba(34, 113, 177, 0.12);
}

.rwgc-card--full {
  margin-top: 22px;
  grid-column: 1 / -1;
}

.rwgc-tipbox {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 12px;
  padding: 14px 14px 10px;
  margin: 0 0 14px;
}

.rwgc-tipbox p {
  margin: 0 0 10px;
}

.rwgc-tipbox ul {
  margin: 0;
  padding-left: 18px;
}

.rwgc-steps {
  margin: 0 0 16px 18px;
}

.rwgc-steps li {
  margin-bottom: 8px;
}

.rwgc-snippet-table code {
  white-space: pre-wrap;
  word-break: break-word;
}

.rwgc-addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.rwgc-addons-grid--page {
  margin-top: 22px;
}

.rwgc-addons-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 8px;
}

.rwgc-addons-page .rwgc-card--full,
.rwgc-addons-page .rwgc-addons-grid--page {
  margin-top: 0;
}

.rwgc-addon-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.rwgc-addon-card h2 {
  margin: 2px 0 6px;
}

.rwgc-addon-summary {
  margin: 0 0 6px;
  flex: 1 1 auto;
}

.rwgc-addon-status {
  margin: 0;
}

.rwgc-addons-intro .button {
  margin-right: 8px;
  margin-bottom: 0;
}

.rwgc-addons-intro .button:last-child {
  margin-right: 0;
}

.rwgc-addon-card p:last-child {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 4px;
}

.rwgc-addon-card .button {
  min-height: 32px;
  line-height: 30px;
  padding: 0 12px;
}

.rwgc-addons-intro p:last-child {
  margin-bottom: 0;
}

.rwgc-addon-image {
  width: 100%;
  height: 84px;
  object-fit: contain;
  display: block;
  margin-bottom: 0;
}

.rwgc-addon-image-wrap {
  margin-bottom: 10px;
  min-height: 84px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rwgc-addon-image-placeholder {
  height: 84px;
  width: 100%;
  border-radius: 10px;
  border: 1px dashed #c9d7ea;
  background: linear-gradient(135deg, #f4f8ff 0%, #e8f0ff 100%);
  color: #1d4f91;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  text-transform: uppercase;
}

.rwgc-addons-intro--focus {
  border-color: #1e40af;
  background: linear-gradient(135deg, #102a56 0%, #1e3a8a 58%, #1d4ed8 100%);
  box-shadow: 0 12px 26px rgba(30, 64, 175, 0.28);
}

.rwgc-addons-intro--focus h2,
.rwgc-addons-intro--focus p,
.rwgc-addons-intro--focus .description {
  color: #e2e8f0;
}

.rwgc-addons-intro--focus .button:not(.button-primary) {
  border-color: #93c5fd;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.18);
}

.rwgc-wrap .form-table {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 24px 20px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  margin-bottom: 24px;
}

.rwgc-wrap .form-table th {
  width: 260px;
  padding: 16px 20px 16px 16px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  vertical-align: top;
}

.rwgc-wrap .form-table td {
  padding: 14px 16px;
}

.rwgc-wrap .form-table tr + tr th,
.rwgc-wrap .form-table tr + tr td {
  border-top: 1px solid #f1f5f9;
}

.rwgc-wrap .form-table th h2 {
  margin: 4px 0;
}

.rwgc-wrap p > .button + .button,
.rwgc-wrap p > .button + input + .button,
.rwgc-wrap .rwgc-actions .button + .button {
  margin-left: 8px;
}

/* Shared admin UI primitives (WordPress-safe, no fake app nav). */
.rwui-hero {
  background: linear-gradient(135deg, #2271b1 0%, #005891 100%);
  color: #fff;
  border-radius: 12px;
  padding: 24px;
  margin: 0 0 20px;
  box-shadow: 0 10px 24px rgba(2, 39, 74, 0.2);
}

.rwui-hero h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.rwui-hero p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.6;
}

.rwui-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rwui-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #eef6ff;
  color: #0a4f8a;
  border: 1px solid #cde0f7;
}

.rwui-badge--accent {
  background: #fef3f2;
  color: #b42318;
  border-color: #fecaca;
}

.rwui-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rwui-cta-row .button {
  font-weight: 600;
}

.rwgc-card p .button {
  margin-bottom: 8px;
}

.rwui-matrix {
  width: 100%;
  border-collapse: collapse;
}

.rwui-matrix th,
.rwui-matrix td {
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
}

.rwui-matrix th {
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475467;
}

/* Responsive pass for narrow admin widths */
@media (max-width: 900px) {
  .rwgc-wrap {
    padding: 4px 8px 20px;
  }

  .rwgc-wrap h1 {
    font-size: 24px;
  }

  .rwgc-wrap h2 {
    font-size: 18px;
  }

  .rwgc-inner-nav {
    gap: 8px;
    padding: 8px;
  }

  .rwgc-inner-nav__link {
    width: 100%;
    text-align: center;
  }

  .rwui-hero {
    padding: 16px;
  }

  .rwui-hero h2 {
    font-size: 21px;
  }

  .rwui-badges,
  .rwui-cta-row {
    gap: 6px;
  }

  .rwui-cta-row .button {
    width: 100%;
    text-align: center;
  }

  .rwui-matrix {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .rwui-matrix th,
  .rwui-matrix td {
    min-width: 190px;
  }

  .rwgc-card {
    padding: 16px;
  }

  .rwgc-card--full {
    margin-top: 16px;
  }

  .rwgc-addons-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .rwgc-addons-grid--page {
    margin-top: 16px;
  }

  .rwgc-addons-page {
    gap: 18px;
    margin-top: 4px;
  }

  .rwgc-addons-intro .button {
    margin-right: 0;
    margin-bottom: 8px;
  }

  .rwgc-addons-intro .button:last-child {
    margin-bottom: 0;
  }
}

/*
 * MaxMind screen on a phone. The credentials table is width:100% with a 1px
 * border that the table box model draws outside that width, so a 390px
 * viewport scrolls by a few pixels. Stack the rows and keep every control
 * inside the screen.
 */
@media (max-width: 782px) {
  .rwgc-maxmind-screen {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .rwgc-maxmind-screen .rwgc-card,
  .rwgc-maxmind-screen .form-table,
  .rwgc-maxmind-screen .form-table tbody,
  .rwgc-maxmind-screen .form-table tr,
  .rwgc-maxmind-screen .form-table th,
  .rwgc-maxmind-screen .form-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .rwgc-maxmind-screen .form-table {
    margin-left: 0;
    margin-right: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .rwgc-maxmind-screen .form-table th {
    width: auto;
    padding-bottom: 4px;
  }

  .rwgc-maxmind-screen .regular-text,
  .rwgc-maxmind-screen input[type="text"],
  .rwgc-maxmind-screen input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .rwgc-maxmind-screen code,
  .rwgc-maxmind-screen pre {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
  }

  .rwgc-maxmind-screen p > .button {
    margin-left: 0;
    margin-right: 8px;
    margin-bottom: 8px;
  }

  /*
   * Settings → Detection on a phone. The trusted-proxy textarea and the
   * Cloudflare checkbox sit in the same form table, which otherwise keeps a
   * 260px label column and scrolls sideways at 390px.
   */
  .rwgc-settings-screen {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .rwgc-settings-screen .form-table,
  .rwgc-settings-screen .form-table tbody,
  .rwgc-settings-screen .form-table tr,
  .rwgc-settings-screen .form-table th,
  .rwgc-settings-screen .form-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .rwgc-settings-screen .form-table {
    margin-left: 0;
    margin-right: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .rwgc-settings-screen .form-table th {
    width: auto;
    padding-bottom: 4px;
  }

  .rwgc-settings-screen .regular-text,
  .rwgc-settings-screen input[type="text"],
  .rwgc-settings-screen input[type="number"],
  .rwgc-settings-screen select,
  .rwgc-settings-screen textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .rwgc-settings-screen label {
    overflow-wrap: anywhere;
  }

  .rwgc-settings-screen p > .button {
    margin-left: 0;
    margin-bottom: 8px;
  }
}

/*
 * Colour contract (1.9.14).
 *
 * 1.9.13 had a prefers-color-scheme: dark block that turned .rwgc-wrap dark and made
 * every h1-h3, strong and .description inside it light. The cards were meant to go dark as well,
 * but rwgc-suite.css (loaded after this file, with a more specific selector) puts them
 * back on white, and about sixty other panels in Core and Geo Commerce hard-code light
 * backgrounds. The result was white headings on white cards, dark WordPress labels on
 * the dark form tables, and light text in white notices. The WordPress admin around
 * these screens has no dark mode, so the screens now use the light palette in both
 * schemes. Each container sets its own foreground from the tokens below, so text never
 * inherits a colour chosen for another background. Every pair meets WCAG AA (4.5:1).
 */
:root {
  --rwgc-canvas-fg: #1d2327;     /* 14.9:1 on #f0f0f1 */
  --rwgc-canvas-muted: #50575e;  /* 6.5:1 on #f0f0f1, 6.6:1 on #f0f4f8 */
  --rwgc-surface-bg: #ffffff;
  --rwgc-surface-fg: #1f2937;    /* 14.7:1 on white */
  --rwgc-surface-muted: #4b5563; /* 7.6:1 on white */
}

.rwgc-wrap {
  color: var(--rwgc-canvas-fg);
}

.rwgc-wrap .rwgc-card,
.rwgc-wrap .rwgc-addon-card,
.rwgc-wrap .notice,
.rwgc-app-shell .notice {
  color: var(--rwgc-surface-fg);
}

.rwgc-wrap > .description,
.rwgc-wrap > p.description {
  color: var(--rwgc-canvas-muted);
}

.rwgc-wrap ul.rwgc-docs-list {
  margin: 8px 0 0 1.25em;
  list-style: disc;
}

.rwgc-wrap ul.rwgc-docs-list code {
  font-size: 13px;
}

/* GeoCore Pro status (shown under Geo Core inner nav) */
.rwgc-pro-status {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.rwgc-pro-status--active {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.rwgc-pro-status--inactive {
  border-color: #fcd34d;
  background: #fffbeb;
}

.rwgc-pro-status--upsell {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.rwgc-pro-status__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rwgc-pro-status__title {
  font-size: 15px;
}

.rwgc-pro-status__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #2271b1;
  color: #fff;
}

.rwgc-pro-status__list {
  margin: 0 0 10px 1.1em;
  list-style: disc;
  color: #374151;
}

.rwgc-pro-status__list li {
  margin: 4px 0;
}

.rwgc-pro-status__actions {
  margin: 0;
}
