/* WithdrawGuard admin UI — served as /wg-admin.css (linked in root.tsx) */

/* Embedded admin: use available Shopify admin width */
.wg-app-shell {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.wg-app-shell s-page {
  max-width: none;
  width: 100%;
}

.wg-app-shell .wg-hub-settings {
  width: 100%;
  max-width: none;
}
.wg-stack {
  display: grid;
  gap: 1rem;
  width: 100%;
}

.wg-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.04);
}

.wg-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.wg-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}

.wg-card-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
}

.wg-card-accent {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ccfbf1, #dbeafe);
  color: #0f766e;
  font-weight: 800;
  flex-shrink: 0;
}

.wg-row {
  display: grid;
  gap: 0.85rem;
}

.wg-checkbox-row {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #f8fafc;
}

.wg-checkbox-row label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-weight: 700;
  color: #0f172a;
}

.wg-checkbox-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.wg-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wg-setup-guide {
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.wg-setup-guide-title {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.wg-setup-steps {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.55;
}

.wg-setup-steps a {
  color: #2563eb;
  text-decoration: underline;
}

.wg-manage-panel {
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.85rem 1rem;
}

.wg-manage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.wg-manage-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.wg-manage-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.wg-manage-link-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wg-hub-settings {
  display: grid;
  gap: 1rem;
  width: 100%;
  padding: 1.15rem;
  border-radius: 16px;
  background: #f4f6f8;
  box-sizing: border-box;
}

.wg-design-split-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.wg-design-info-banner {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
  font-size: 0.88rem;
  line-height: 1.45;
}

.wg-design-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.wg-design-section-sub {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.45;
}

.wg-design-field-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 640px;
}

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

.wg-native-field {
  display: grid;
  gap: 0.35rem;
}

.wg-native-field-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.wg-native-field-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #c9ced6;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.wg-native-field-input:focus {
  outline: 2px solid #94a3b8;
  outline-offset: 1px;
}

.wg-logo-preview-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 56px;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.wg-logo-preview-image {
  display: block;
  max-width: 180px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.wg-embed-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wg-embed-card {
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background: #fff;
  display: grid;
  gap: 0.35rem;
}

.wg-embed-card-active {
  border-color: #0d9488;
  box-shadow: 0 0 0 1px #0d9488;
}

.wg-embed-card-idle {
  background: #f8fafc;
}

.wg-embed-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: #0f172a;
}

.wg-embed-sub {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.wg-embed-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #047857;
}

.wg-embed-badge-off {
  color: #94a3b8;
}

.wg-position-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wg-position-btn {
  appearance: none;
  position: relative;
  border: 2px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wg-position-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.wg-position-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.wg-position-btn-active,
.wg-position-btn:has(input:checked) {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.wg-color-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.wg-color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.wg-browser {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
}

.wg-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
}

.wg-browser-dots::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 12px 0 0 #94a3b8, 24px 0 0 #94a3b8;
}

