/* Revamped GY — public/frontend styles. Focused on My Domains (NS/DNSSEC) usability
   and responsive layout. Safe to load alongside any theme — selectors are scoped
   with the rgygy- prefix. */

/* ---------- Domain search ---------- */
.rgygy-domain-search-form { margin: 0 0 16px 0; }
.rgygy-label { display: block; margin: 0 0 8px 0; font-weight: 600; }
.rgygy-label-small { display: block; margin: 0 0 6px 0; }
.rgygy-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rgygy-control { flex: 1; min-width: 220px; }
.rgygy-control--years { flex: 0 0 auto; min-width: 160px; }
.rgygy-control--submit { flex: 0 0 auto; }
.rgygy-domain-search-form input[type="text"],
.rgygy-domain-search-form select { width: 100%; max-width: 100%; box-sizing: border-box; }

/* ---------- Shared form inputs ---------- */
.rgygy-input,
.rgygy-ns-panel select,
.rgygy-ns-panel input[type="text"],
.rgygy-ns-panel input[type="number"],
.rgygy-textarea {
  width: 100%; max-width: 100%; box-sizing: border-box;
  padding: 11px 13px; border: 1px solid rgba(0,0,0,.18); border-radius: 12px;
  font: inherit; color: inherit; background: #fff; line-height: 1.45;
}
.rgygy-textarea {
  min-height: 140px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}
.rgygy-input:focus, .rgygy-textarea:focus,
.rgygy-ns-panel select:focus,
.rgygy-ns-panel input[type="text"]:focus,
.rgygy-ns-panel input[type="number"]:focus {
  outline: none; border-color: #3655F6; box-shadow: 0 0 0 3px rgba(54,85,246,.18);
}
.rgygy-help { margin: 10px 0 0 0; }
.rgygy-search-note { margin: 0 0 14px 0; padding: 10px 12px; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; background: rgba(0,0,0,.025); }

