/* ═══════════════════════════════════════════════════════════════════════════
   Temporary Email Pro — UI Styles
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --tm-accent:    #6366f1;
  --tm-accent-d:  #4f46e5;
  --tm-green:     #10b981;
  --tm-red:       #ef4444;
  --tm-yellow:    #f59e0b;
  --tm-bg:        #f8faff;
  --tm-card-bg:   #ffffff;
  --tm-border:    rgba(99,102,241,0.12);
  --tm-text:      #1e293b;
  --tm-muted:     #64748b;
  --tm-radius:    14px;
  --tm-shadow:    0 4px 24px rgba(99,102,241,0.08);
  --tm-trans:     all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
.tm-app { font-family: 'Inter', -apple-system, sans-serif; color: var(--tm-text); }
.tm-card { background: var(--tm-card-bg); border-radius: var(--tm-radius); padding: 1.5rem;
           box-shadow: var(--tm-shadow); border: 1px solid var(--tm-border); }

/* ── Header Bar ────────────────────────────────────────────────────────── */
.tm-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--tm-radius); padding: 0; margin-bottom: 1rem;
  box-shadow: 0 8px 32px rgba(99,102,241,0.25);
}
.tm-header-inner {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 0.75rem;
  padding: 1rem 1.25rem;
}

/* Brand — never shrinks */
.tm-brand { display: flex; align-items: center; gap: 0.5rem; color: #fff; flex-shrink: 0; }
.tm-icon { font-size: 1.5rem; }
.tm-brand-name { font-weight: 700; font-size: 1.05rem; color: #fff; white-space: nowrap; }

/* ── Address Bar — always gets the centre space ────────────────────────── */
/* flex: 1 1 180px → grows to fill space, can shrink, but never below 180px */
.tm-address-bar {
  display: flex; align-items: center; gap: 0.5rem;
  flex: 1 1 180px; min-width: 0; flex-wrap: nowrap;
}
.tm-address-display {
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
  border-radius: 999px; padding: 0.45rem 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  flex: 1; min-width: 0;
  border: 1px solid rgba(255,255,255,0.25);
  overflow: hidden; /* clips text cleanly inside the pill */
}
.tm-address-text {
  color: #fff; font-family: monospace; font-size: 0.9rem; font-weight: 600;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tm-copy-btn {
  background: rgba(255,255,255,0.2); border: none; border-radius: 999px;
  color: #fff; padding: 0.2rem 0.6rem; font-size: 0.75rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.25rem; white-space: nowrap;
  flex-shrink: 0; /* Copy button is always visible */
  transition: var(--tm-trans);
}
.tm-copy-btn:hover { background: rgba(255,255,255,0.35); }
.tm-copy-btn.copied { background: var(--tm-green); }

.tm-expiry {
  display: flex; align-items: center; gap: 0.3rem;
  color: rgba(255,255,255,0.85); font-size: 0.78rem; white-space: nowrap;
  flex-shrink: 0;
  padding: 0 0.5rem 0 0.5rem;
  border-left: 1px solid rgba(255,255,255,0.25);
  border-right: 1px solid rgba(255,255,255,0.25);
}
.tm-expiry[data-expiry] #tm-countdown.urgent { color: #fca5a5; animation: pulse 1s infinite; }
/* Permanent chip — shown in place of the countdown for permanent-type inboxes */
.tm-perm-chip {
  color: #fcd34d !important;
  border-left-color: rgba(252,211,77,0.35) !important;
  border-right-color: rgba(252,211,77,0.35) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Action Buttons — never compress the address bar ──────────────────── */
/* flex-shrink:0 keeps actions at their natural width; overflow-x:auto scrolls if too wide */
.tm-actions {
  display: flex; align-items: center; gap: 0.5rem;
  flex-shrink: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
}
.tm-actions::-webkit-scrollbar { display: none; }

.tm-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.82rem;
  font-weight: 600; cursor: pointer; border: none; text-decoration: none;
  transition: var(--tm-trans); white-space: nowrap; line-height: 1.5;
  flex-shrink: 0; /* never compress inside a flex row */
}
.tm-btn-primary { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.tm-btn-primary:hover { background: rgba(255,255,255,0.35); color: #fff; }
.tm-btn-outline { background: transparent; color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.3); }
.tm-btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tm-btn-danger { background: #fee2e2; color: var(--tm-red); border: 1px solid #fca5a5; }
.tm-btn-danger:hover { background: var(--tm-red); color: #fff; }
.tm-btn-gold { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; border: none; }
.tm-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }
.tm-btn-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.tm-new-badge {
  background: var(--tm-red); color: #fff; border-radius: 50%;
  width: 16px; height: 16px; font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
  animation: pulse 1s infinite;
}

/* ── Select ────────────────────────────────────────────────────────────── */
.tm-select {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; color: #fff; padding: 0.35rem 0.75rem;
  font-size: 0.82rem; cursor: pointer; outline: none;
  flex-shrink: 0; /* never compress inside a flex row */
}
.tm-select option { color: #000; background: #fff; }
.tm-select.w-100 {
  background: var(--tm-card-bg); border: 1px solid #e2e8f0; color: var(--tm-text);
  border-radius: 8px; padding: 0.5rem 0.75rem;
}

/* ── Custom Domain Dropdown ────────────────────────────────────────────── */
.tm-dd-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 200;
}

/* Trigger pill */
.tm-dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  color: #fff;
  padding: 0.32rem 0.72rem 0.32rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tm-dd-trigger:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.45);
}
.tm-dd--open .tm-dd-trigger {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.5);
}
.tm-dd-globe { font-size: 0.92rem; line-height: 1; }
.tm-dd-label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tm-dd-caret {
  opacity: 0.8;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.tm-dd--open .tm-dd-caret { transform: rotate(180deg); }

/* Dropdown panel — hidden by default, shown when .tm-dd--open on wrap */
.tm-dd-panel {
  position: fixed;   /* fixed escapes overflow:hidden on header/actions parents */
  top: 0; left: 0;  /* overridden by JS on each open via getBoundingClientRect() */
  min-width: 230px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.18), 0 2px 12px rgba(0,0,0,0.1);
  padding: 6px;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(.4,0,.2,1),
              transform 0.2s cubic-bezier(.4,0,.2,1);
  transform-origin: top left;
  outline: none;
  z-index: 9999;
}
.tm-dd--open .tm-dd-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Section label */
.tm-dd-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 3px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
}
.tm-dd-upgrade-link {
  font-size: 0.68rem;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
  letter-spacing: 0;
  text-transform: none;
  transition: color 0.15s;
}
.tm-dd-upgrade-link:hover { color: #4f46e5; text-decoration: underline; }

/* Divider */
.tm-dd-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 6px;
}

