:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-hover: #edf2fa;
  --active-pill: #c2e7ff;
  --active-pill-text: #001d35;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1f2937;
  --text-muted: #64748b;
  --primary: #0b57d0;
  --primary-hover: #0842a0;
  --tonal-bg: #e8f0fe;
  --tonal-text: #0b57d0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --otp-bg: #eff6ff;
  --otp-border: #93c5fd;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.16);
  --radius: 12px;
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #111318;
  --surface: #1b1f27;
  --surface-subtle: #232833;
  --surface-hover: #282f3d;
  --active-pill: #263b5e;
  --active-pill-text: #dbeafe;
  --border: #2e3545;
  --border-strong: #3d4659;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --tonal-bg: #1e293b;
  --tonal-text: #93c5fd;
  --danger: #f87171;
  --danger-bg: #451a1a;
  --success: #4ade80;
  --success-bg: #143322;
  --warning-bg: #422006;
  --warning-text: #fde68a;
  --otp-bg: #172554;
  --otp-border: #1d4ed8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--text-muted);
}

/* Inputs & Buttons */
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.15);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

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

.btn-tonal {
  background: var(--tonal-bg);
  color: var(--tonal-text);
}

.btn-tonal:hover {
  filter: brightness(0.96);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--surface-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: var(--danger-bg);
}

.btn-compose {
  width: 100%;
  justify-content: flex-start;
  padding: 13px 18px;
  border-radius: 16px;
  background: var(--active-pill);
  color: var(--active-pill-text);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.btn-compose:hover {
  filter: brightness(0.97);
}

.btn-verify {
  background: var(--success);
  color: #ffffff;
  text-decoration: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.mini-text-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.mini-text-btn:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--primary);
}

/* Alerts */
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 12px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.alert-info {
  background: var(--tonal-bg);
  color: var(--tonal-text);
}

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(11, 87, 208, 0.12), transparent 45%), var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
}

.domain-chip {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo.sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.login-subtitle {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 12px 0 5px;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.password-wrap input {
  padding-right: 40px;
}

.password-wrap .icon-btn {
  position: absolute;
  right: 4px;
}

/* App Shell */
.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: var(--bg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.domain-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--tonal-bg);
  color: var(--tonal-text);
  font-weight: 600;
}

.topbar-search {
  flex: 1;
  max-width: 520px;
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search .search-icon {
  position: absolute;
  left: 14px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0.7;
}

.topbar-search input {
  border-radius: 999px;
  padding: 9px 36px 9px 38px;
  border-color: transparent;
  background: var(--surface-hover);
}

.topbar-search input:focus {
  background: var(--surface);
  border-color: var(--border-strong);
}

.topbar-search .icon-btn {
  position: absolute;
  right: 4px;
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

#auto-refresh-btn.active .live-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

/* Workspace 3-Pane */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 270px minmax(330px, 430px) minmax(0, 1fr);
  gap: 10px;
  padding: 0 12px 12px;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 4px 2px;
  overflow: hidden;
}

.sidebar-primary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.folder-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.folder-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s;
}

.folder-item:hover {
  background: var(--surface-hover);
}

.folder-item.active {
  background: var(--active-pill);
  color: var(--active-pill-text);
  font-weight: 700;
}

.folder-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
}

.count-pill.muted {
  background: transparent;
  color: var(--text-muted);
}

.mailboxes-header {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-bottom: 6px;
}

.mailboxes-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding: 0 4px;
}

.export-actions {
  display: flex;
  gap: 4px;
}

.mailbox-filter {
  padding: 6px 10px !important;
  font-size: 12.5px !important;
  border-radius: 8px !important;
}

.mailbox-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.mailbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
}

.mailbox-item:hover {
  background: var(--surface-hover);
}

.mailbox-item.active {
  background: var(--active-pill);
  color: var(--active-pill-text);
}

.mailbox-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mailbox-text {
  min-width: 0;
  flex: 1;
}

.mailbox-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mailbox-local {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-sub-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.label-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paused-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--warning-bg);
  color: var(--warning-text);
}