.wg-browser-url {
  flex: 1;
  font-size: 0.72rem;
  color: #64748b;
  background: #fff;
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-browser-body {
  position: relative;
  min-height: 280px;
  padding: 0.75rem;
}

.wg-browser-line {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  margin-bottom: 0.35rem;
}

.wg-browser-line-short {
  width: 65%;
}

.wg-checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #0f172a;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.wg-hub-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.wg-hub-tab,
.wg-hub-tab-active {
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  line-height: 1.3;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.wg-hub-tab:visited,
.wg-hub-tab-active:visited,
.wg-hub-tab:hover,
.wg-hub-tab-active:hover,
.wg-hub-tab:focus,
.wg-hub-tab-active:focus {
  text-decoration: none;
}

.wg-hub-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.wg-hub-tab-active {
  background: #0f172a;
  color: #fff;
}

.wg-hub-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.wg-hub-layout-split {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.wg-hub-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.wg-hub-preview {
  position: sticky;
  top: 0.75rem;
}

.wg-hub-save-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.wg-preview-card {
  position: relative;
  z-index: 1;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.04);
}

.wg-preview-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wg-preview-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 3;
}

.wg-preview-tab,
.wg-preview-tab-active {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.wg-preview-tab-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.wg-preview-shell {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f1f5f9;
  overflow: hidden;
  min-height: 240px;
}

.wg-preview-shell-modal {
  min-height: 260px;
}

.wg-preview-shell-side {
  min-height: 260px;
}

.wg-preview-page-content {
  position: relative;
  z-index: 2;
  padding: 0.75rem;
}

.wg-preview-shell-modal .wg-preview-page-content {
  padding: 0;
}

.wg-preview-fake-nav {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.55rem;
  padding: 0.35rem 0.5rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.wg-preview-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.45);
}

.wg-preview-side-backdrop {
  display: flex;
  min-height: 260px;
  background: linear-gradient(90deg, #e2e8f0 58%, transparent 58%);
}

.wg-preview-side-panel {
  flex: 0 0 42%;
  margin-left: auto;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  padding: 0.65rem;
}

.wg-preview-form-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.wg-preview-shell-modal .wg-preview-form-card {
  position: relative;
  z-index: 1;
  margin: 2.5rem auto 0.75rem;
  width: min(92%, 280px);
}

.wg-preview-form-minimal {
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  box-shadow: none;
}

.wg-preview-form-soft {
  border-radius: 18px;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.wg-preview-form-bar {
  height: 3px;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}

.wg-preview-form-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
}

.wg-preview-form-title {
  margin: 0.25rem 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.wg-preview-fake-field {
  height: 28px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  margin-bottom: 0.45rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  color: #94a3b8;
  box-sizing: border-box;
}

.wg-preview-fake-button {
  margin-top: 0.35rem;
  text-align: center;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.wg-preview-fake-lines {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.wg-preview-fake-lines span {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  width: 100%;
}

.wg-preview-fake-line-short {
  width: 70%;
}

.wg-preview-float-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border: none;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  cursor: default;
}

.wg-preview-float-button-left {
  right: auto;
  left: 12px;
}

.wg-preview-footer-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  background: rgb(255 255 255 / 0.96);
}

.wg-preview-footer-link {
  font-size: 0.68rem;
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.wg-preview-footer-button {
  border: none;
  font-weight: 700;
  line-height: 1.2;
  cursor: default;
  white-space: nowrap;
}

.wg-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.wg-filter-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.wg-filter-tab:hover {
  background: #f8fafc;
}

.wg-filter-tab-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.wg-filter-tab-active:hover {
  background: #1f2937;
}

.wg-preview-form-logo {
  display: block;
  max-width: 120px;
  object-fit: contain;
}

.wg-preview-success-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.wg-preview-success-text {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

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

  .wg-hub-preview {
    position: static;
  }

  .wg-embed-grid {
    grid-template-columns: 1fr;
  }

  .wg-design-field-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

.wg-wrap {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.wg-hero {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 55%, #eef2ff 100%);
}

.wg-hero-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.wg-hero-sub {
  margin: 0.45rem 0 0;
  color: #475569;
  line-height: 1.5;
}

.wg-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.wg-step-chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

.wg-step-chip-active {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #0f766e;
}

.wg-step-chip-done {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}

.wg-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.04);
}

.wg-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.wg-card-sub {
  margin: 0 0 0.85rem;
  color: #64748b;
  line-height: 1.45;
  font-size: 0.9rem;
}

.wg-checklist {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0;
}

.wg-check-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.wg-check-row label {
  font-weight: 600;
  color: #0f172a;
}

.wg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.wg-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.wg-field input {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #c9ced6;
  font: inherit;
}

.wg-ghost-button {
  border: none;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}

.wg-ghost-button:hover {
  color: #0f766e;
}

.wg-success-box {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.9rem;
}

.wg-option-group-label {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.wg-option-card {
  appearance: none;
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  position: relative;
  color: inherit;
  font: inherit;
  text-align: left;
}

.wg-option-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.wg-option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.wg-option-card-active,
.wg-option-card:has(input:checked) {
  border-color: #0f172a;
  background: #fff;
  box-shadow: 0 0 0 1px #0f172a;
}

.wg-option-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.92rem;
}

.wg-option-sub {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.wg-split-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  align-items: start;
}

.wg-split-main {
  min-width: 0;
}

@media (max-width: 900px) {
  .wg-split-layout {
    grid-template-columns: 1fr;
  }
}

.wg-hint-box {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.86rem;
  line-height: 1.45;
}

.wg-hint-box a {
  color: #b45309;
  font-weight: 700;
}

/* Settings hub tabs — no underline on <a> nav links */
.wg-hub-tab-bar a,
.wg-hub-tab-bar a:hover,
.wg-hub-tab-bar a:focus,
.wg-hub-tab-bar a:visited,
.wg-hub-tab-bar a:active {
  text-decoration: none;
}

/* Mail template editor (global — loaded via /wg-admin.css) */
.wg-mail-wrap {
  display: grid;
  gap: 1rem;
  width: 100%;
}

.wg-mail-type-tabs,
.wg-mail-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wg-mail-lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.wg-mail-tab,
.wg-mail-tab-active,
.wg-mail-lang-tab,
.wg-mail-lang-tab-active,
.wg-mail-subject-var-chip,
.wg-mail-subject-var-toggle {
  appearance: none;
  font-family: inherit;
  line-height: 1.25;
}

.wg-mail-tab,
.wg-mail-tab-active,
.wg-mail-lang-tab,
.wg-mail-lang-tab-active {
  border: 1px solid #c9ced6;
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
}

.wg-mail-tab-active,
.wg-mail-lang-tab-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.wg-mail-editor-form {
  width: 100%;
}

.wg-mail-full-field {
  display: grid;
  gap: 0.45rem;
  width: 100%;
}

.wg-mail-subject-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.wg-mail-subject-var-chip {
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}

.wg-mail-subject-var-chip:hover {
  background: #ccfbf1;
}

.wg-mail-subject-var-toggle {
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.wg-mail-subject-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #c9ced6;
  font: inherit;
  font-size: 0.95rem;
}

.wg-mail-add-lang-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.wg-mail-add-lang-select {
  min-width: 180px;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #c9ced6;
  font: inherit;
}

/* Rich mail editor */
.wg-rich-mail-shell {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.wg-rich-mail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.wg-rich-mail-group {
  display: inline-flex;
  gap: 0.15rem;
  align-items: center;
  padding-right: 0.4rem;
  border-right: 1px solid #e2e8f0;
  margin-right: 0.35rem;
}

.wg-rich-mail-group:last-child {
  border-right: 0;
  margin-right: 0;
  flex: 1;
  flex-wrap: wrap;
}

.wg-rich-mail-tool-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  min-height: 34px;
  min-width: 34px;
  padding: 0.2rem 0.45rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
}

.wg-rich-mail-tool-btn:hover {
  background: #e2e8f0;
}

.wg-rich-mail-color-input {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.wg-rich-mail-var-chip {
  border: 1px solid #99f6e4;
  background: linear-gradient(135deg, #f0fdfa, #ecfeff);
  color: #0f766e;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.wg-rich-mail-var-chip:hover {
  background: #ccfbf1;
}

.wg-rich-mail-block-btn {
  border: 1px dashed #94a3b8;
  background: #fff;
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: #475569;
}

.wg-rich-mail-surface {
  min-height: 360px;
  padding: 1.15rem 1.35rem;
  line-height: 1.6;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  background: #fff;
  cursor: text;
  -webkit-user-modify: read-write;
  user-select: text;
}

.wg-rich-mail-surface:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.wg-rich-mail-surface p {
  margin: 0 0 0.85rem;
}

.wg-rich-mail-surface ul,
.wg-rich-mail-surface ol {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}

.wg-rich-mail-surface a {
  color: #0d9488;
}

.wg-rich-mail-shell button,
.wg-mail-wrap button.wg-mail-tab,
.wg-mail-wrap button.wg-mail-tab-active,
.wg-mail-wrap button.wg-mail-lang-tab,
.wg-mail-wrap button.wg-mail-lang-tab-active,
.wg-mail-wrap button.wg-mail-subject-var-chip,
.wg-mail-wrap button.wg-mail-subject-var-toggle {
  appearance: none;
  font-family: inherit;
  line-height: 1.25;
}

.wg-rich-mail-tool-btn,
.wg-rich-mail-var-chip,
.wg-rich-mail-block-btn,
.wg-rich-mail-popover-btn,
.wg-rich-mail-mention-item {
  font: inherit;
}

.wg-rich-mail-surface .wg-var {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  margin: 0 0.08rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
  border: 1px solid #2dd4bf;
  color: #115e59;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84em;
  cursor: pointer;
  vertical-align: baseline;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.wg-rich-mail-surface .wg-var:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.wg-rich-mail-surface .wg-var.wg-var-active {
  box-shadow: 0 0 0 2px #14b8a6, 0 4px 12px rgba(13, 148, 136, 0.2);
}

.wg-rich-mail-surface .wg-var-glyph {
  color: #0d9488;
  font-size: 0.7em;
  line-height: 1;
}

.wg-rich-mail-surface .wg-mail-header {
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 3px solid #0f172a;
}

.wg-rich-mail-surface .wg-mail-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d9488;
  font-weight: 800;
}

.wg-rich-mail-surface .wg-mail-footer {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.9rem;
}

.wg-rich-mail-surface .wg-mail-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.wg-rich-mail-surface .wg-mail-details {
  margin: 1rem 0;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.wg-rich-mail-surface .wg-mail-details ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.wg-rich-mail-surface .wg-mail-legal {
  margin: 0.5rem 0 1rem;
  padding-left: 1.1rem;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.5;
}

.wg-rich-mail-surface .wg-mail-privacy {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  border-radius: 10px;
  font-size: 0.88rem;
}

.wg-rich-mail-surface .wg-mail-items {
  margin: 1rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.wg-rich-mail-surface .wg-mail-items-title {
  margin: 0;
  padding: 0.65rem 0.9rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.wg-rich-mail-surface .wg-mail-items-empty {
  padding: 0.75rem 0.9rem;
  color: #64748b;
  font-size: 0.9rem;
}

.wg-rich-mail-popover {
  position: fixed;
  z-index: 1000;
  min-width: 240px;
  max-width: 300px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #14b8a6;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
}

.wg-rich-mail-popover-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0d9488;
  margin: 0 0 0.35rem;
}

.wg-rich-mail-popover-label {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  color: #0f172a;
}

.wg-rich-mail-popover-token {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 0.5rem;
}

.wg-rich-mail-popover-example {
  font-size: 0.82rem;
  color: #475569;
  margin: 0 0 0.65rem;
}

.wg-rich-mail-popover-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.wg-rich-mail-popover-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.wg-rich-mail-popover-btn-primary {
  border-color: #14b8a6;
  background: #f0fdfa;
  color: #0f766e;
}

.wg-rich-mail-mention-menu {
  position: fixed;
  z-index: 1001;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.wg-rich-mail-mention-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.wg-rich-mail-mention-item:hover,
.wg-rich-mail-mention-item-active {
  background: #f0fdfa;
}

.wg-rich-mail-mention-item strong {
  display: block;
  font-size: 0.88rem;
}

.wg-rich-mail-mention-item span {
  font-size: 0.75rem;
  color: #64748b;
  font-family: ui-monospace, monospace;
}

.wg-rich-mail-hint-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(90deg, #f0fdfa, #ecfeff);
  border-bottom: 1px solid #99f6e4;
  font-size: 0.82rem;
  color: #115e59;
  font-weight: 600;
}

.wg-rich-mail-hint-icon {
  border-radius: 6px;
  flex-shrink: 0;
}

.wg-rich-mail-var-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