/* Option rows */
.tm-dd-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.65rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.13s;
  font-size: 0.83rem;
  color: #1e293b;
  font-weight: 500;
}
.tm-dd-option:hover { background: #f1f5f9; }
.tm-dd-option--active {
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
  color: #4f46e5;
}
.tm-dd-option--active:hover { background: linear-gradient(135deg, #ddd6fe 0%, #c7d2fe 100%); }

.tm-dd-check {
  width: 14px;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #6366f1;
  font-weight: 700;
}
.tm-dd-opt-domain {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Locked / premium row */
.tm-dd-option--locked {
  cursor: default;
  opacity: 0.62;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 4px,
    rgba(148,163,184,0.06) 4px,
    rgba(148,163,184,0.06) 8px
  );
}
.tm-dd-option--locked:hover { background: rgba(148,163,184,0.08); }
.tm-dd-lock { font-size: 0.78rem; width: 14px; flex-shrink: 0; }

/* Badges */
.tm-dd-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.tm-dd-badge--sys     { background: #ede9fe; color: #6d28d9; }
.tm-dd-badge--custom  { background: #fef3c7; color: #b45309; }
.tm-dd-badge--premium { background: #fef9c3; color: #a16207; border: 1px solid #fde68a; }

/* Shake animation for locked click */
@keyframes tmDdShake {
  0%,100% { transform: translateX(0) scale(1); }
  20%      { transform: translateX(-4px) scale(1.01); }
  40%      { transform: translateX(4px) scale(1.01); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
.tm-dd-panel--shake { animation: tmDdShake 0.45s cubic-bezier(.36,.07,.19,.97); }

/* ── Body Layout ───────────────────────────────────────────────────────── */
.tm-body { display: flex; gap: 1rem; min-height: 520px; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.tm-sidebar {
  width: 220px; flex-shrink: 0; background: var(--tm-card-bg);
  border-radius: var(--tm-radius); border: 1px solid var(--tm-border);
  box-shadow: var(--tm-shadow); overflow: hidden;
}
.tm-sidebar-header {
  padding: 0.75rem 1rem; background: var(--tm-bg);
  border-bottom: 1px solid var(--tm-border);
  display: flex; justify-content: space-between; align-items: center;
}
.tm-limit-badge { background: var(--tm-accent); color: #fff; font-size: 0.7rem; border-radius: 999px; padding: 0.1rem 0.45rem; }
.tm-inbox-list { overflow-y: auto; }
.tm-inbox-item {
  display: block; padding: 0.65rem 1rem; text-decoration: none; color: var(--tm-text);
  border-bottom: 1px solid var(--tm-border); transition: var(--tm-trans);
}
.tm-inbox-item:hover { background: var(--tm-bg); }
.tm-inbox-item.active { background: rgba(99,102,241,0.08); border-left: 3px solid var(--tm-accent); }
.tm-inbox-item-inner { display: flex; justify-content: space-between; align-items: center; }
.tm-inbox-addr { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.tm-inbox-count { background: var(--tm-accent); color: #fff; border-radius: 999px; font-size: 0.7rem; padding: 0 0.4rem; }
/* Permanent icon in sidebar list */
.tm-inbox-perm { font-size: 0.82rem; color: #f59e0b; line-height: 1; flex-shrink: 0; }
.tm-inbox-domain { font-size: 0.72rem; color: var(--tm-muted); }
.tm-upgrade-notice { padding: 0.75rem 1rem; font-size: 0.75rem; text-align: center; }
.tm-upgrade-notice a { color: var(--tm-accent); text-decoration: none; }

/* ── Inbox list pagination ──────────────────────────────────────────────── */
.tm-inbox-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.35rem 0.75rem; border-top: 1px solid var(--tm-border);
  background: var(--tm-bg);
}
.tm-ipb {
  background: none; border: 1px solid var(--tm-border); border-radius: 6px;
  width: 26px; height: 26px; line-height: 1; cursor: pointer;
  color: var(--tm-text); font-size: 1rem; transition: var(--tm-trans);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.tm-ipb:hover:not(:disabled) {
  background: var(--tm-accent); color: #fff; border-color: var(--tm-accent);
}
.tm-ipb:disabled { opacity: 0.3; cursor: not-allowed; }
.tm-ipp { font-size: 0.72rem; color: var(--tm-muted); font-weight: 600; letter-spacing: 0.03em; }


/* ── Main Panel ────────────────────────────────────────────────────────── */
.tm-main {
  flex: 1; background: var(--tm-card-bg); border-radius: var(--tm-radius);
  border: 1px solid var(--tm-border); box-shadow: var(--tm-shadow); overflow: hidden; display: flex; flex-direction: column;
}
.tm-search-bar {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--tm-border);
  display: flex; align-items: center; gap: 0.5rem; background: var(--tm-bg);
}
.tm-search-input {
  flex: 1; border: 1px solid #e2e8f0; border-radius: 999px; padding: 0.4rem 0.9rem;
  font-size: 0.85rem; outline: none; transition: var(--tm-trans);
}
.tm-search-input:focus { border-color: var(--tm-accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.tm-unread-count {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  background: var(--tm-accent); color: #fff;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  line-height: 1.4; min-width: 1.5rem; justify-content: center;
}
.tm-unread-count:empty { display: none; }

.tm-last-refresh { font-size: 0.7rem; color: var(--tm-muted); white-space: nowrap; }

.tm-messages { flex: 1; overflow-y: auto; }
.tm-message-row {
  display: grid; grid-template-columns: 1fr 1fr 2fr auto;
  gap: 0.5rem 1rem; align-items: center;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--tm-border);
  text-decoration: none; color: var(--tm-text); transition: var(--tm-trans);
}
.tm-message-row:hover { background: var(--tm-bg); }
.tm-message-row.tm-unread { background: rgba(99,102,241,0.04); }
.tm-message-row.tm-unread .tm-msg-from,
.tm-message-row.tm-unread .tm-msg-subject { font-weight: 700; }
.tm-message-row.tm-spam { opacity: 0.6; }
.tm-msg-from { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-msg-subject { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-msg-preview { font-size: 0.75rem; color: var(--tm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-msg-time { font-size: 0.72rem; color: var(--tm-muted); text-align: right; white-space: nowrap; }
.tm-attach-icon { font-size: 0.8rem; }

/* ── Empty State ───────────────────────────────────────────────────────── */
.tm-empty { padding: 3rem 1rem; text-align: center; }
.tm-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.tm-waiting-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: 1rem; }
.tm-waiting-dots span {
  width: 8px; height: 8px; background: var(--tm-accent); border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.tm-waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.tm-waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── Upgrade Banner ────────────────────────────────────────────────────── */
/* ── Locked premium action buttons (header, free users) ─────────────────── */
/* ── Locked premium action buttons (header, free users) ─────────────────── */
.tm-btn-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.9rem 0.38rem 0.7rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--tm-trans);
  /* Frosted glass on dark purple header */
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tm-btn-locked .tm-lock-icon {
  font-size: 0.7rem;
  filter: sepia(1) saturate(4) hue-rotate(5deg); /* golden tint on 🔒 */
  flex-shrink: 0;
}
.tm-btn-locked:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}
.tm-locked-label { letter-spacing: 0.01em; }
@media (max-width: 600px) { .tm-locked-label { display: none; } }
.tm-permanent-label { letter-spacing: 0.01em; }
@media (max-width: 560px) { .tm-permanent-label { display: none; } }

/* ── Premium Features Showcase (free users) ──────────────────────────────── */
.tm-premium-showcase {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  border-radius: var(--tm-radius);
  padding: 1.5rem;
  box-shadow: 0 8px 40px rgba(99,102,241,0.25);
  border: 1px solid rgba(99,102,241,0.3);
  position: relative;
  overflow: hidden;
}
.tm-premium-showcase::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.25) 0%, transparent 70%);
  pointer-events: none;
}

/* Header row: title + CTA button */
.tm-ps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.tm-ps-header h6 { color: #fff; margin-bottom: 0.2rem; }
.tm-ps-header .text-muted { color: rgba(255,255,255,0.6) !important; }

/* Feature grid — 3 columns on desktop, 2 on tablet, 1 on mobile */
.tm-ps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 768px) { .tm-ps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tm-ps-grid { grid-template-columns: 1fr; } }

/* Individual feature card */
.tm-ps-feature {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  transition: var(--tm-trans);
  position: relative;
  overflow: hidden;
}
.tm-ps-feature:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(99,102,241,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.2);
  text-decoration: none;
}

/* 🔒 lock badge top-right */
.tm-ps-lock {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  font-size: 0.7rem;
  opacity: 0.55;
}

/* Feature icon (large emoji) */
.tm-ps-feat-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  filter: grayscale(0.3);
}

/* Feature text block */
.tm-ps-feat-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tm-ps-feat-text strong {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}
.tm-ps-feat-text span {
  color: rgba(255,255,255,0.55);
  font-size: 0.73rem;
  line-height: 1.3;
}
.tm-ps-feat-text code {
  background: rgba(255,255,255,0.12);
  color: #a5f3fc;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */
.tm-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;  /* breathing room so modal never touches screen edges */
}
.tm-modal.open { display: flex; animation: fadeIn 0.2s; }
.tm-modal-box {
  background: #fff; border-radius: var(--tm-radius); padding: 2rem;
  width: 100%; max-width: 900px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}
/* ── Modal context: override dark-header styles for white modal background ── */
.tm-modal-box .tm-select {
  background: var(--tm-card-bg, #f8fafc);
  border: 1px solid #e2e8f0;
  color: var(--tm-text, #1e293b);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  flex: 1;
  min-width: 0;
}
.tm-modal-box .tm-input-group {
  flex-wrap: nowrap;
}
.tm-modal-box .tm-input-group .tm-input {
  flex: 1;
  min-width: 0;
  width: auto;
}
.tm-modal-box .tm-btn-primary {
  background: var(--tm-accent, #6366f1);
  color: #fff;
  border-color: var(--tm-accent, #6366f1);
}
.tm-modal-box .tm-btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
}
.tm-modal-box .tm-btn-outline {
  background: transparent;
  color: var(--tm-text, #1e293b);
  border: 1px solid #e2e8f0;
}
.tm-modal-box .tm-btn-outline:hover {
  background: var(--tm-bg, #f1f5f9);
  color: var(--tm-text, #1e293b);
}

/* ── Input ─────────────────────────────────────────────────────────────── */
.tm-input {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.5rem 0.75rem;
  font-size: 0.85rem; width: 100%; outline: none; transition: var(--tm-trans);
}
.tm-input:focus { border-color: var(--tm-accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.tm-input-group { display: flex; align-items: center; gap: 0.25rem; }
.tm-input-at { color: var(--tm-muted); font-weight: 600; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.tm-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 99999;
  background: #1e293b; color: #fff; border-radius: 10px;
  padding: 0.75rem 1.25rem; font-size: 0.85rem; font-weight: 500;
  transform: translateY(80px); opacity: 0; transition: var(--tm-trans);
  pointer-events: none;
}
.tm-toast.show { transform: translateY(0); opacity: 1; }
.tm-toast.success { background: #065f46; }
.tm-toast.error   { background: #7f1d1d; }

/* ── Email Viewer ──────────────────────────────────────────────────────── */
.tm-viewer-wrap { max-width: 880px; margin: 0 auto; }
.tm-viewer-toolbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tm-viewer-toolbar .tm-btn { color: var(--tm-text); border-color: #e2e8f0; background: var(--tm-card-bg); }
.tm-viewer-toolbar .tm-btn:hover { background: var(--tm-bg); }
.tm-viewer-toolbar .tm-btn-danger { color: var(--tm-red); }
.tm-viewer-header {
  background: var(--tm-card-bg); border-radius: var(--tm-radius);
  border: 1px solid var(--tm-border); padding: 1.5rem; margin-bottom: 1rem;
  box-shadow: var(--tm-shadow);
}
.tm-viewer-subject { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.4; }
.tm-viewer-meta { border-top: 1px solid var(--tm-border); padding-top: 0.75rem; }
.tm-meta-row { display: flex; gap: 1rem; padding: 0.3rem 0; font-size: 0.85rem; }
.tm-meta-label { color: var(--tm-muted); width: 60px; flex-shrink: 0; }
.tm-meta-value { color: var(--tm-text); word-break: break-word; }
.tm-attachments { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--tm-border); }
.tm-attachments-label { font-size: 0.82rem; font-weight: 600; color: var(--tm-muted); display: block; margin-bottom: 0.5rem; }
.tm-attachment-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tm-attachment-chip {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem;
  background: var(--tm-bg); border: 1px solid var(--tm-border); border-radius: 999px;
  text-decoration: none; color: var(--tm-text); font-size: 0.78rem; transition: var(--tm-trans);
}
.tm-attachment-chip:hover { background: rgba(99,102,241,0.08); border-color: var(--tm-accent); color: var(--tm-accent); }
.tm-attach-size { color: var(--tm-muted); font-size: 0.7rem; }

.tm-viewer-body {
  background: var(--tm-card-bg); border-radius: var(--tm-radius);
  border: 1px solid var(--tm-border); box-shadow: var(--tm-shadow); overflow: hidden;
  margin-bottom: 1rem;
}
.tm-html-toggle { padding: 0.75rem 1rem; background: var(--tm-bg); border-bottom: 1px solid var(--tm-border); display: flex; gap: 0.5rem; margin-bottom: 0; }
.tm-html-toggle .tm-btn { color: var(--tm-text); border-color: #e2e8f0; background: #fff; }
.tm-html-toggle .tm-btn.active { background: var(--tm-accent); color: #fff; border-color: var(--tm-accent); }
.tm-email-iframe { width: 100%; border: none; display: block; min-height: 400px; }
.tm-plain-text { padding: 1.5rem; margin: 0; font-size: 0.9rem; white-space: pre-wrap; word-wrap: break-word; line-height: 1.7; font-family: inherit; }
.tm-viewer-nav { display: flex; gap: 0.75rem; }
.tm-viewer-nav .tm-btn { color: var(--tm-text); border-color: #e2e8f0; background: var(--tm-card-bg); }

/* ── Admin helpers ─────────────────────────────────────────────────────── */
.tm-setting-row { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0; }
.tm-address-code { font-size: 0.82rem; background: rgba(99,102,241,0.07); padding: 0.1rem 0.4rem; border-radius: 4px; }
.tm-info-box { background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.15); border-radius: var(--tm-radius); padding: 1.25rem 1.5rem; }
.tm-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes bounce { 0%,80%,100%{transform:scale(0)} 40%{transform:scale(1)} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes spin { to{transform:rotate(360deg)} }

/* ── Responsive ────────────────────────────────────────────────────────── */

/* ── Tablet (641px – 900px) ── */
@media (max-width: 900px) {
  .tm-header-inner { gap: 0.65rem; }
  .tm-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tm-actions::-webkit-scrollbar { display: none; }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
  .tm-header-inner {
    flex-direction: column;
    align-items: stretch;      /* children fill full width */
    gap: 0.55rem;
    padding: 0.9rem 1rem;
  }

  /* Brand row: icon + name side by side */
  .tm-brand { width: 100%; }

  /* Address bar: stack address display on top, expiry below */
  .tm-address-bar {
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.45rem;
  }

  /* Address pill: stretch full width so Copy button is always visible */
  .tm-address-display {
    width: 100%;
    min-width: 0;          /* critical: allows flex children to shrink */
    box-sizing: border-box;
  }

  /* Email text: truncate with ellipsis instead of overflowing */
  .tm-address-text {
    min-width: 0;          /* critical: flex child must have min-width:0 */
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;    /* slightly smaller on mobile */
  }


  /* Action buttons: single horizontally-scrollable row, never wrap */
  .tm-actions {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 0.75rem;
    padding-bottom: 2px;
  }
  .tm-actions::-webkit-scrollbar { display: none; }
  /* All direct children must NOT shrink — this is what enables overflow-x:auto */
  .tm-actions > * { flex-shrink: 0 !important; }
  /* Domain select: auto-size to its content, don’t expand full width */
  .tm-actions #tm-domain-select { width: auto; max-width: 120px; }

  /* Show ALL button labels on mobile (override the 560px/600px hide rules) */
  .tm-locked-label   { display: inline !important; font-size: 0.72rem; }
  .tm-domains-label  { display: inline !important; font-size: 0.72rem; }
  .tm-permanent-label{ display: inline !important; font-size: 0.72rem; }

  /* Body: stack sidebar above messages */
  .tm-body { flex-direction: column; }
  .tm-sidebar { width: 100%; max-height: 180px; overflow-y: auto; }

  /* Message rows: simplified 2-col grid */
  .tm-message-row { grid-template-columns: 1fr auto; }
  .tm-msg-preview { display: none; }
  .tm-msg-subject { font-size: 0.8rem; }
}

/* -- DNS Verification Result Panel -------------------------------------- */
.tm-dns-result-row td { padding: 0 !important; }
.tm-dns-result {
  animation: tmSlideDown .25s ease;
  background: var(--bs-body-bg, #fff);
}
.tm-dns-ok  { background: rgba(25, 135, 84, .04) !important; }
.tm-dns-fail{ background: rgba(220, 53, 69, .04) !important; }
@keyframes tmSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* -- Click-to-copy elements ---------------------------------------------- */
.tm-copy {
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s, opacity .15s;
  border-radius: 4px;
  padding: 1px 4px;
}
.tm-copy:hover {
  background: rgba(13, 110, 253, .1);
  color: #0d6efd !important;
  text-decoration: none;
}
.tm-copy:hover::after {
  content: ' ??';
  font-size: .75em;
  opacity: .7;
}
.tm-copy:active {
  transform: scale(.97);
}
.tm-copy-ok {
  background: rgba(25, 135, 84, .15) !important;
  color: #198754 !important;
  font-weight: 600;
}

/* ── Mail arrival alert cards ──────────────────────────────────────────── */
.tm-mail-alerts {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.tm-mail-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-left: 4px solid var(--tm-accent);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(99,102,241,0.10);
  min-width: 280px;
  max-width: 340px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(110%);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.22,.68,0,1.2);
}
.tm-mail-alert.tm-mail-alert--in {
  opacity: 1;
  transform: translateX(0);
}
.tm-mail-alert-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.tm-mail-alert-body {
  flex: 1;
  min-width: 0;
}
.tm-mail-alert-from {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-mail-alert-subject {
  font-size: 0.75rem;
  color: var(--tm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}
.tm-mail-alert-link {
  font-size: 1.1rem;
  color: var(--tm-accent);
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  transition: background .15s;
}
.tm-mail-alert-link:hover { background: rgba(99,102,241,0.1); }
.tm-mail-alert-close {
  background: none;
  border: none;
  font-size: 0.8rem;
  color: var(--tm-muted);
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.tm-mail-alert-close:hover { color: #dc3545; background: rgba(220,53,69,0.08); }

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.tm-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(99,102,241,0.04);
  border-bottom: 1px solid var(--tm-border);
  flex-wrap: wrap;
}
.tm-filter-btn {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--tm-border);
  background: var(--tm-card-bg);
  color: var(--tm-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tm-trans);
  white-space: nowrap;
  line-height: 1.5;
}
.tm-filter-btn:hover {
  border-color: var(--tm-accent);
  color: var(--tm-accent);
  background: rgba(99,102,241,0.06);
}
.tm-filter-btn.active {
  background: var(--tm-accent);
  border-color: var(--tm-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.tm-filter-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--tm-muted);
  font-weight: 500;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.tm-page-nav {
  padding: 0.75rem 0.75rem 0.5rem;
  display: flex;
  justify-content: center;
}
.tm-pagination {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: center;
}
.tm-pg-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  border-radius: 8px;
  border: 1.5px solid var(--tm-border);
  background: var(--tm-card-bg);
  color: var(--tm-text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tm-trans);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tm-pg-btn:hover:not([disabled]) {
  border-color: var(--tm-accent);
  color: var(--tm-accent);
  background: rgba(99,102,241,0.06);
}
.tm-pg-btn.tm-pg-active,
.tm-pg-btn[disabled].tm-pg-active {
  background: var(--tm-accent);
  border-color: var(--tm-accent);
  color: #fff;
  cursor: default;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.tm-pg-btn[disabled]:not(.tm-pg-active) {
  opacity: 0.4;
  cursor: not-allowed;
}
.tm-pg-ellipsis {
  color: var(--tm-muted);
  font-size: 0.85rem;
  padding: 0 0.1rem;
  user-select: none;
}
.tm-pg-info {
  font-size: 0.72rem;
  color: var(--tm-muted);
  margin-left: 0.4rem;
  white-space: nowrap;
}

/* ══ Custom Domains ───────────────────────────────────────────────────────── */

/* Globe button in header — frosted glass pill, same family as all header buttons */
.tm-btn-globe {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--tm-trans);
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tm-btn-globe:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
}
.tm-domains-label { display: inline; }
@media (max-width: 560px) { .tm-domains-label { display: none; } }


/* Domains modal box — wider than default */
.tm-domains-box {
  width: min(900px, calc(100vw - 2rem)) !important;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.5rem !important;
}

/* Header row with close button */
.tm-domains-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tm-border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}
.tm-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--tm-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: var(--tm-trans);
}
.tm-modal-close:hover { background: rgba(0,0,0,0.06); color: var(--tm-text); }

/* Add domain row */
.tm-domain-add-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.tm-domain-add-row .tm-input { flex: 1; }

/* Error message */
.tm-domain-err {
  font-size: 0.8rem;
  color: var(--tm-red);
  padding: 0.4rem 0.6rem;
  background: rgba(239,68,68,0.07);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* DNS instructions panel */
.tm-dns-panel {
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(6,182,212,0.04));
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  margin-bottom: 1rem;
  overflow: hidden;
  animation: tm-slide-down 0.25s ease;
}
.tm-dns-panel-inner { padding: 1rem 1.2rem; }
.tm-dns-record {
  background: #0f172a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}
.tm-dns-table { width: 100%; border-collapse: collapse; }
.tm-dns-table th {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 60px;
  padding-right: 0.75rem;
}
.tm-dns-table td {
  color: #e2e8f0;
  font-size: 0.82rem;
  padding: 0.2rem 0;
  word-break: break-all;
}
.tm-dns-table .font-monospace { font-family: 'Fira Mono', 'Consolas', monospace; color: #a5f3fc; }
.tm-dns-table em { color: #64748b; font-style: normal; font-size: 0.78rem; }

/* Domain list */
.tm-domains-list { display: flex; flex-direction: column; gap: 0.6rem; }
.tm-domains-empty { text-align: center; padding: 1.5rem 1rem; }
.tm-domains-empty .tm-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* Individual domain card */
.tm-domain-card {
  background: var(--tm-card-bg);
  border: 1px solid var(--tm-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: var(--tm-trans);
  animation: tm-slide-down 0.2s ease;
}
.tm-domain-card:hover { border-color: var(--tm-accent); box-shadow: 0 2px 12px rgba(99,102,241,0.1); }

.tm-domain-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.tm-domain-name { font-weight: 600; font-size: 0.95rem; color: var(--tm-text); }

.tm-domain-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Badge variants */
.tm-domain-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tm-badge-verified { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.3); }
.tm-badge-pending  { background: rgba(245,158,11,0.12); color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
.tm-badge-deleted  { background: rgba(239,68,68,0.1);  color: #b91c1c; border: 1px solid rgba(239,68,68,0.2); }
.tm-badge-ok   { color: #059669; font-size: 0.78rem; }
.tm-badge-warn { color: #b45309; font-size: 0.78rem; }

/* Extra-small action buttons */
.tm-btn-xs {
  padding: 0.2rem 0.55rem !important;
  font-size: 0.73rem !important;
  border-radius: 6px !important;
}
.tm-btn-sm {
  padding: 0.3rem 0.7rem !important;
  font-size: 0.78rem !important;
  border-radius: 7px !important;
}
.tm-btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--tm-red);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--tm-trans);
}
.tm-btn-danger:hover { background: var(--tm-red); color: #fff; }

@keyframes tm-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══ Custom Domains Modal \u2014 Responsive ═══════════════════════════════════ */

/* Tablet (641px \u2013 900px): slightly less padding, still centered */
@media (max-width: 900px) {
  .tm-domains-box {
    padding: 1.25rem !important;
  }
  /* Tighten DNS table columns a little */
  .tm-domain-card .table th[style*="width:200px"] { width: 150px !important; }
  .tm-domain-card .table th[style*="width:160px"] { width: 120px !important; }
}

/* Mobile (\u2264 640px): bottom sheet */
@media (max-width: 640px) {
  /* Overlay: anchor to bottom, no side padding so sheet fills full width */
  .tm-modal {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  /* Sheet: full width, rounded top corners only, fixed max-height */
  .tm-domains-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    border-radius: 1.25rem 1.25rem 0 0 !important;
    padding: 1.25rem 1rem !important;
    animation: tmSheetUp 0.32s cubic-bezier(.22,.68,0,1.08) !important;
    /* Drag handle visual cue */
    padding-top: 1.5rem !important;
    background-image: radial-gradient(ellipse 40px 4px at 50% 10px, rgba(0,0,0,0.18) 100%, transparent 100%);
    background-repeat: no-repeat;
  }
  @keyframes tmSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* Header: domain name + badge take full width, buttons wrap below */
  .tm-domain-card > .card-body:first-child {
    flex-wrap: wrap !important;
    gap: 0.5rem 0.5rem !important;
    padding: 0.75rem !important;
  }
  /* Action button group shunts to its own row */
  .tm-domain-card > .card-body:first-child > .ms-auto {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  /* DNS section header */
  .tm-domain-card .card-body.p-0 > [onclick] {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* DNS table: always scroll horizontally, never clip */
  .tm-domain-card .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Shrink fixed column widths so table is less wide */
  .tm-domain-card .table th { width: auto !important; }
  .tm-domain-card .table td.ps-4 { padding-left: 0.6rem !important; }
  .tm-domain-card .table td,
  .tm-domain-card .table th { font-size: 0.73rem !important; }

  /* Value column: tighter max-width */
  .tm-domain-card .table td span[style*="max-width:280px"] {
    max-width: 160px !important;
  }

  /* Footer row */
  .tm-domain-card .border-top.px-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Add-domain input row */
  .tm-domain-add-row { flex-wrap: nowrap !important; }

  /* Domains modal title */
  .tm-domains-header h5 { font-size: 1rem; }
}

/* Very small screens (\u2264 400px) */
@media (max-width: 400px) {
  .tm-domains-box { padding: 1rem 0.75rem !important; padding-top: 1.35rem !important; }
  .tm-domains-header h5 { font-size: 0.95rem; }
  /* Collapse Verify/Remove to icon-only if needed */
  .tm-domain-card .btn-sm { font-size: 0.72rem !important; padding: 0.25rem 0.5rem !important; }
  /* DNS count badge: hide text, keep number */
  .tm-domain-card .badge.rounded-pill[id^="tm-dns-count"] { font-size: 0.68rem !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   PREMIUM DOMAIN FEATURES — Admin Domain Management
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Stats Banner ─────────────────────────────────────────────────────────── */
.tm-domain-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .tm-domain-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tm-domain-stats { grid-template-columns: 1fr 1fr; gap: 0.6rem; } }

.tm-stat-card {
  background: #fff;
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 12px rgba(99,102,241,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.tm-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
}
.tm-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.12); }
.tm-stat-card--total::before    { background: linear-gradient(90deg,#6366f1,#8b5cf6); }
.tm-stat-card--verified::before { background: linear-gradient(90deg,#10b981,#06d6a0); }
.tm-stat-card--active::before   { background: linear-gradient(90deg,#3b82f6,#06b6d4); }
.tm-stat-card--suspended::before { background: linear-gradient(90deg,#f59e0b,#ef4444); }

.tm-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.tm-stat-card--total    .tm-stat-icon { background: rgba(99,102,241,0.12); }
.tm-stat-card--verified .tm-stat-icon { background: rgba(16,185,129,0.12); }
.tm-stat-card--active   .tm-stat-icon { background: rgba(59,130,246,0.12); }
.tm-stat-card--suspended .tm-stat-icon { background: rgba(245,158,11,0.12); }

.tm-stat-body { min-width: 0; }
.tm-stat-val  { font-size: 1.75rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: #1e293b; }
.tm-stat-label { font-size: 0.75rem; color: #64748b; font-weight: 500; margin-top: 0.2rem; white-space: nowrap; }

/* ── Search + Filter Bar ──────────────────────────────────────────────────── */
.tm-admin-domain-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;        /* toolbar itself wraps search above pills if needed */
}
.tm-admin-domain-search {
  flex: 1;
  min-width: 180px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.75rem center;
}
.tm-admin-domain-search:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }

/* Pills container — always wrap, never overflow-scroll */
.tm-admin-filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;        /* wrap into rows — NEVER set to nowrap */
  align-items: center;
}
.tm-admin-filter-pill {
  padding: 0.38rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.tm-admin-filter-pill:hover { border-color: #6366f1; color: #6366f1; background: rgba(99,102,241,0.05); }
.tm-admin-filter-pill.active { background: #6366f1; border-color: #6366f1; color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }

/* ── Bulk Actions Bar ─────────────────────────────────────────────────────── */
.tm-bulk-bar {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  display: none;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  animation: fadeIn 0.2s ease;
}
.tm-bulk-bar.visible { display: flex; }
.tm-bulk-selected { opacity: 0.8; font-weight: 400; font-size: 0.82rem; }
.tm-bulk-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.tm-bulk-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.tm-bulk-btn:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.5); }
.tm-bulk-btn--danger { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.2); }
.tm-bulk-btn--danger:hover { background: rgba(239,68,68,0.4); }

/* ── Premium Domain Card ──────────────────────────────────────────────────── */
.tm-pdomain-card {
  background: #fff;
  border: 1.5px solid #e8eaf0;
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 2px 10px rgba(99,102,241,0.05);
}
.tm-pdomain-card:hover { box-shadow: 0 6px 24px rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); }
.tm-pdomain-card.selected { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

.tm-pdomain-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.tm-pdomain-checkbox { width: 18px; height: 18px; accent-color: #6366f1; cursor: pointer; flex-shrink: 0; }

/* Health ring */
.tm-health-ring-wrap { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.tm-health-ring { transform: rotate(-90deg); overflow: visible; }
.tm-health-ring-bg { fill: none; stroke: #f1f5f9; stroke-width: 4; }
.tm-health-ring-fg { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1); }
.tm-health-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #1e293b;
}

.tm-pdomain-info { flex: 1; min-width: 0; }
.tm-pdomain-name { font-size: 1rem; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-pdomain-meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; }

/* DNS status pills */
.tm-dns-pill { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.55rem; border-radius: 20px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; }
.tm-dns-pill--ok   { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.25); }
.tm-dns-pill--fail { background: rgba(239,68,68,0.1);   color: #dc2626; border: 1px solid rgba(239,68,68,0.2);  }
.tm-dns-pill--na   { background: rgba(148,163,184,0.1); color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); }
.tm-dns-pill-dot   { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Card action buttons */
.tm-pdomain-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap; }
.tm-pda-btn {
  padding: 0.38rem 0.8rem; border-radius: 8px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid; transition: all 0.18s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.tm-pda-btn--verify   { color: #6366f1; border-color: #c7d2fe; background: #eef2ff; }
.tm-pda-btn--verify:hover   { background: #6366f1; color: #fff; border-color: #6366f1; }
.tm-pda-btn--suspend  { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.tm-pda-btn--suspend:hover  { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.tm-pda-btn--activate { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.tm-pda-btn--activate:hover { background: #10b981; color: #fff; border-color: #10b981; }
.tm-pda-btn--delete   { color: #dc2626; border-color: #fecaca; background: #fff1f2; }
.tm-pda-btn--delete:hover   { background: #ef4444; color: #fff; border-color: #ef4444; }
.tm-pda-btn .tm-spin { display: none; width: 12px; height: 12px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.tm-pda-btn.loading .tm-spin { display: inline-block; }
.tm-pda-btn.loading .tm-pda-ico { display: none; }

/* ── Inline Daily Limit Editor ────────────────────────────────────────────── */
.tm-limit-edit { display: inline-flex; align-items: center; gap: 0.4rem; }
.tm-limit-val {
  font-weight: 600; cursor: pointer; padding: 0.1rem 0.3rem;
  border-radius: 4px; border: 1.5px solid transparent; transition: border-color 0.15s;
  min-width: 3rem; text-align: center;
}
.tm-limit-val:hover { border-color: #c7d2fe; background: #eef2ff; }
.tm-limit-input-wrap { display: none; align-items: center; gap: 0.3rem; }
.tm-limit-input-wrap.active { display: flex; }
.tm-limit-input { width: 80px; border: 1.5px solid #6366f1; border-radius: 6px; padding: 0.25rem 0.4rem; font-size: 0.8rem; outline: none; text-align: center; }
.tm-limit-save   { padding: 0.22rem 0.55rem; border-radius: 6px; background: #6366f1; color: #fff; border: none; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.tm-limit-cancel { padding: 0.22rem 0.55rem; border-radius: 6px; background: #f1f5f9; color: #64748b; border: none; font-size: 0.75rem; cursor: pointer; }

/* ── DNS Records Section ──────────────────────────────────────────────────── */
.tm-pdns-section { border-top: 1px solid #f1f5f9; }
.tm-pdns-toggle { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 1.25rem; cursor: pointer; background: #fafbff; transition: background 0.15s; user-select: none; }
.tm-pdns-toggle:hover { background: #f1f5ff; }
.tm-pdns-arrow { font-size: 0.7rem; color: #6366f1; transition: transform 0.25s; display: inline-block; }
.tm-pdns-arrow.open { transform: rotate(180deg); }
.tm-pdns-label { font-size: 0.82rem; font-weight: 600; color: #6366f1; flex: 1; }
.tm-pdns-badge { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 20px; background: #f1f5f9; color: #64748b; }
.tm-pdns-badge.good    { background: #dcfce7; color: #166534; }
.tm-pdns-badge.partial { background: #fef3c7; color: #92400e; }
.tm-pdns-body { display: none; }
.tm-pdns-body.open { display: block; }

.tm-pdns-row {
  display: grid;
  grid-template-columns: 34px 160px 60px 1fr 1fr 90px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid #f8faff;
  font-size: 0.82rem;
  transition: background 0.12s;
}
.tm-pdns-row:hover { background: #fafbff; }
@media (max-width: 900px) { .tm-pdns-row { grid-template-columns: 30px 120px 55px 1fr 1fr 75px; } }
@media (max-width: 640px) { .tm-pdns-row { grid-template-columns: 1fr; gap: 0.2rem; padding: 0.7rem 1rem; border-top: 1px dashed #e2e8f0; } }

.tm-pdns-ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0; }
.tm-pdns-ico--ok   { background: #dcfce7; color: #16a34a; }
.tm-pdns-ico--fail { background: #fee2e2; color: #dc2626; }
.tm-pdns-ico--na   { background: #f1f5f9; color: #94a3b8; }

.tm-pdns-name { font-weight: 600; color: #374151; }
.tm-pdns-desc { font-size: 0.71rem; color: #94a3b8; }
.tm-pdns-type { display: inline-block; padding: 0.12rem 0.45rem; border-radius: 5px; background: #ede9fe; color: #5b21b6; font-size: 0.7rem; font-weight: 700; font-family: monospace; }
.tm-pdns-host, .tm-pdns-val { font-family: 'Fira Mono','Consolas',monospace; font-size: 0.76rem; color: #374151; word-break: break-all; cursor: pointer; transition: color 0.15s; }
.tm-pdns-host:hover, .tm-pdns-val:hover { color: #6366f1; text-decoration: underline dotted; }
.tm-pdns-copy-btn { padding: 0.22rem 0.6rem; border-radius: 6px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; font-size: 0.72rem; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.tm-pdns-copy-btn:hover  { border-color: #6366f1; color: #6366f1; background: #eef2ff; }
.tm-pdns-copy-btn.copied { background: #dcfce7; border-color: #a7f3d0; color: #059669; }

.tm-pdns-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1.25rem; background: #fafbff; border-top: 1px solid #f1f5f9;
  font-size: 0.73rem; color: #94a3b8; flex-wrap: wrap; gap: 0.5rem;
}
.tm-pdns-copy-all { padding: 0.25rem 0.7rem; border-radius: 7px; border: 1px solid #c7d2fe; background: #eef2ff; color: #6366f1; font-size: 0.73rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.tm-pdns-copy-all:hover { background: #6366f1; color: #fff; border-color: #6366f1; }

/* ── Catch-all toggle ────────────────────────────────────────────────────── */
.tm-catchall-wrap { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.78rem; color: #64748b; user-select: none; }
.tm-catchall-wrap input { display: none; }
.tm-catchall-slider { width: 32px; height: 18px; background: #e2e8f0; border-radius: 20px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.tm-catchall-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: left 0.2s; }
.tm-catchall-wrap input:checked + .tm-catchall-slider { background: #10b981; }
.tm-catchall-wrap input:checked + .tm-catchall-slider::after { left: 16px; }

/* ── Empty state (premium) ───────────────────────────────────────────────── */
.tm-domain-empty-prem { text-align: center; padding: 3.5rem 2rem; background: #fff; border: 1.5px dashed #c7d2fe; border-radius: 16px; }
.tm-domain-empty-prem .dep-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.tm-domain-empty-prem h5 { color: #1e293b; font-weight: 700; margin-bottom: 0.4rem; }
.tm-domain-empty-prem p  { color: #64748b; font-size: 0.88rem; max-width: 360px; margin: 0 auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM ADD DOMAIN BUTTON + PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── + Add Domain Button ────────────────────────────────────────────────────── */
.tm-add-domain-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
/* shimmer sweep on hover */
.tm-add-domain-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-18deg);
  transition: left 0.5s ease;
}
.tm-add-domain-btn:hover::before { left: 160%; }
.tm-add-domain-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.45);
}
.tm-add-domain-btn:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(99,102,241,0.35); }

/* Open/close state */
.tm-add-domain-btn--open {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  box-shadow: 0 4px 14px rgba(51,65,85,0.25);
}
.tm-add-domain-btn--open:hover { box-shadow: 0 6px 20px rgba(51,65,85,0.35); }

.tm-add-domain-btn-ico {
  font-size: 1rem;
  line-height: 1;
  font-weight: 400;
  transition: transform 0.25s;
}
.tm-add-domain-btn--open .tm-add-domain-btn-ico { transform: rotate(0deg); }

/* ── Add Domain Panel ───────────────────────────────────────────────────────── */
.tm-add-panel {
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid rgba(99,102,241,0.18);
  box-shadow: 0 8px 40px rgba(99,102,241,0.12), 0 2px 10px rgba(0,0,0,0.04);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

@keyframes tmPanelSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tmPanelSlideUp {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}
.tm-add-panel--opening { animation: tmPanelSlideDown 0.26s cubic-bezier(0.4,0,0.2,1); }
.tm-add-panel--closing { animation: tmPanelSlideUp  0.26s cubic-bezier(0.4,0,0.2,1); }

/* Panel gradient header */
.tm-add-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #6366f1 100%);
  position: relative;
  overflow: hidden;
}
/* Decorative blobs */
.tm-add-panel-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
.tm-add-panel-header::after {
  content: '';
  position: absolute;
  bottom: -20px; left: 20%;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.tm-add-panel-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 1;
}
.tm-add-panel-icon {
  font-size: 1.6rem;
  background: rgba(255,255,255,0.15);
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}
.tm-add-panel-title { font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.2; }
.tm-add-panel-sub   { font-size: 0.78rem; color: rgba(255,255,255,0.72); margin-top: 0.15rem; }

.tm-add-panel-close {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: #fff;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.18s;
  z-index: 1;
  flex-shrink: 0;
}
.tm-add-panel-close:hover { background: rgba(255,255,255,0.28); }

/* Panel form body */
.tm-add-panel-body {
  padding: 1.5rem;
}

/* ── Add Domain Fields Grid (responsive, single source of truth) ─────────── */

/*
  4-col desktop layout (≥ 1281px):
  [  Domain Name (2fr)  ][ Type (1.4fr) ][ Limit (1fr) ][ Button ]
  All fields on one baseline row — no displacement.
*/
.tm-add-fields {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1fr auto;
  gap: 1.25rem;
  align-items: end;
}

/*
  ≤ 1280px — 2-col layout:
  Row 1: [ Domain Name  (full width, 1 / -1) ]
  Row 2: [ Domain Type  ] [ Daily Limit      ]
  Row 3: [ + Add Domain (full width, 1 / -1) ]
*/
@media (max-width: 1280px) {
  .tm-add-fields {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .tm-add-field--wide   { grid-column: 1 / -1; }
  .tm-add-field--submit { grid-column: 1 / -1; }
  .tm-add-submit        { width: 100%; justify-content: center; }
}

/* ≤ 639px — single column, everything stacked */
@media (max-width: 639px) {
  .tm-add-fields {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .tm-add-field--wide,
  .tm-add-field--submit { grid-column: auto; }
  .tm-add-submit        { width: 100%; justify-content: center; }
  .tm-add-input         { font-size: 0.88rem; padding: 0.6rem 0.8rem; }
  .tm-add-select        { font-size: 0.88rem; padding: 0.6rem 2rem 0.6rem 0.8rem; }
  .tm-add-label         { font-size: 0.75rem; }
  .tm-add-hint          { font-size: 0.7rem; }
}


.tm-add-field { display: flex; flex-direction: column; gap: 0.4rem; }

/* Label */
.tm-add-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tm-add-label-icon { font-size: 0.9rem; }

/* Hint text below input */
.tm-add-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

/* Inputs */
.tm-add-input-wrap { position: relative; }
.tm-add-input {
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  color: #1e293b;
  background: #f8faff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
}
.tm-add-input::placeholder { color: #b0bec5; }
.tm-add-input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
/* domain input — monospace feel */
.tm-add-field--wide .tm-add-input {
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

/* Custom select */
.tm-add-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.tm-add-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 2.2rem 0.65rem 0.9rem;
  font-size: 0.88rem;
  color: #1e293b;
  background: #f8faff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
}
.tm-add-select:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.tm-add-select-arrow {
  position: absolute;
  right: 0.85rem;
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
  transition: transform 0.2s;
}
.tm-add-select:focus + .tm-add-select-arrow { color: #6366f1; transform: rotate(180deg); }

/* Submit button */
.tm-add-field--submit { justify-content: flex-end; }
.tm-add-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  transition: all 0.22s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.tm-add-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-18deg);
  transition: left 0.5s ease;
}
.tm-add-submit:hover::before { left: 160%; }
.tm-add-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.45);
}
.tm-add-submit:active { transform: translateY(0); }
.tm-add-submit-ico { font-size: 1.1rem; font-weight: 400; }

/* ═══════════════════════════════════════════════════════════════════════════
   FULL RESPONSIVE SYSTEM — All breakpoints, all components
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Wide Desktop (1400px+) — let things breathe more ──────────────────────── */
@media (min-width: 1400px) {
  .tm-domain-stats   { gap: 1.5rem; }
  .tm-stat-val       { font-size: 2rem; }
  .tm-pdomain-header { padding: 1.15rem 1.5rem; }
  .tm-add-panel-body { padding: 1.75rem 2rem; }
  .tm-add-fields     { gap: 1.5rem; }
}

/* ── Tablet landscape (max 1024px) ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Stats: 2×2 grid */
  .tm-domain-stats { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }

  /* Filter pills: allow scroll on small tablets */
  /* Filter pills: still wrap at 1024px */
  .tm-admin-filter-pills { gap: 0.35rem; }

  /* DNS record row: hide value column, keep key cols */
  .tm-pdns-row { grid-template-columns: 30px 140px 58px 1fr 90px; }
  .tm-pdns-row > *:nth-child(5) { display: none; } /* hide value col — show on click */

  /* Add Domain form: handled by base grid breakpoints above */
}

/* ── Tablet portrait (max 900px) ────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Stats */
  .tm-domain-stats   { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .tm-stat-card      { padding: 0.9rem 1rem; }
  .tm-stat-val       { font-size: 1.5rem; }
  .tm-stat-icon      { width: 38px; height: 38px; font-size: 1.1rem; }

  /* Toolbar */
  .tm-admin-domain-toolbar { gap: 0.5rem; }
  .tm-admin-domain-search  { min-width: 140px; padding: 0.45rem 0.8rem 0.45rem 2.1rem; font-size: 0.84rem; }
  .tm-admin-filter-pill    { padding: 0.28rem 0.6rem; font-size: 0.74rem; }

  /* Bulk bar */
  .tm-bulk-bar    { flex-wrap: wrap; gap: 0.6rem; padding: 0.65rem 1rem; }
  .tm-bulk-actions { margin-left: 0; flex-wrap: wrap; gap: 0.4rem; }

  /* Domain card header: wrap actions below */
  .tm-pdomain-header  { gap: 0.6rem; padding: 0.85rem 1rem; }
  .tm-pdomain-actions { width: 100%; justify-content: flex-start; margin-top: 0.35rem; gap: 0.35rem; }
  .tm-pda-btn         { font-size: 0.75rem; padding: 0.32rem 0.65rem; }

  /* Health ring: slightly smaller */
  .tm-health-ring-wrap { width: 46px; height: 46px; }
  .tm-health-ring      { width: 46px; height: 46px; }

  /* Limit footer */
  .tm-pdomain-header + div { flex-direction: column; align-items: flex-start !important; gap: 0.5rem; }

  /* DNS row: two-col layout at 900px */
  .tm-pdns-row { grid-template-columns: 30px 130px 55px 1fr 80px; gap: 0.4rem; }
  .tm-pdns-row > *:nth-child(5) { display: block; }

  /* Add Domain panel body padding at 900px */
  .tm-add-panel-body { padding: 1.1rem 1.15rem; }
}

/* ── Phablet / large phone (max 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
  /* Stats: still 2 col */
  .tm-stat-card  { padding: 0.8rem 0.9rem; gap: 0.75rem; }
  .tm-stat-val   { font-size: 1.4rem; }
  .tm-stat-label { font-size: 0.7rem; }

  /* Page header: stack title + button */
  .tm-add-domain-btn { padding: 0.48rem 0.95rem; font-size: 0.82rem; }

  /* Domain card name: allow wrapping */
  .tm-pdomain-name { white-space: normal; word-break: break-word; font-size: 0.92rem; }

  /* Meta row: wrap pills */
  .tm-pdomain-meta { gap: 0.3rem; }
  .tm-dns-pill     { font-size: 0.66rem; padding: 0.12rem 0.45rem; }

  /* Catch-all label: hide on small */
  .tm-catchall-wrap span:last-child { display: none; }

  /* Action buttons: compact */
  .tm-pda-btn { font-size: 0.72rem; padding: 0.28rem 0.55rem; border-radius: 7px; }

  /* DNS section */
  .tm-pdns-toggle  { padding: 0.55rem 1rem; }
  .tm-pdns-label   { font-size: 0.78rem; }
  .tm-pdns-badge   { font-size: 0.68rem; }
  .tm-pdns-copy-all { font-size: 0.68rem; padding: 0.2rem 0.5rem; }

  /* DNS row: 5-col (drop value preview) */
  .tm-pdns-row { grid-template-columns: 28px 110px 52px 1fr 75px; padding: 0.6rem 1rem; gap: 0.3rem; }
  .tm-pdns-row > *:nth-child(5) { display: none; }

  /* DNS footer */
  .tm-pdns-footer { padding: 0.5rem 1rem; font-size: 0.7rem; }

  /* Limit edit */
  .tm-limit-val  { font-size: 0.8rem; }
  .tm-limit-input { width: 68px; }

  /* Add panel header sizing at 768px */
  .tm-add-panel-header { padding: 0.9rem 1.1rem; }
  .tm-add-panel-title  { font-size: 0.9rem; }
  .tm-add-panel-sub    { font-size: 0.73rem; }
  .tm-add-panel-icon   { width: 38px; height: 38px; font-size: 1.3rem; border-radius: 10px; }
}

/* ── Phone landscape / mid phone (max 640px) ────────────────────────────────── */
@media (max-width: 640px) {
  /* Stats: 2 col tight */
  .tm-domain-stats { gap: 0.6rem; }
  .tm-stat-card    { padding: 0.7rem 0.8rem; gap: 0.6rem; border-radius: 12px; }
  .tm-stat-val     { font-size: 1.3rem; }
  .tm-stat-icon    { width: 34px; height: 34px; font-size: 1rem; border-radius: 9px; }

  /* Toolbar: stack search full-width, pills wrap below */
  .tm-admin-domain-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .tm-admin-domain-search { min-width: unset; width: 100%; }

  /* Pills: wrap into rows — never horizontal scroll */
  .tm-admin-filter-pills {
    flex-wrap: wrap;        /* critical: always wrap */
    gap: 0.35rem;
    width: 100%;
  }
  .tm-admin-filter-pill {
    flex-shrink: 0;
    min-height: 34px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
  }

  /* Bulk bar */
  .tm-bulk-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .tm-bulk-actions { width: 100%; }
  .tm-bulk-btn { flex: 1; text-align: center; justify-content: center; }

  /* Domain card */
  .tm-pdomain-header { flex-wrap: nowrap; padding: 0.75rem; gap: 0.5rem; align-items: flex-start; }
  .tm-pdomain-info   { min-width: 0; flex: 1; }
  .tm-pdomain-name   { font-size: 0.88rem; }
  .tm-pdomain-actions { flex-wrap: wrap; gap: 0.3rem; width: 100%; margin-top: 0.4rem; }

  /* Health ring */
  .tm-health-ring-wrap { width: 42px; height: 42px; }
  .tm-health-ring      { width: 42px; height: 42px; viewBox: "0 0 42 42"; }
  .tm-health-pct       { font-size: 0.6rem; }

  /* DNS pills: hide non-essential */
  .tm-dns-pill:nth-child(n+4) { display: none; }  /* show only first 2 pills */

  /* DNS record row: full-column stacked */
  .tm-pdns-row {
    grid-template-columns: 1fr;
    gap: 0.18rem;
    padding: 0.65rem 0.9rem;
    border-top: 1px dashed #e8edf5;
    position: relative;
  }
  /* Status icon: inline-small top-right */
  .tm-pdns-row .tm-pdns-ico { position: absolute; top: 0.65rem; right: 0.9rem; width: 24px; height: 24px; font-size: 0.68rem; }
  .tm-pdns-row > *:nth-child(5) { display: block; } /* show value again now stacked */
  /* Copy button: full width */
  .tm-pdns-copy-btn { width: 100%; text-align: center; margin-top: 0.2rem; }

  /* Footer limit row: stack vertically */
  .tm-pdomain-header + div {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 0.55rem 0.9rem !important;
    gap: 0.3rem !important;
  }
  .tm-pdomain-header + div > span.ms-auto { margin-left: 0 !important; }

  /* DNS section footer */
  .tm-pdns-footer { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding: 0.5rem 0.9rem; }
  .tm-pdns-copy-all { align-self: flex-end; }

  /* Add domain panel at 640px */
  .tm-add-panel        { border-radius: 14px; }
  .tm-add-panel-header { padding: 0.85rem 1rem; }
  .tm-add-panel-body   { padding: 1rem; }
}

/* ── Small phone (max 480px) ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Stats: 2-col compact */
  .tm-domain-stats { grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
  .tm-stat-card    { padding: 0.65rem 0.7rem; gap: 0.5rem; border-radius: 10px; }
  .tm-stat-val     { font-size: 1.2rem; }
  .tm-stat-label   { font-size: 0.65rem; }
  .tm-stat-icon    { display: none; } /* hide icon to save space */

  /* Page header */
  .tm-add-domain-btn { padding: 0.42rem 0.8rem; font-size: 0.78rem; border-radius: 10px; }
  .tm-add-domain-btn span:last-child { display: none; } /* icon only */
  .tm-add-domain-btn-ico { font-size: 1.2rem; }

  /* Card */
  .tm-pdomain-card   { border-radius: 12px; }
  .tm-pdomain-header { padding: 0.65rem 0.75rem; gap: 0.4rem; }
  .tm-pdomain-name   { font-size: 0.84rem; }

  /* Health ring: smallest */
  .tm-health-ring-wrap { width: 38px; height: 38px; }
  .tm-health-ring      { width: 38px; height: 38px; }
  .tm-health-pct       { font-size: 0.55rem; }

  /* DNS pills: only type + status */
  .tm-pdomain-meta .tm-dns-pill { display: none; }

  /* Action buttons: icon-only on very small */
  .tm-pda-btn { padding: 0.28rem 0.5rem; font-size: 0.7rem; }

  /* Bulk buttons: column */
  .tm-bulk-actions { flex-direction: column; }
  .tm-bulk-btn { width: 100%; text-align: center; }

  /* Add panel */
  .tm-add-panel-icon { display: none; }
  .tm-add-panel-header { gap: 0.5rem; }
  .tm-add-panel-title { font-size: 0.88rem; }
  .tm-add-panel-sub   { display: none; }
}

/* ── Extra-small phone (max 380px / Galaxy S8, iPhone SE) ───────────────────── */
@media (max-width: 380px) {
  /* Stats: single column */
  .tm-domain-stats { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  .tm-stat-card    { padding: 0.55rem 0.6rem; border-radius: 9px; }
  .tm-stat-val     { font-size: 1.1rem; }

  /* Filter pills at 380px: 2-column auto-fit grid so they sit in neat rows */
  .tm-admin-filter-pills {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.3rem;
  }
  .tm-admin-filter-pill {
    padding: 0.28rem 0.45rem;
    font-size: 0.68rem;
    border-radius: 14px;
    min-height: 32px;
    justify-content: center;
    text-align: center;
  }

  /* Card header: tightest */
  .tm-pdomain-header { padding: 0.55rem 0.65rem; }
  .tm-pdomain-name   { font-size: 0.8rem; }

  /* Action buttons: minimal */
  .tm-pda-btn { padding: 0.22rem 0.42rem; font-size: 0.68rem; border-radius: 6px; }
  .tm-pda-btn.tm-pda-btn--delete span:not(.tm-spin) { display: none; }
  .tm-pda-btn.tm-pda-btn--delete::after { content: '🗑'; }

  /* Add panel */
  .tm-add-panel-body { padding: 0.85rem; }
  .tm-add-input, .tm-add-select { padding: 0.52rem 0.7rem; font-size: 0.82rem; border-radius: 8px; }
  .tm-add-submit { font-size: 0.82rem; border-radius: 8px; }
}

/* ── Minimum supported (max 320px / old SE) ─────────────────────────────────── */
@media (max-width: 320px) {
  .tm-domain-stats { grid-template-columns: 1fr 1fr; }
  .tm-pdomain-checkbox { display: none; } /* hide checkbox — too cramped */
  .tm-health-ring-wrap { display: none; }
  .tm-pdomain-header { padding: 0.5rem; }
  .tm-pdomain-name   { font-size: 0.78rem; }
  .tm-pda-btn { padding: 0.2rem 0.38rem; font-size: 0.66rem; }
  .tm-add-panel-header { padding: 0.7rem; }
  .tm-add-panel-body   { padding: 0.7rem; }
}

/* ── Touch devices: improve tap targets ─────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .tm-pda-btn       { min-height: 38px; }
  .tm-admin-filter-pill { min-height: 36px; }
  .tm-bulk-btn      { min-height: 36px; }
  .tm-pdns-copy-btn { min-height: 34px; }
  .tm-add-submit    { min-height: 44px; }
  .tm-add-domain-btn { min-height: 42px; }
  /* Disable hover animations on touch to prevent stuck states */
  .tm-stat-card:hover   { transform: none; }
  .tm-pdomain-card:hover { box-shadow: 0 2px 10px rgba(99,102,241,0.05); border-color: #e8eaf0; }
  .tm-add-domain-btn:hover, .tm-add-submit:hover { transform: none; }
}

/* ── Print: clean printout of domain list ───────────────────────────────────── */
@media print {
  .tm-add-domain-btn, .tm-add-panel, .tm-bulk-bar,
  .tm-admin-domain-toolbar, .tm-pdomain-actions,
  .tm-pdns-copy-btn, .tm-pdns-copy-all, .tm-catchall-wrap,
  .tm-limit-input-wrap, nav { display: none !important; }
  .tm-pdomain-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tm-health-ring-wrap { display: none; }
  .tm-pdns-body { display: block !important; }
  .tm-pdns-toggle { background: #f5f5f5 !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM CUSTOM DOMAIN WIZARD MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Modal box override ─────────────────────────────────────────────────────── */
.tm-wizard-box {
  width: min(680px, 95vw);
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 24px 80px rgba(99,102,241,0.18), 0 4px 20px rgba(0,0,0,0.06);
}

/* ── Wizard header ──────────────────────────────────────────────────────────── */
.tm-wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #6366f1 100%);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.tm-wizard-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
.tm-wizard-header::after {
  content: '';
  position: absolute;
  bottom: -18px; left: 25%;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.tm-wizard-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 1;
}
.tm-wizard-header-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.tm-wizard-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.tm-wizard-header-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.1rem;
}
.tm-wizard-close {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: #fff;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.18s;
  flex-shrink: 0;
  z-index: 1;
}
.tm-wizard-close:hover { background: rgba(255,255,255,0.28); }

/* ── Step progress bar ──────────────────────────────────────────────────────── */
.tm-wizard-steps {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.4rem;
  background: #f8faff;
  border-bottom: 1px solid #e8edf5;
  flex-shrink: 0;
  gap: 0;
}
.tm-wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  flex-shrink: 0;
}
.tm-wizard-step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  border: 2px solid #e2e8f0;
}
.tm-wizard-step.active .tm-wizard-step-dot {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.tm-wizard-step.done .tm-wizard-step-dot {
  background: #10b981;
  color: #fff;
  border-color: transparent;
}
.tm-wizard-step-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tm-wizard-step.active .tm-wizard-step-label { color: #6366f1; }
.tm-wizard-step.done  .tm-wizard-step-label  { color: #10b981; }

.tm-wizard-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 0.4rem;
  margin-bottom: 1rem; /* align with dots */
  border-radius: 2px;
  transition: background 0.3s;
  min-width: 20px;
}
.tm-wizard-step.done ~ .tm-wizard-step-line { background: #10b981; }

/* ── Wizard pane / scrollable body ─────────────────────────────────────────── */
.tm-wizard-pane {
  overflow-y: auto;
  padding: 1.25rem 1.4rem;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* ── Add domain intro box ───────────────────────────────────────────────────── */
.tm-wiz-add-intro {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, #f0f0ff, #f5f3ff);
  border: 1px solid #ddd6fe;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.1rem;
}
.tm-wiz-add-intro-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.tm-wiz-add-intro-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #3730a3;
}
.tm-wiz-add-intro-sub {
  font-size: 0.78rem;
  color: #6d5fd5;
  margin-top: 0.15rem;
}
.tm-wiz-add-intro-sub code {
  background: rgba(99,102,241,0.1);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.76rem;
  color: #4338ca;
}

/* ── Add domain form row ────────────────────────────────────────────────────── */
.tm-wiz-add-field { margin-bottom: 1.1rem; }
.tm-wiz-add-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.tm-wiz-add-input-row {
  display: flex;
  gap: 0.7rem;
  align-items: stretch;
}
.tm-wiz-add-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.tm-wiz-add-input-prefix {
  position: absolute;
  left: 0.85rem;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}
.tm-wiz-add-input {
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 11px;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  font-size: 0.9rem;
  font-family: 'Fira Mono', 'Consolas', monospace;
  color: #1e293b;
  background: #f8faff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.tm-wiz-add-input::placeholder { color: #b0bec5; }
.tm-wiz-add-input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.tm-wiz-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(99,102,241,0.32);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.tm-wiz-add-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-18deg);
  transition: left 0.5s;
}
.tm-wiz-add-btn:hover::before { left: 160%; }
.tm-wiz-add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.42); }
.tm-wiz-add-btn-ico { font-size: 1rem; font-weight: 400; }
.tm-wiz-add-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}
.tm-wiz-add-err {
  margin-top: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #b91c1c;
}

/* ── Domain list heading ────────────────────────────────────────────────────── */
.tm-wiz-domain-list-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.65rem;
  padding-top: 0.2rem;
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.tm-wiz-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #f8faff;
  border: 1.5px dashed #c7d2fe;
  border-radius: 14px;
}
.tm-wiz-empty-icon { font-size: 2.5rem; margin-bottom: 0.7rem; }
.tm-wiz-empty-text { font-size: 0.84rem; color: #64748b; }

/* ── Premium Domain Card ────────────────────────────────────────────────────── */
.tm-wiz-domain-card {
  background: #fff;
  border: 1.5px solid #e8edf5;
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(99,102,241,0.06);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.tm-wiz-domain-card:hover {
  box-shadow: 0 6px 24px rgba(99,102,241,0.12);
  border-color: #c7d2fe;
}

/* Card header */
.tm-wiz-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Health ring */
.tm-wiz-ring-wrap {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tm-wiz-ring { display: block; }
.tm-wiz-ring-pct {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.58rem;
  font-weight: 800;
  color: #374151;
  line-height: 1;
}

/* Card info */
.tm-wiz-card-info { flex: 1; min-width: 0; }
.tm-wiz-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Fira Mono', 'Consolas', monospace;
}
.tm-wiz-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

/* Status pill */
.tm-wiz-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.tm-wiz-status-pill--ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.tm-wiz-status-pill--pending {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}

/* Card action buttons */
.tm-wiz-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.tm-wiz-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.tm-wiz-act-btn--verify {
  background: linear-gradient(135deg, #0d9488, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}
.tm-wiz-act-btn--verify:hover  { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,148,136,0.4); }
.tm-wiz-act-btn--verify.loading { opacity: 0.75; cursor: wait; }
.tm-wiz-act-btn--checkmx {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1.5px solid #c4b5fd;
}
.tm-wiz-act-btn--checkmx:hover { background: #ede9fe; }
.tm-wiz-act-btn--delete {
  background: #fff1f2;
  color: #b91c1c;
  border: 1.5px solid #fecdd3;
  padding: 0.35rem 0.55rem;
}
.tm-wiz-act-btn--delete:hover { background: #fee2e2; }

/* Spinner inside verify btn */
.tm-wiz-act-spin {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tmWizSpin 0.7s linear infinite;
  display: inline-block;
}
@keyframes tmWizSpin {
  to { transform: rotate(360deg); }
}

/* ── DNS Records Toggle bar ─────────────────────────────────────────────────── */
.tm-wiz-dns-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.1rem;
  background: #f8faff;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.tm-wiz-dns-toggle:hover { background: #f0f4ff; }
.tm-wiz-dns-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}
.tm-wiz-dns-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tm-wiz-dns-badge {
  font-size: 0.68rem;
  padding: 0.12rem 0.5rem;
  border-radius: 20px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
}
.tm-wiz-dns-badge.good    { background: #dcfce7; color: #166534; }
.tm-wiz-dns-badge.partial { background: #fef3c7; color: #92400e; }
.tm-wiz-copy-all-btn {
  margin-left: auto;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  color: #64748b;
  font-size: 0.7rem;
  padding: 0.18rem 0.6rem;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.tm-wiz-copy-all-btn:hover { background: #e2e8f0; color: #374151; }
.tm-wiz-copy-all-btn.copied { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* ── DNS Records Body ───────────────────────────────────────────────────────── */
.tm-wiz-dns-body {
  display: none;
}
.tm-wiz-dns-body.open { display: block; }

/* DNS Progress bar strip */
.tm-wiz-dns-progress {
  height: 3px;
  background: #f1f5f9;
  overflow: hidden;
}
.tm-wiz-dns-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 0 2px 2px 0;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* DNS Row */
.tm-wiz-dns-row {
  display: grid;
  grid-template-columns: 28px 1fr 42px 1fr 34px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid #f8faff;
  transition: background 0.15s;
}
.tm-wiz-dns-row:last-of-type { border-bottom: none; }
.tm-wiz-dns-row:hover { background: #fafbff; }

.tm-wiz-dns-row-ico {
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tm-wiz-dns-row-ico.ok   { background: #dcfce7; color: #16a34a; }
.tm-wiz-dns-row-ico.fail { background: #fee2e2; color: #dc2626; }

.tm-wiz-dns-row-info { min-width: 0; }
.tm-wiz-dns-row-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.tm-wiz-dns-row-desc {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-wiz-dns-row-type {
  font-size: 0.65rem;
  font-weight: 700;
  background: #ede9fe;
  color: #5b21b6;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  text-align: center;
  white-space: nowrap;
  font-family: monospace;
}
.tm-wiz-dns-row-val { min-width: 0; }
.tm-wiz-dns-host {
  display: block;
  font-size: 0.68rem;
  color: #7c3aed;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-wiz-dns-value {
  display: block;
  font-size: 0.68rem;
  color: #374151;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Copy btn per row */
.tm-wiz-copy-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}
.tm-wiz-copy-btn:hover  { background: #f1f5f9; border-color: #6366f1; color: #6366f1; }
.tm-wiz-copy-btn.copied { background: #dcfce7; border-color: #bbf7d0; color: #16a34a; }

/* ── Live Check Row ─────────────────────────────────────────────────────────── */
.tm-wiz-check-row {
  padding: 0.75rem 1.1rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbff;
}
.tm-wiz-check-row.checking .tm-wiz-check-bar-wrap { display: block; }
.tm-wiz-check-bar-wrap {
  height: 5px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.45rem;
  display: block;
}
.tm-wiz-check-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #10b981 100%);
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1), background 0.4s;
  background-size: 200% 100%;
  animation: tmBarShimmer 1.5s linear infinite;
}
@keyframes tmBarShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.tm-wiz-check-msg {
  font-size: 0.75rem;
  color: #64748b;
  display: block;
}

/* ── Active / success row ───────────────────────────────────────────────────── */
.tm-wiz-active-row {
  padding: 0.75rem 1.1rem;
  background: linear-gradient(90deg, #f0fdf4, #ecfdf5);
  border-top: 1px solid #bbf7d0;
}
.tm-wiz-active-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Responsive wizard ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tm-wizard-box     { width: 100%; max-height: 95vh; border-radius: 18px 18px 0 0; }
  .tm-wizard-header  { padding: 0.9rem 1rem; }
  .tm-wizard-header-icon { width: 36px; height: 36px; font-size: 1.2rem; border-radius: 10px; }
  .tm-wizard-header-title { font-size: 0.9rem; }
  .tm-wizard-header-sub   { display: none; }
  .tm-wizard-steps   { padding: 0.7rem 1rem; gap: 0; }
  .tm-wizard-step-dot  { width: 26px; height: 26px; font-size: 0.72rem; }
  .tm-wizard-step-label{ font-size: 0.6rem; }
  .tm-wizard-step-line { min-width: 12px; }
  .tm-wizard-pane    { padding: 1rem; }
  .tm-wiz-add-input-row { flex-direction: column; }
  .tm-wiz-add-btn    { width: 100%; justify-content: center; }
  .tm-wiz-card-header { gap: 0.6rem; padding: 0.75rem; }
  .tm-wiz-card-name  { font-size: 0.82rem; }
  .tm-wiz-act-btn    { padding: 0.3rem 0.6rem; font-size: 0.72rem; }
  .tm-wiz-dns-row    { grid-template-columns: 24px 1fr 36px 1fr 28px; gap: 0.35rem; padding: 0.55rem 0.9rem; }
  .tm-wiz-dns-row-name { font-size: 0.72rem; }
  .tm-wiz-dns-row-desc { display: none; }
}

@media (max-width: 480px) {
  .tm-wizard-steps { padding: 0.6rem 0.75rem; }
  .tm-wizard-step-label { display: none; }
  .tm-wizard-step-dot   { width: 24px; height: 24px; font-size: 0.68rem; }
  .tm-wiz-dns-row { grid-template-columns: 22px 1fr 34px 28px; }
  .tm-wiz-dns-row-val { display: none; }
  .tm-wiz-ring-wrap { width: 38px; height: 38px; }
  .tm-wiz-ring      { width: 38px; height: 38px; }
  .tm-wiz-card-actions { flex-direction: column; gap: 0.3rem; }
}

@media (max-width: 380px) {
  .tm-wizard-header  { padding: 0.75rem; }
  .tm-wizard-pane    { padding: 0.75rem; }
  .tm-wiz-add-intro  { padding: 0.7rem 0.85rem; }
  .tm-wiz-dns-row    { grid-template-columns: 22px 1fr 28px; }
  .tm-wiz-dns-row-type { display: none; }
  .tm-wiz-ring-wrap  { display: none; }
}

@media (hover: none) and (pointer: coarse) {
  .tm-wiz-add-btn    { min-height: 44px; }
  .tm-wiz-act-btn    { min-height: 38px; }
  .tm-wiz-copy-btn   { width: 34px; height: 34px; }
  .tm-wiz-copy-all-btn { min-height: 32px; }
}

/* ── Quota Bar ──────────────────────────────────────────────────────────────── */
.tm-wiz-quota-bar {
  padding: 0.6rem 1.25rem 0.7rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(139,92,246,0.04) 100%);
  border-bottom: 1px solid rgba(99,102,241,0.1);
}
.tm-wiz-quota-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.tm-wiz-quota-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tm-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tm-wiz-quota-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tm-accent);
  background: rgba(99,102,241,0.08);
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
}
.tm-wiz-quota-track {
  height: 5px;
  background: rgba(99,102,241,0.1);
  border-radius: 999px;
  overflow: hidden;
}
.tm-wiz-quota-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  min-width: 0;
}
.tm-wiz-quota-fill.warn  { background: linear-gradient(90deg, #f59e0b, #d97706); }
.tm-wiz-quota-fill.full  { background: linear-gradient(90deg, #ef4444, #b91c1c); }

/* ── Catch-all Toggle Switch ────────────────────────────────────────────────── */
.tm-wiz-catchall {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(99,102,241,0.15);
  background: rgba(99,102,241,0.04);
  transition: background 0.15s;
}
.tm-wiz-catchall:hover { background: rgba(99,102,241,0.1); }
.tm-wiz-catchall-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--tm-muted);
  white-space: nowrap;
}
.tm-wiz-catchall-chk {
  display: none;
}
.tm-wiz-catchall-slider {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 17px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.tm-wiz-catchall-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
}
.tm-wiz-catchall-chk:checked + .tm-wiz-catchall-slider {
  background: #6366f1;
}
.tm-wiz-catchall-chk:checked + .tm-wiz-catchall-slider::after {
  transform: translateX(15px);
}

/* Mobile: stack catch-all below other actions */
@media (max-width: 560px) {
  .tm-wiz-catchall { width: 100%; justify-content: space-between; }
  .tm-wiz-quota-bar { padding: 0.5rem 1rem; }
}