/* ---------- Checkout upsells (privacy) ---------- */
.rgygy-checkout-upsells { margin: 14px 0 10px 0; padding: 14px; border: 1px solid rgba(0,0,0,.10); border-radius: 14px; background: rgba(0,0,0,.02); }
.rgygy-blocks-privacy-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rgygy-blocks-privacy-field label, .rgygy-blocks-privacy-field .wc-block-components-checkbox__label { font-weight: 700; color: #101010; flex: 1; }
.rgygy-blocks-privacy-field input[type="checkbox"] { transform: scale(1.05); }
.rgygy-checkout-upsells__title { margin: 0 0 10px 0; }
.rgygy-checkout-upsells__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rgygy-checkout-upsells__label { display: flex; align-items: flex-start; gap: 10px; margin: 0; flex: 1; }
.rgygy-checkout-upsells__label input[type="checkbox"] { margin-top: 2px; transform: scale(1.05); }
.rgygy-checkout-upsells__text { display: inline-block; }
.rgygy-checkout-upsells__meta { display: inline-block; margin-left: 6px; opacity: 0.85; font-size: 0.92em; font-weight: 500; }
.rgygy-tooltip { position: relative; flex: 0 0 auto; border: 1px solid rgba(54,85,246,.35); background: #FFFFFF; color: #3655F6; width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; line-height: 1; cursor: pointer; }
.rgygy-tooltip__content { position: absolute; right: 0; top: 30px; width: min(320px, 78vw); background: #FFFFFF; color: #202224; border: 1px solid rgba(0,0,0,.14); border-radius: 12px; padding: 10px 12px; box-shadow: 0 10px 28px rgba(0,0,0,.12); display: none; text-align: left; z-index: 99999; }
.rgygy-tooltip:hover .rgygy-tooltip__content, .rgygy-tooltip:focus .rgygy-tooltip__content, .rgygy-tooltip[data-open="1"] .rgygy-tooltip__content { display: block; }
@media (max-width: 520px) { .rgygy-checkout-upsells__row { align-items: flex-start; } }
.rgygy-muted { opacity: 0.85; font-size: 0.92em; }

/* ---------- Tables (shared) ---------- */
.rgygy-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; background: #fff; }
.rgygy-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rgygy-table th { background: rgba(0,0,0,.03); text-align: left; padding: 12px; font-weight: 700; border-bottom: 1px solid rgba(0,0,0,.08); }
.rgygy-table td { padding: 12px; border-bottom: 1px solid rgba(0,0,0,.08); vertical-align: top; }
.rgygy-table tr.odd td { background: #fff; }
.rgygy-table tr.even td { background: rgba(0,0,0,.015); }
.rgygy-results-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.rgygy-results-table th, .rgygy-results-table td { text-align: left; padding: 12px; border-bottom: 1px solid rgba(0,0,0,.08); vertical-align: top; }
.rgygy-results-table thead th { font-weight: 600; background: rgba(0,0,0,.02); }
.rgygy-results-table tbody tr:nth-child(even) { background: rgba(0,0,0,.015); }
.rgygy-domain { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.rgygy-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.85em; font-weight: 600; line-height: 1.2; }
.rgygy-badge--ok { background: rgba(34, 197, 94, 0.12); }
.rgygy-badge--no { background: rgba(239, 68, 68, 0.12); }
.rgygy-badge--progress { background: rgba(54, 85, 246, 0.12); }
.rgygy-badge--grace { background: rgba(234, 179, 8, 0.18); color: #7a5800; }
.rgygy-badge--redemption { background: rgba(217, 119, 6, 0.18); color: #8a4b00; }
.rgygy-actions { white-space: normal; min-width: 180px; max-width: 260px; }
.rgygy-actions .rgygy-form { margin: 0 0 6px 0; }
.rgygy-action-btn { margin-top: 10px; }
.rgygy-price { white-space: nowrap; }
@media (max-width: 520px) { .rgygy-control, .rgygy-control--years { min-width: 100%; } }

/* ---------- My Domains layout ---------- */
.rgygy-my-domains { margin: 10px 0; }
.rgygy-my-domains-table-wrap { display: none !important; }
.rgygy-ns-list { margin: 0; padding-left: 18px; }
.rgygy-form { margin: 0 0 10px 0; }

/* Full-width variant used by the [rgy_gy_my_domains] shortcode. Gives the panel
   real breathing room on a normal-width page (vs. the cramped WooCommerce account
   column). The wrapper widens to a comfortable max-width and centres itself. */
.rgygy-my-domains--full { max-width: 1200px; margin: 0 auto; padding: 8px 0 32px 0; }
.rgygy-my-domains--full .rgygy-my-domains__title { font-size: 1.8em; font-weight: 700; margin: 0 0 6px 0; }
.rgygy-my-domains--full .rgygy-domain-panel__info { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .rgygy-my-domains--full .rgygy-domain-panel__info { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .rgygy-my-domains--full .rgygy-domain-panel__info { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .rgygy-my-domains--full .rgygy-domain-panel__info { grid-template-columns: 1fr; }
}

/* Search + status filter bar
   These controls use !important on size/layout properties because page-builder
   and Woo storefront themes love to set `height`, `min-height`, `padding`, or
   `display: block` on form elements globally, which caused the mobile search
   field to balloon to ~300px. The !important wins them back. */
.rgygy-my-domains__filters {
  margin: 14px 0 22px 0; padding: 12px 14px; background: #fff;
  border: 1px solid rgba(0,0,0,.08); border-radius: 14px;
  box-sizing: border-box;
}
.rgygy-my-domains__filters-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.rgygy-my-domains__filters input.rgygy-my-domains__search,
.rgygy-my-domains__filters select.rgygy-my-domains__select,
.rgygy-my-domains__filters .rgygy-btn {
  box-sizing: border-box !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  vertical-align: middle;
}
.rgygy-my-domains__filters input.rgygy-my-domains__search {
  flex: 1 1 240px; min-width: 0; width: auto;
  padding: 8px 14px !important;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  background: #fff;
  font-family: inherit; font-size: 0.95em; color: #202020;
  appearance: none; -webkit-appearance: none;
}
.rgygy-my-domains__filters input.rgygy-my-domains__search:focus-visible {
  outline: 2px solid #3655F6; outline-offset: 1px; border-color: #3655F6;
}
.rgygy-my-domains__filters select.rgygy-my-domains__select {
  flex: 0 0 auto; width: auto;
  padding: 8px 36px 8px 14px !important;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E") right 12px center no-repeat;
  font-family: inherit; font-size: 0.95em; color: #202020; cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
}
.rgygy-my-domains__filters select.rgygy-my-domains__select:focus-visible {
  outline: 2px solid #3655F6; outline-offset: 1px;
}
.rgygy-my-domains__filters .rgygy-btn {
  padding: 0 18px !important;
}
.rgygy-my-domains__filter-btn {
  display: inline-flex !important; align-items: center !important;
  gap: 8px !important;
}
.rgygy-my-domains__filter-btn svg { display: inline-block; }
.rgygy-my-domains__no-results { margin: 18px 0; }

@media (max-width: 560px) {
  .rgygy-my-domains__filters { padding: 10px 12px; }
  .rgygy-my-domains__filters-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .rgygy-my-domains__filters input.rgygy-my-domains__search,
  .rgygy-my-domains__filters select.rgygy-my-domains__select,
  .rgygy-my-domains__filters .rgygy-btn {
    width: 100% !important;
    flex: 0 0 auto;
    text-align: center;
  }
  .rgygy-my-domains__filters input.rgygy-my-domains__search { text-align: left; }
}

/* ---------- Buttons ---------- */
.rgygy-btn {
  display: inline-block !important; padding: 12px 18px !important;
  border: 1px solid currentColor !important; border-radius: 999px !important;
  text-decoration: none !important; background: transparent !important;
  cursor: pointer !important; font-weight: 700 !important; line-height: 1.2 !important;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
  font-family: inherit; font-size: inherit; max-width: 100%;
}
.rgygy-btn:hover { transform: translateY(-1px); }
.rgygy-btn:focus-visible { outline: 2px solid #3655F6; outline-offset: 2px; }
.rgygy-btn-primary { background: #3655F6 !important; border-color: #3655F6 !important; color: #FFFFFF !important; }
.rgygy-btn-primary:hover { background: #1F3FD8 !important; border-color: #1F3FD8 !important; }
.rgygy-btn-secondary { background: #FFFFFF !important; color: #101010 !important; border-color: rgba(0,0,0,.2) !important; }
.rgygy-btn-secondary:hover { background: #F5F5FF !important; border-color: rgba(54,85,246,.4) !important; color: #1F3FD8 !important; }
.rgygy-btn[disabled], .rgygy-btn.is-disabled { opacity: .55; cursor: not-allowed; }

/* Hide the legacy mobile-cards layout at every viewport size.
   The renderer still echoes the old `.rgygy-domain-cards` block alongside the new
   `.rgygy-domain-panel` cards for backward compat, but the new panel layout is
   fully responsive (see media queries on .rgygy-domain-panel__info / __actions
   below) so we never want both to show. A previous @media rule re-enabled the
   legacy layout at <=780px, which caused every domain to appear twice on phones —
   that's the rule that has been removed. */
.rgygy-domain-cards { display: none !important; }
.rgygy-domain-card { display: none !important; }

/* ---------- Domain panel (card-per-domain layout) ---------- */
/* Comfortable gap so multiple domains don't run together. */
.rgygy-domains-list { display: flex; flex-direction: column; gap: 32px; }
/* Even more breathing room on the full-width shortcode page. */
.rgygy-my-domains--full .rgygy-domains-list { gap: 36px; }
/* Keep the gap meaningful on mobile — phones with stacked panels especially
   benefit from clear separation between cards. */
@media (max-width: 560px) {
  .rgygy-domains-list,
  .rgygy-my-domains--full .rgygy-domains-list { gap: 28px; }
}

.rgygy-domain-panel {
  border: 1px solid rgba(0,0,0,.1); border-radius: 16px; padding: 20px; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.rgygy-domain-panel__header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rgygy-domain-panel__name { font-size: 1.15em; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; word-break: break-all; }
.rgygy-domain-panel__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.rgygy-domain-panel__info { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 20px; padding: 14px 0; border-top: 1px solid rgba(0,0,0,.06); border-bottom: 1px solid rgba(0,0,0,.06); }
.rgygy-domain-panel__label { font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #888; margin-bottom: 4px; }
.rgygy-domain-panel__col code { font-size: 0.88em; }
.rgygy-domain-panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.rgygy-panel-action { margin: 0; }

.rgygy-panel-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px;
  border: 1px solid rgba(0,0,0,.15); border-radius: 10px; background: #fff; color: #303030;
  font-size: 0.88em; font-weight: 600; font-family: inherit; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background 100ms ease, border-color 100ms ease;
  line-height: 1.3; list-style: none;
}
.rgygy-panel-btn:hover { background: #F5F5FF; border-color: rgba(54,85,246,.4); color: #1F3FD8; }
.rgygy-panel-btn:focus-visible { outline: 2px solid #3655F6; outline-offset: 2px; }
.rgygy-panel-btn--warn { border-color: rgba(234,179,8,.5); color: #7a5800; }
.rgygy-panel-btn--warn:hover { background: rgba(234,179,8,.1); border-color: rgba(234,179,8,.7); }

@media (max-width: 900px) { .rgygy-domain-panel__info { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .rgygy-domain-panel { padding: 14px; }
  .rgygy-domain-panel__info { grid-template-columns: 1fr; }
  .rgygy-domain-panel__actions { flex-direction: column; align-items: stretch; }
  .rgygy-panel-btn { justify-content: center; width: 100%; }
}


/* ==========================================================================
   NS / DNSSEC MODAL — polished overlay sheets
   ========================================================================== */

.rgygy-ns-details { display: inline-block; margin: 0; max-width: 100%; vertical-align: top; }
.rgygy-ns-details > summary { list-style: none; cursor: pointer; }
.rgygy-ns-details > summary::-webkit-details-marker { display: none; }
.rgygy-ns-overlay { display: none; }

/* Backdrop */
.rgygy-ns-details[open] > .rgygy-ns-overlay {
  display: flex; position: fixed; inset: 0;
  background: rgba(10,15,30,.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  z-index: 99999; padding: 20px;
  animation: rgygy-fade 160ms ease-out;
}
@keyframes rgygy-fade { from { opacity: 0; } to { opacity: 1; } }

/* Panel */
.rgygy-ns-panel {
  background: #fff; border-radius: 20px;
  max-width: 560px; width: 100%;
  max-height: calc(100vh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0; border: none;
  box-shadow: 0 20px 60px rgba(8,15,40,.22), 0 0 0 1px rgba(0,0,0,.05);
  color: #202224; position: relative; box-sizing: border-box;
  animation: rgygy-pop 180ms cubic-bezier(.16,.85,.3,1.02);
}
@keyframes rgygy-pop {
  from { transform: translateY(12px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Header bar — subtle gradient */
.rgygy-ns-panel-head {
  padding: 22px 24px 14px 24px;
  background: linear-gradient(135deg, #F8F8FF 0%, #EEF0FF 100%);
  border-bottom: 1px solid rgba(54,85,246,.08);
  border-radius: 20px 20px 0 0;
}

.rgygy-ns-title {
  margin: 0 0 2px 0; font-size: 17px; font-weight: 800; color: #101020;
  padding-right: 40px; word-break: break-word; letter-spacing: -0.01em;
}
.rgygy-ns-subtitle {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px; color: #3655F6; word-break: break-all; font-weight: 600;
}

/* Body */
.rgygy-ns-panel-body { padding: 18px 24px 22px 24px; }

/* Fallback spacing when PHP doesn't use head/body wrappers */
.rgygy-ns-panel > .rgygy-ns-title { padding: 22px 24px 0 24px; }
.rgygy-ns-panel > .rgygy-muted,
.rgygy-ns-panel > .rgygy-ns-subtitle { padding: 0 24px; }
.rgygy-ns-panel > .rgygy-form,
.rgygy-ns-panel > .rgygy-form-inline,
.rgygy-ns-panel > hr,
.rgygy-ns-panel > .rgygy-table-wrap,
.rgygy-ns-panel > .rgygy-ds-empty,
.rgygy-ns-panel > .rgygy-notice,
.rgygy-ns-panel > .rgygy-ns-help { margin-left: 24px; margin-right: 24px; }

.rgygy-ns-help {
  margin: 10px 0 16px 0; line-height: 1.6; color: #5A5E6B; font-size: 0.9em; word-break: break-word;
}
.rgygy-ns-help code {
  background: rgba(54,85,246,.07); padding: 2px 7px; border-radius: 6px; font-size: 0.9em; color: #3655F6;
}
.rgygy-ns-divider { border: none; border-top: 1px solid #EDEFF1; margin: 20px 0; }
.rgygy-ns-panel .rgygy-muted { overflow-wrap: anywhere; word-break: break-word; }
.rgygy-ns-panel .rgygy-form + .rgygy-form,
.rgygy-ns-panel .rgygy-form-inline { margin-top: 12px; }
.rgygy-ns-notice { margin-top: 14px; }

/* Close button — light glass pill, top-right */
.rgygy-ns-details[open] > summary {
  position: fixed; top: 16px; right: 16px; z-index: 100001;
  width: 40px; height: 40px; padding: 0 !important;
  border-radius: 12px; overflow: hidden;
  color: transparent !important;
  background: rgba(255,255,255,.9) !important;
  border: 1px solid rgba(0,0,0,.1) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.rgygy-ns-details[open] > summary::before {
  content: "\00d7"; display: block; color: #303030;
  font-size: 24px; line-height: 40px; text-align: center; font-weight: 400;
}
.rgygy-ns-details[open] > summary:hover {
  background: #fff !important; box-shadow: 0 2px 12px rgba(0,0,0,.18);
}

/* Textarea inside modals — upgraded look */
.rgygy-ns-panel .rgygy-textarea {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid rgba(0,0,0,.12); border-radius: 14px;
  padding: 14px 16px; font-size: 0.93em;
  min-height: 120px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  background: #FAFAFE;
}
.rgygy-ns-panel .rgygy-textarea:focus {
  border-color: #3655F6; box-shadow: 0 0 0 3px rgba(54,85,246,.12);
  outline: none; background: #fff;
}
.rgygy-ns-panel .rgygy-textarea::placeholder { color: #aaa; }

/* Select inside modals */
.rgygy-ns-panel .rgygy-input {
  border: 1.5px solid rgba(0,0,0,.12); border-radius: 14px;
  padding: 12px 16px; background: #FAFAFE; font-size: 0.93em;
  transition: border-color 120ms ease;
}
.rgygy-ns-panel .rgygy-input:focus {
  border-color: #3655F6; box-shadow: 0 0 0 3px rgba(54,85,246,.12);
  outline: none; background: #fff;
}

/* Form label */
.rgygy-form-label {
  display: block; font-weight: 700; font-size: 0.88em;
  margin: 18px 0 8px 0; color: #303030;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Action buttons row */
.rgygy-form-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: stretch;
}
.rgygy-form-actions .rgygy-btn { flex: 1 1 auto; text-align: center; min-width: 0; }

/* DS record table */
.rgygy-ds-table-wrap {
  margin-top: 14px; border-radius: 14px;
  border: 1px solid rgba(0,0,0,.06); max-height: 260px;
  overflow: auto; -webkit-overflow-scrolling: touch; background: #FAFAFE;
}
.rgygy-ds-table { min-width: 100%; font-size: 0.88em; }
.rgygy-ds-table th {
  background: rgba(54,85,246,.04); font-size: 0.78em;
  text-transform: uppercase; letter-spacing: 0.05em; color: #666; font-weight: 700;
}
.rgygy-ds-table th, .rgygy-ds-table td { padding: 10px 14px; }
.rgygy-ds-digest { word-break: break-all; font-size: 0.85em; max-width: 100%; display: inline-block; }
.rgygy-ds-empty {
  margin-top: 14px; padding: 16px 18px; border-radius: 14px;
  background: rgba(0,0,0,.025); color: #888; font-size: 0.9em; text-align: center;
  border: 1px dashed rgba(0,0,0,.1);
}

/* ---------- Modal responsive ---------- */
@media (max-width: 680px) {
  .rgygy-ns-details[open] > .rgygy-ns-overlay { padding: 0; align-items: flex-end; }
  .rgygy-ns-panel {
    border-radius: 20px 20px 0 0; max-height: calc(100vh - 48px); margin-top: auto;
    animation: rgygy-slide 200ms ease-out;
  }
  .rgygy-ns-panel-head { border-radius: 20px 20px 0 0; padding: 18px 20px 12px 20px; }
  .rgygy-ns-panel-body { padding: 16px 20px 20px 20px; }
  .rgygy-ns-panel > .rgygy-ns-title { padding-left: 20px; padding-right: 52px; }
  .rgygy-ns-panel > .rgygy-muted,
  .rgygy-ns-panel > .rgygy-ns-subtitle { padding-left: 20px; padding-right: 20px; }
  .rgygy-ns-panel > .rgygy-form,
  .rgygy-ns-panel > .rgygy-form-inline,
  .rgygy-ns-panel > hr,
  .rgygy-ns-panel > .rgygy-table-wrap,
  .rgygy-ns-panel > .rgygy-ds-empty,
  .rgygy-ns-panel > .rgygy-notice,
  .rgygy-ns-panel > .rgygy-ns-help { margin-left: 20px; margin-right: 20px; }
  @keyframes rgygy-slide {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .rgygy-form-actions { flex-direction: column; }
  .rgygy-ns-details[open] > summary { top: 10px; right: 10px; width: 36px; height: 36px; }
  .rgygy-ns-details[open] > summary::before { line-height: 36px; font-size: 22px; }

  /* DS table → stacked cards on mobile */
  .rgygy-ds-table thead { display: none; }
  .rgygy-ds-table, .rgygy-ds-table tbody, .rgygy-ds-table tr, .rgygy-ds-table td { display: block; width: 100%; }
  .rgygy-ds-table tr { border-bottom: 1px solid rgba(0,0,0,.06); padding: 10px 14px; }
  .rgygy-ds-table tr:last-child { border-bottom: none; }
  .rgygy-ds-table td { border: none; padding: 3px 0; }
  .rgygy-ds-table td[data-label]::before {
    content: attr(data-label) ": "; font-weight: 700; color: #888;
    font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.03em;
  }
  .rgygy-ds-table .rgygy-ds-digest {
    display: block; padding: 8px 10px; background: rgba(0,0,0,.025);
    border-radius: 8px; margin-top: 4px; font-size: 0.83em;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .rgygy-btn, .rgygy-ns-details[open] > .rgygy-ns-overlay, .rgygy-ns-panel {
    animation: none !important; transition: none !important;
  }
}

/* ---------- Notices for My Domains ---------- */
.rgygy-notice{padding:12px 14px;border-radius:12px;margin:10px 0;border:1px solid rgba(0,0,0,0.08);line-height:1.6;overflow-wrap:anywhere;word-break:normal}
.rgygy-notice-success{background:#F5F5FF;color:#202224;border-color:rgba(54,85,246,0.35)}
.rgygy-notice-error{background:#fff2f2;color:#202224;border-color:rgba(228,27,56,0.35)}
.rgygy-notice-neutral{background:#ffffff;color:#202224;border-color:rgba(0,0,0,0.12)}
.rgygy-notice a.rgygy-whois-inline-link{display:inline;white-space:nowrap}
.woocommerce-notices-wrapper a.rgygy-whois-inline-link,
.woocommerce-message a.rgygy-whois-inline-link{display:inline!important;white-space:nowrap!important}

/* Structured WooCommerce notice layout — keeps domain update messages clean and readable
   regardless of how the theme renders .woocommerce-message / .woocommerce-error / .woocommerce-info */
.rgygy-wc-notice {
  display: block;
  margin: 0 0 2px 0;
  line-height: 1.4;
  word-break: break-word;
}
.rgygy-wc-notice strong {
  font-weight: 700;
}
.rgygy-wc-notice-detail {
  display: block;
  margin: 4px 0 0 0;
  font-size: 0.9em;
  color: #555;
  line-height: 1.5;
  word-break: break-word;
}
.rgygy-wc-notice-detail a {
  color: #3655F6;
  text-decoration: underline;
  font-weight: 600;
}
.rgygy-wc-notice-detail a:hover {
  color: #1F3FD8;
}
/* Ensure the WooCommerce notice container itself doesn't force weird inline layouts */
.woocommerce-message .rgygy-wc-notice,
.woocommerce-error .rgygy-wc-notice,
.woocommerce-info .rgygy-wc-notice,
.woocommerce-message .rgygy-wc-notice-detail,
.woocommerce-error .rgygy-wc-notice-detail,
.woocommerce-info .rgygy-wc-notice-detail {
  display: block !important;
  float: none !important;
  clear: both !important;
}

/* ==========================================================================
   Transfer-in form ([rgy_gy_transfer_search])
   ========================================================================== */
.rgygy-transfer-search {
  background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 14px;
  padding: 22px 26px;
  /* Full width inside the page's content column (no narrow cap). */
  max-width: none; width: 100%; box-sizing: border-box;
  margin: 0;
}
.rgygy-transfer-form .rgygy-label {
  display: block; font-weight: 700; font-size: 1.05em; margin-bottom: 4px;
}
.rgygy-transfer-form .rgygy-help {
  margin: 0 0 16px 0; font-size: 0.92em;
}
.rgygy-transfer-form__row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end;
}
.rgygy-transfer-form__field { display: flex; flex-direction: column; min-width: 0; }
.rgygy-transfer-form__field .rgygy-label-small {
  font-size: 0.8em; color: #555; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.rgygy-transfer-form__field input {
  box-sizing: border-box; height: 44px; padding: 8px 14px;
  border: 1px solid rgba(0,0,0,.15); border-radius: 10px; background: #fff;
  font-family: inherit; font-size: 0.95em; color: #202020; width: 100%;
}
.rgygy-transfer-form__field input:focus-visible {
  outline: 2px solid #3655F6; outline-offset: 1px; border-color: #3655F6;
}
.rgygy-transfer-form__submit .rgygy-btn {
  height: 44px; padding: 0 22px !important; box-sizing: border-box;
}
@media (max-width: 640px) {
  .rgygy-transfer-form__row { grid-template-columns: 1fr; }
  .rgygy-transfer-form__submit .rgygy-btn { width: 100%; }
}

/* ==========================================================================
   V2 DASHBOARD LAYOUT
   ==========================================================================
   This block powers the redesigned My Domains dashboard (header + cards with
   tabs + upsells). Everything is scoped under .rgygy-my-domains so it doesn't
   bleed into other plugin surfaces.
   ========================================================================== */

/* Page header — title + subtitle on the left, Add Domain CTA on the right */
.rgygy-my-domains .rgygy-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 0 0 18px 0;
}
.rgygy-my-domains .rgygy-page-header__text { flex: 1 1 320px; min-width: 0; }
.rgygy-my-domains .rgygy-page-header__title {
  margin: 0 0 6px 0;
  font-size: clamp(1.8em, 3.5vw, 2.5em); font-weight: 800; line-height: 1.15;
  color: #0F1729;
}
.rgygy-my-domains .rgygy-page-header__subtitle {
  margin: 0; color: #5A5E6B; font-size: 1em; line-height: 1.45; max-width: 56ch;
}
.rgygy-my-domains .rgygy-page-header__actions { flex: 0 0 auto; }
.rgygy-my-domains .rgygy-page-header__cta {
  padding: 12px 18px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
}
@media (max-width: 560px) {
  .rgygy-my-domains .rgygy-page-header { gap: 12px; }
  .rgygy-my-domains .rgygy-page-header__cta { width: 100%; text-align: center; }
}

/* List of cards. Generous gap so cards visually separate, no joining lines. */
.rgygy-cards-list { display: flex; flex-direction: column; gap: 28px; }

/* ---------- The card itself ---------- */
.rgygy-card-v2 {
  background: #fff; border: 1px solid rgba(15, 23, 41, .08); border-radius: 18px;
  padding: 22px 24px; box-shadow: 0 1px 2px rgba(15, 23, 41, .03);
}
@media (max-width: 560px) {
  .rgygy-card-v2 { padding: 16px; border-radius: 14px; }
}

/* Card header: globe icon + domain name + status pill */
.rgygy-card-v2__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid rgba(15, 23, 41, .07);
}
.rgygy-card-v2__header-left {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.rgygy-card-v2__icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #EEF1FF, #DCE5FF);
  display: flex; align-items: center; justify-content: center;
  color: #3655F6;
}
.rgygy-card-v2__icon svg { width: 22px; height: 22px; }
.rgygy-card-v2__name {
  margin: 0; font-size: 1.3em; font-weight: 800; color: #0F1729;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}
.rgygy-card-v2__header-right { flex: 0 0 auto; }

/* Status pill (Active / Expired / In progress) */
.rgygy-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.85em; font-weight: 700; letter-spacing: 0.01em;
}
.rgygy-pill__dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.rgygy-pill--ok   { background: #DCFCE7; color: #15803D; }
.rgygy-pill--warn { background: #FEF3C7; color: #92400E; }
.rgygy-pill--err  { background: #FEE2E2; color: #B91C1C; }

/* Info row — 4 columns of icon + label + value */
.rgygy-card-v2__info {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; padding: 4px 0 20px 0;
  border-bottom: 1px solid rgba(15, 23, 41, .07);
}
.rgygy-info-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rgygy-info-item__icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  background: #F4F5FA; color: #5b6178;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05em;
}
.rgygy-info-item__body { min-width: 0; }
.rgygy-info-item__label { font-size: 0.78em; color: #6F7488; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; font-weight: 600; }
.rgygy-info-item__value { font-weight: 600; color: #0F1729; font-size: 0.98em; word-break: break-word; }
@media (max-width: 1100px) {
  .rgygy-card-v2__info { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .rgygy-card-v2__info { grid-template-columns: 1fr; gap: 12px; }
}

/* Nameservers row — label on the left, chips wrapping, Edit link on the right */
.rgygy-card-v2__ns-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 0 18px 0; border-bottom: 1px solid rgba(15, 23, 41, .07);
}
.rgygy-card-v2__ns-label {
  flex: 0 0 auto; font-weight: 700; color: #0F1729;
}
.rgygy-card-v2__ns-chips {
  flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0;
}
.rgygy-ns-chip {
  display: inline-flex; align-items: center; padding: 6px 14px;
  background: #F4F5FA; border: 1px solid rgba(15, 23, 41, .08);
  border-radius: 999px; font-size: 0.88em; color: #2a2f3d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.rgygy-card-v2__ns-edit {
  flex: 0 0 auto; background: none; border: 0; padding: 6px 4px;
  color: #3655F6; font-weight: 700; cursor: pointer; font-size: 0.95em;
  display: inline-flex; align-items: center; gap: 5px;
}
.rgygy-card-v2__ns-edit:hover { color: #1F3FD8; text-decoration: underline; }

/* Upsells (Website Hosting + Email Hosting) */
.rgygy-card-v2__upsells { margin: 20px 0; }
.rgygy-card-v2__upsells-title {
  margin: 0 0 12px 0; font-size: 1.05em; font-weight: 800; color: #0F1729;
}
.rgygy-upsell-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (max-width: 720px) { .rgygy-upsell-grid { grid-template-columns: 1fr; } }
.rgygy-upsell-card {
  display: flex; gap: 14px; padding: 16px;
  background: #fff; border: 1px solid rgba(15, 23, 41, .1);
  border-radius: 14px;
  transition: border-color 120ms ease, transform 120ms ease;
}
.rgygy-upsell-card:hover { border-color: #3655F6; transform: translateY(-1px); }
.rgygy-upsell-card__icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #EEF1FF, #DCE5FF);
  display: flex; align-items: center; justify-content: center; font-size: 1.3em;
  color: #3655F6;
}
.rgygy-upsell-card--email .rgygy-upsell-card__icon {
  background: linear-gradient(135deg, #FFF3DB, #FFE4BC); color: #A35A00;
}
.rgygy-upsell-card__body { flex: 1 1 auto; min-width: 0; }
.rgygy-upsell-card__title { font-weight: 800; color: #0F1729; margin-bottom: 4px; }
.rgygy-upsell-card__desc  { color: #5A5E6B; font-size: 0.9em; line-height: 1.45; }
.rgygy-upsell-card__price { font-weight: 700; color: #3655F6; margin-top: 8px; font-size: 0.92em; }
.rgygy-upsell-card__cta {
  margin-top: 10px; padding: 8px 14px !important; font-size: 0.9em !important;
  border-radius: 10px !important; display: inline-block;
}

/* Primary actions row (Manage / Use managed DNS / Renew) */
.rgygy-card-v2__primary-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px 0;
}
.rgygy-card-v2__primary-actions .rgygy-btn {
  padding: 12px 20px !important; border-radius: 12px !important;
  display: inline-flex; align-items: center; gap: 8px;
}
@media (max-width: 560px) {
  .rgygy-card-v2__primary-actions { flex-direction: column; }
  .rgygy-card-v2__primary-actions .rgygy-btn { width: 100%; justify-content: center; }
}
.rgygy-btn--warn-text { color: #B45A07 !important; }

/* Quick chip row (Sync / History / NS / DNSSEC / Privacy / Security) */
.rgygy-card-v2__chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 18px;
  margin-bottom: 18px; border-bottom: 1px solid rgba(15, 23, 41, .07);
}
.rgygy-chip-form { display: inline-block; margin: 0; }
.rgygy-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: #fff;
  border: 1px solid rgba(15, 23, 41, .1); border-radius: 999px;
  color: #2a2f3d; font-weight: 600; font-size: 0.88em; cursor: pointer;
  font-family: inherit; line-height: 1.2;
}
.rgygy-chip:hover { border-color: #3655F6; color: #3655F6; }
.rgygy-chip:focus-visible { outline: 2px solid #3655F6; outline-offset: 2px; }

/* Tab bar */
.rgygy-card-v2__tabs {
  display: flex; gap: 4px; overflow-x: auto; flex-wrap: nowrap;
  border-bottom: 1px solid rgba(15, 23, 41, .07);
  margin-bottom: 18px;
  /* Hide scrollbar on mobile, still allow scroll */
  scrollbar-width: thin;
}
.rgygy-tab-btn {
  background: none; border: 0; padding: 12px 16px;
  color: #5A5E6B; font-weight: 600; font-size: 0.95em; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.rgygy-tab-btn:hover { color: #0F1729; }
.rgygy-tab-btn.is-active { color: #3655F6; border-bottom-color: #3655F6; }
.rgygy-tab-btn:focus-visible { outline: 2px solid #3655F6; outline-offset: -2px; border-radius: 2px; }
.rgygy-tab-btn__emoji { font-size: 1.05em; line-height: 1; }
@media (max-width: 560px) {
  .rgygy-tab-btn { padding: 10px 12px; font-size: 0.9em; }
}

/* Tab panels — only the active one renders */
.rgygy-card-v2__panels { position: relative; }
.rgygy-tab-panel { display: none; }
.rgygy-tab-panel.is-active { display: block; }
.rgygy-tab-section { padding: 4px 0; }
.rgygy-tab-section h4 { margin: 0 0 6px 0; font-size: 1.02em; font-weight: 700; color: #0F1729; }
.rgygy-tab-section p { margin: 0 0 12px 0; }
.rgygy-empty-tab { padding: 14px 16px; background: #F4F5FA; border-radius: 12px; }
.rgygy-empty-tab h4 { margin: 0 0 6px 0; font-weight: 700; color: #0F1729; }
.rgygy-empty-tab p { margin: 0; color: #5A5E6B; }
.rgygy-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 14px 16px;
  background: #F4F5FA; border-radius: 12px;
}

/* Overview tab: 4 status pills + "Everything in one place" callout */
.rgygy-overview {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px;
}
@media (max-width: 720px) { .rgygy-overview { grid-template-columns: 1fr; } }
.rgygy-overview__heading-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin: 0 0 10px 0;
}
.rgygy-overview__heading { margin: 0; font-weight: 700; font-size: 1.02em; color: #0F1729; }
.rgygy-overview__sync-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid rgba(15, 23, 41, .12); border-radius: 999px;
  padding: 7px 14px; font-weight: 600; font-size: 0.88em;
  color: #2a2f3d; cursor: pointer; font-family: inherit;
  transition: border-color 120ms ease, color 120ms ease;
}
.rgygy-overview__sync-btn:hover { border-color: #3655F6; color: #3655F6; }
.rgygy-overview__sync-btn:focus-visible { outline: 2px solid #3655F6; outline-offset: 2px; }
.rgygy-overview__pills {
  padding: 16px 18px; background: #F8F9FE; border-radius: 14px;
}
.rgygy-overview__pill-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (max-width: 520px) { .rgygy-overview__pill-grid { grid-template-columns: 1fr; } }
.rgygy-overview-pill {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: #fff; border-radius: 12px;
  border: 1px solid rgba(15, 23, 41, .06);
}
.rgygy-overview-pill__icon {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  background: #ECF6FF; color: #1E40AF;
  display: flex; align-items: center; justify-content: center; font-size: 0.95em;
}
.rgygy-overview-pill--ok   .rgygy-overview-pill__icon { background: #DCFCE7; color: #15803D; }
.rgygy-overview-pill--warn .rgygy-overview-pill__icon { background: #FEF3C7; color: #92400E; }
.rgygy-overview-pill--err  .rgygy-overview-pill__icon { background: #FEE2E2; color: #B91C1C; }
.rgygy-overview-pill__label { font-size: 0.78em; color: #6F7488; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.rgygy-overview-pill__value { font-weight: 700; color: #0F1729; }

.rgygy-overview__callout {
  display: flex; gap: 10px; padding: 16px 18px;
  background: linear-gradient(135deg, #EEF1FF 0%, #F2F7FF 100%);
  border: 1px solid rgba(54, 85, 246, .15); border-radius: 14px;
}
.rgygy-overview__callout-icon {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; color: #3655F6;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.rgygy-overview__callout-title { font-weight: 700; color: #1E3A8A; margin-bottom: 4px; }
.rgygy-overview__callout-body  { color: #2a2f3d; font-size: 0.92em; line-height: 1.5; }

/* Services tab — owned services list (top) + upsells (bottom) */
.rgygy-services__heading {
  margin: 0 0 12px 0; font-weight: 700; font-size: 1.05em; color: #0F1729;
}
.rgygy-services__owned { margin-bottom: 24px; }
.rgygy-service-group { margin-bottom: 18px; }
.rgygy-service-group:last-child { margin-bottom: 0; }
.rgygy-service-group__title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; font-weight: 700; color: #0F1729; font-size: 0.98em;
}
.rgygy-service-group__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: #EEF1FF; color: #3655F6;
  border-radius: 999px; font-size: 0.75em; font-weight: 700;
}
.rgygy-service-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rgygy-service-list__item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: #fff;
  border: 1px solid rgba(15, 23, 41, .08); border-radius: 12px;
}
.rgygy-service-list__name { flex: 1 1 200px; font-weight: 700; color: #0F1729; min-width: 0; word-break: break-word; }
.rgygy-service-list__meta { color: #6F7488; font-size: 0.85em; }
.rgygy-service-list__cta {
  padding: 7px 14px !important; font-size: 0.88em !important;
  border-radius: 10px !important;
  display: inline-flex; align-items: center; gap: 5px;
}
@media (max-width: 480px) {
  .rgygy-service-list__cta { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Modal popup
   ==========================================================================
   Used by the Edit nameservers button on each card. Hidden by default,
   centred via flex on the body when activated.
   ========================================================================== */
.rgygy-modal {
  display: none;
  position: fixed; inset: 0; z-index: 999999;
  align-items: center; justify-content: center;
  padding: 20px;
}
.rgygy-modal.is-open { display: flex; }
.rgygy-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 41, .55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.rgygy-modal__dialog {
  position: relative; background: #fff; border-radius: 18px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 41, .25);
  animation: rgygy-modal-pop 140ms ease;
}
@keyframes rgygy-modal-pop {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.rgygy-modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(15, 23, 41, .06);
  font-size: 1.6em; line-height: 1;
  cursor: pointer; color: #2a2f3d;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.rgygy-modal__close:hover { background: rgba(15, 23, 41, .12); }
.rgygy-modal__close:focus-visible { outline: 2px solid #3655F6; outline-offset: 2px; }
.rgygy-modal__header {
  padding: 22px 60px 14px 22px;
  border-bottom: 1px solid rgba(15, 23, 41, .07);
}
.rgygy-modal__title { margin: 0; font-size: 1.25em; font-weight: 800; color: #0F1729; }
.rgygy-modal__subtitle { margin: 4px 0 0 0; color: #6F7488; font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.rgygy-modal__body {
  padding: 18px 22px 22px 22px;
  overflow-y: auto; flex: 1 1 auto;
}
.rgygy-modal__body .rgygy-textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid rgba(15, 23, 41, .15); border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95em;
}
.rgygy-modal__body .rgygy-textarea:focus-visible {
  outline: 2px solid #3655F6; outline-offset: 1px; border-color: #3655F6;
}

/* When a modal is open we lock body scroll so background doesn't move under it */
body.rgygy-modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .rgygy-modal { padding: 0; align-items: flex-end; }
  .rgygy-modal__dialog {
    max-width: none; width: 100%; max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }
  @keyframes rgygy-modal-pop {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
}

/* ==========================================================================
   Cloudflare DNS section in each domain panel
   ========================================================================== */
.rgygy-cf-section {
  margin: 14px 0 0 0; padding: 14px 16px;
  background: #F8F9FF; border: 1px solid rgba(54, 85, 246, .15); border-radius: 12px;
}
.rgygy-cf-section__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.rgygy-cf-section__head .rgygy-domain-panel__label { margin: 0; }
.rgygy-cf-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 0.78em; font-weight: 700; letter-spacing: 0.02em;
}
.rgygy-cf-badge--on  { background: #FDEDD3; color: #B45A07; }
.rgygy-cf-badge--off { background: #ECEEF4; color: #555; }
.rgygy-cf-section__pitch { margin: 6px 0 8px 0; font-size: 0.95em; }
.rgygy-cf-section__benefits {
  margin: 0 0 14px 18px; padding: 0;
  font-size: 0.88em; color: #303030; line-height: 1.55;
}
.rgygy-cf-section__benefits li { margin: 4px 0; }
.rgygy-cf-section__cta { margin: 0; }
.rgygy-cf-section__on {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.rgygy-cf-section__off { margin-left: auto; }
.rgygy-cf-section__fwd-summary {
  flex-basis: 100%; margin-top: 4px; font-size: 0.85em;
}
.rgygy-cf-section__fwd-summary code { word-break: break-all; }
.rgygy-btn-link {
  background: none !important; border: 0 !important; padding: 4px 0 !important;
  color: #B45A07; cursor: pointer; text-decoration: underline; font-weight: 600 !important;
  font-family: inherit; font-size: 0.88em;
}
.rgygy-btn-link:hover { color: #7A3E04; }

/* Wider modal for the DNS records table — the default ns-panel width is tight. */
.rgygy-ns-panel.rgygy-ns-panel--wide { max-width: 920px; }

/* DNS records table */
.rgygy-cf-dns-table th, .rgygy-cf-dns-table td { vertical-align: middle; padding: 8px 10px; }
.rgygy-cf-dns-table .rgygy-input { padding: 6px 8px !important; font-size: 0.9em; min-width: 0; width: 100%; box-sizing: border-box; }
.rgygy-cf-dns-priority { margin-top: 4px; }
.rgygy-cf-dns-actions { white-space: nowrap; }
.rgygy-cf-dns-row { display: contents; }

/* Add-record form below the table */
.rgygy-cf-dns-add { margin-top: 8px; }
.rgygy-cf-dns-add__grid {
  display: grid;
  grid-template-columns: 100px 1fr 1.5fr 130px 90px auto;
  gap: 10px; align-items: end;
}
.rgygy-cf-dns-add__grid .rgygy-label-small {
  display: block; font-size: 0.78em; color: #555; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.rgygy-cf-dns-add__grid .rgygy-input,
.rgygy-cf-dns-add__grid select.rgygy-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px !important; font-size: 0.92em;
}
.rgygy-cf-dns-add__grid .rgygy-btn { width: 100%; height: 38px; padding: 0 12px !important; }

/* Proxied toggle (just a basic styled checkbox; orange when on) */
.rgygy-toggle { display: inline-flex; align-items: center; cursor: pointer; }
.rgygy-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.rgygy-toggle span {
  display: inline-block; width: 36px; height: 20px; border-radius: 999px;
  background: #d0d3da; position: relative; transition: background 120ms ease;
}
.rgygy-toggle span::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform 120ms ease;
}
.rgygy-toggle input:checked + span { background: #F38020; } /* Cloudflare orange */
.rgygy-toggle input:checked + span::after { transform: translateX(16px); }
.rgygy-toggle input:focus-visible + span { outline: 2px solid #3655F6; outline-offset: 2px; }

@media (max-width: 720px) {
  .rgygy-cf-dns-add__grid { grid-template-columns: 1fr 1fr; }
  .rgygy-cf-dns-table thead { display: none; }
  .rgygy-cf-dns-table tr {
    display: block; padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,.08);
  }
  .rgygy-cf-dns-table td {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 4px 0; border: 0;
  }
  .rgygy-cf-dns-table td::before {
    content: attr(data-label); font-weight: 600; color: #555; font-size: 0.85em;
    flex: 0 0 80px; align-self: center;
  }
}

/* ==========================================================================
   Public service status page ([rgy_gy_status])
   ========================================================================== */
.rgygy-status { max-width: 760px; margin: 0 auto; }
.rgygy-status__overall {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 26px; border-radius: 16px; margin-bottom: 18px;
  background: #fff; border: 1px solid rgba(0,0,0,.08);
}
.rgygy-status__overall-icon { font-size: 2em; line-height: 1; flex: 0 0 auto; }
.rgygy-status__overall-title { font-size: 1.4em; font-weight: 700; margin-bottom: 2px; }
.rgygy-status__overall-sub { color: #4f4f4f; font-size: 0.95em; }
.rgygy-status--ok   .rgygy-status__overall-icon { color: #16a34a; }
.rgygy-status--warn .rgygy-status__overall-icon { color: #d97706; }
.rgygy-status--err  .rgygy-status__overall-icon { color: #dc2626; }
.rgygy-status__overall.rgygy-status--ok   { border-left: 4px solid #16a34a; }
.rgygy-status__overall.rgygy-status--warn { border-left: 4px solid #d97706; }
.rgygy-status__overall.rgygy-status--err  { border-left: 4px solid #dc2626; }

.rgygy-status__components { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rgygy-status__component {
  padding: 14px 18px; background: #fff; border-radius: 12px; border: 1px solid rgba(0,0,0,.08);
}
.rgygy-status__component.rgygy-status--ok   { border-left: 3px solid #16a34a; }
.rgygy-status__component.rgygy-status--warn { border-left: 3px solid #d97706; }
.rgygy-status__component.rgygy-status--err  { border-left: 3px solid #dc2626; }
.rgygy-status__component-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.rgygy-status__component-label { font-weight: 700; font-size: 1.02em; }
.rgygy-status__component-badge {
  font-size: 0.85em; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.rgygy-status--ok   .rgygy-status__component-badge { background: #dcfce7; color: #166534; }
.rgygy-status--warn .rgygy-status__component-badge { background: #fef3c7; color: #92400e; }
.rgygy-status--err  .rgygy-status__component-badge { background: #fee2e2; color: #991b1b; }
.rgygy-status__component-note { margin-top: 6px; color: #555; font-size: 0.9em; }
.rgygy-status__healing {
  margin-top: 14px; padding: 12px 14px;
  background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 10px;
  color: #1E3A8A; font-size: 0.92em; line-height: 1.5;
}
.rgygy-status__footer { margin-top: 14px; color: #777; font-size: 0.82em; text-align: center; }

/* ==========================================================================
   Domain History modal — per-domain activity log
   ========================================================================== */
.rgygy-history-list {
  list-style: none; margin: 0; padding: 0;
}
.rgygy-history-item {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.06);
}
.rgygy-history-item:last-child { border-bottom: 0; }
.rgygy-history-item__when {
  flex: 0 0 180px; font-size: 0.82em; color: #6a6a6a;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.rgygy-history-item__what {
  flex: 1 1 280px; min-width: 0; font-size: 0.95em; color: #202020; word-break: break-word;
}
@media (max-width: 560px) {
  .rgygy-history-item { flex-direction: column; gap: 2px; padding: 10px 0; }
  .rgygy-history-item__when { flex: 0 0 auto; }
}

/* ==========================================================================
   Auth code one-time reveal panel
   ========================================================================== */
.rgygy-authcode-panel {
  margin: 0 0 16px 0; padding: 14px 16px;
  background: linear-gradient(180deg, #FFFCEB 0%, #FFF8DC 100%);
  border: 1px solid #F2D26B; border-radius: 12px;
}
.rgygy-authcode-panel__head { font-size: 1em; margin-bottom: 4px; color: #5a4500; }
.rgygy-authcode-panel__hint { margin: 0 0 12px 0; font-size: 0.9em; color: #5a4500; }
.rgygy-authcode-panel__value-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.rgygy-authcode-panel__code {
  flex: 1 1 280px; min-width: 0; padding: 10px 14px;
  background: #fff; border: 1px solid rgba(0,0,0,.2); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1em; color: #202020;
  user-select: all; word-break: break-all;
}
.rgygy-authcode-panel .rgygy-btn { padding: 8px 16px !important; }
.rgygy-authcode-panel .rgygy-authcode-copy.is-copied { background: #2e7d32 !important; color: #fff !important; border-color: #2e7d32 !important; }
@media (max-width: 480px) {
  .rgygy-authcode-panel__value-row { flex-direction: column; align-items: stretch; }
  .rgygy-authcode-panel__code { font-size: 0.92em; }
  .rgygy-authcode-panel .rgygy-btn { width: 100%; }
}