.mailbox-right {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.mailbox-actions {
  display: none;
  gap: 2px;
}

.mailbox-item:hover .mailbox-actions,
.mailbox-item.active .mailbox-actions {
  display: flex;
}

.mb-action-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mb-action-btn:hover {
  background: var(--surface);
  color: var(--primary);
}

/* List & Reader Cards */
.list-pane,
.reader-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.mailbox-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.mailbox-banner-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mailbox-banner-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.mailbox-banner-actions {
  display: flex;
  gap: 6px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 4px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.chip.active {
  background: var(--tonal-bg);
  color: var(--tonal-text);
  border-color: transparent;
}

.list-count-info {
  font-size: 12px;
  color: var(--text-muted);
}

.email-list {
  flex: 1;
  overflow-y: auto;
}

.email-row {
  display: grid;
  grid-template-columns: 24px 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.email-row:hover {
  background: var(--surface-hover);
}

.email-row.unread {
  background: rgba(11, 87, 208, 0.04);
}

.email-row.selected {
  background: var(--active-pill);
}

.star-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.2;
}

.star-btn.starred {
  color: #f59e0b;
}

.email-row-body {
  min-width: 0;
}

.email-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.email-sender {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-row.unread .email-sender,
.email-row.unread .email-subject {
  font-weight: 700;
  color: var(--text);
}

.email-time {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.email-subject {
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-snippet {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.alias-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.otp-chip-btn {
  border: 1px dashed var(--otp-border);
  background: var(--otp-bg);
  color: var(--primary);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.otp-chip-btn:hover {
  filter: brightness(0.95);
}

.list-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.load-more-wrap {
  padding: 12px;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Reader Pane */
.reader-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

.reader-empty-icon {
  font-size: 46px;
  margin-bottom: 10px;
}

.reader-empty h3 {
  margin: 0 0 8px;
  color: var(--text);
}

.reader-empty p {
  max-width: 380px;
  margin: 0 0 18px;
}

.reader-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mobile-reader-back {
  display: none;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.reader-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.reader-subject {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.3;
}

.otp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--otp-bg);
  border: 1px dashed var(--otp-border);
  margin-bottom: 14px;
}

.otp-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.otp-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.otp-value {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary);
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sender-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.meta-details {
  min-width: 0;
  flex: 1;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-row.small {
  margin-top: 3px;
  font-size: 12px;
}

.to-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-subtle);
  padding: 2px 7px;
  border-radius: 6px;
}

.attachments-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}

.att-chip:hover {
  border-color: var(--primary);
}

.reader-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mode-tabs {
  display: flex;
  gap: 4px;
}

.mode-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.mode-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.remote-img-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--warning-text);
}

.reader-body-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.reader-iframe {
  width: 100%;
  flex: 1;
  border: none;
  background: #ffffff;
}

.reader-pre {
  margin: 0;
  padding: 20px;
  flex: 1;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}

.reader-headers {
  padding: 16px 20px;
  flex: 1;
  overflow: auto;
  background: var(--surface);
}

.header-kv {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.header-k {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
}

.header-v {
  font-family: var(--font-mono);
  word-break: break-all;
}

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

.modal-card {
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.modal-card.modal-lg {
  max-width: 620px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  gap: 8px;
}

.modal-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 10px 6px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
}

.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.modal-body {
  padding: 16px 18px 18px;
}

.domain-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.domain-suffix {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  flex-wrap: wrap;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
}

.swatch.active {
  border-color: var(--text);
  transform: scale(1.12);
}

.batch-result-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.batch-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.edit-address-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-subtle);
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.toggle-row.small {
  font-size: 12px;
  color: var(--text-muted);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-bg);
  margin-top: 8px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.18s ease-out;
}

.toast.success {
  background: #14532d;
}

.toast.error {
  background: #7f1d1d;
}

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

/* Responsive Breakpoints */
.mobile-only {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 30;
}

@media (max-width: 1060px) {
  .workspace {
    grid-template-columns: 245px minmax(0, 1fr);
    position: relative;
  }

  .reader-pane {
    display: none;
  }

  .workspace.reader-open .list-pane {
    display: none;
  }

  .workspace.reader-open .reader-pane {
    display: flex;
  }

  .mobile-reader-back {
    display: inline-flex;
  }

  .hide-md {
    display: none;
  }
}

@media (max-width: 760px) {
  .mobile-only {
    display: inline-flex;
  }

  .hide-sm,
  .domain-badge {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 285px;
    background: var(--bg);
    z-index: 40;
    padding: 14px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
