:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --ok: #10b981;
  --ok-bg: #ecfdf5;
  --r: 16px;
  --sh-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --sh: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--body);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-name {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--blue-600);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seg {
  display: flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 10px;
}

.seg-btn {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Main Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 26px 24px;
  box-shadow: var(--sh);
  margin-bottom: 28px;
}

.label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.addr {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid var(--blue-200);
  border-radius: 14px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.addr:focus-within {
  border-color: var(--blue-600);
  box-shadow: var(--ring);
}

.mail-ico {
  width: 22px;
  height: 22px;
  color: var(--blue-600);
  flex-shrink: 0;
  margin-right: 10px;
}

.addr input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  outline: 0;
  font-family: inherit;
  min-width: 0;
}

.icon-btn {
  background: var(--blue-600);
  color: #fff;
  border: 0;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--blue-700);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Domain Status Chip */
.domain-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12.5px;
}

.chip.ok {
  background: var(--ok-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.chip.ok svg {
  width: 15px;
  height: 15px;
  color: var(--ok);
}

.chip.warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Action Buttons */
.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  border: 0;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--blue-700);
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--body);
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.btn-soft {
  background: var(--blue-50);
  color: var(--blue-600);
}

.btn-soft:hover {
  background: var(--blue-100);
}

.btn svg {
  width: 17px;
  height: 17px;
}

/* Auto poll indicator */
.poll-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.poll-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Inbox section */
.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 2px 14px;
}

.inbox-head h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.inbox-head .count {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  margin-left: 6px;
}

/* Mail List */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.mail:hover {
  box-shadow: var(--sh-sm);
  border-color: var(--border-strong);
}

.mail.open {
  border-color: var(--blue-200);
  box-shadow: var(--sh);
}

.mail-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 16px 18px;
  cursor: pointer;
  font-family: inherit;
}

.mail-row:hover {
  background: #f8fafc;
}

.avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mail.unread .avatar {
  background: var(--blue-600);
  color: #fff;
}

.mail-main {
  min-width: 0;
  flex: 1;
}

.mail-sender {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.mail-sender span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.udot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-600);
}

.mail-subject {
  display: block;
  color: var(--body);
  font-size: 14px;
  font-weight: 600;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-preview {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-left: 4px;
}

.mail-time {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chev {
  width: 18px;
  height: 18px;
  color: var(--faint);
  transition: transform 0.2s;
}

.mail.open .chev {
  transform: rotate(180deg);
}

/* OTP Badge in mail row */
.otp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  font-family: monospace;
}

/* Email Expanded Content */
.email-content {
  display: none;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.mail.open .email-content {
  display: block;
}

.email-meta-bar {
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.email-meta-info {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.email-meta-info b {
  color: var(--ink);
}

.otp-hero-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.otp-hero-val {
  font-size: 26px;
  font-weight: 800;
  color: #047857;
  letter-spacing: 0.12em;
  font-family: monospace;
}

.email-body-pad {
  padding: 16px 18px 24px;
}

.email-frame {
  width: 100%;
  min-height: 250px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  display: block;
}

/* Empty State */
.state {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.state svg {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  color: var(--faint);
  display: block;
}

.state p {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.state span {
  font-size: 13px;
  color: var(--muted);
}

/* Spin animation */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Modals */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.overlay.hidden {
  display: none !important;
}

.modal {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.x {
  border: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.x:hover {
  color: var(--ink);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
  opacity: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* SEO Info Cards */
.info-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.info-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}

.info-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
