/* ============================================================
   BRUTMAIL — CSS with Dark/Light Theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Bebas+Neue&family=IBM+Plex+Mono:wght@400;600;700&display=swap');

/* ============================================================
   THEME: DARK (default)
   ============================================================ */
:root,
[data-theme="dark"] {
  --bg:         #0a0a0a;
  --bg2:        #161616;
  --bg3:        #1e1e1e;
  --bg4:        #2a2a2a;
  --border-col: #2a2a2a;
  --border-col2:#444;
  --text:       #f0ede6;
  --text2:      #aaa;
  --text3:      #666;
  --text4:      #444;
  --yellow:     #f5e642;
  --yellow2:    #ffe500;
  --red:        #e8271a;
  --green:      #1aff7a;
  --blue:       #4fc3f7;
  --shadow-y:   rgba(245,230,66,0.25);
  --noise-op:   0.4;
  --font-mono:  'IBM Plex Mono', monospace;
  --font-disp:  'Bebas Neue', cursive;
  --font-body:  'Space Mono', monospace;
  --t: all 0.12s ease;
}

/* ============================================================
   THEME: LIGHT
   ============================================================ */
[data-theme="light"] {
  --bg:         #f4f1e8;
  --bg2:        #e8e4d8;
  --bg3:        #ddd8c8;
  --bg4:        #ccc6b2;
  --border-col: #c4bfaf;
  --border-col2:#aaa598;
  --text:       #1a1a1a;
  --text2:      #444;
  --text3:      #888;
  --text4:      #bbb;
  --yellow:     #d4a800;
  --yellow2:    #c49a00;
  --red:        #cc2200;
  --green:      #008844;
  --blue:       #1565c0;
  --shadow-y:   rgba(180,140,0,0.25);
  --noise-op:   0.15;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}
a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); background: var(--bg3); padding: 2px 6px; font-size: 12px; }
strong { color: var(--text); }

.noise-overlay {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999;
  opacity: var(--noise-op);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--border-col);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 12px;
}
.logo-block { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-icon {
  font-size: 18px; background: var(--yellow); color: var(--bg);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; box-shadow: 3px 3px 0 var(--shadow-y);
  transition: var(--t);
}
.site-logo { font-family: var(--font-disp); font-size: 28px; color: var(--text); letter-spacing: 0.04em; }
.header-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link {
  font-family: var(--font-mono); font-size: 12px; color: var(--text3);
  padding: 6px 12px; border: 1px solid transparent; transition: var(--t);
  white-space: nowrap; position: relative;
}
.nav-link:hover { color: var(--text); border-color: var(--border-col2); text-decoration: none; }
.nav-link-domain {
  background: var(--yellow); color: var(--bg) !important;
  border: 2px solid var(--bg) !important; font-weight: 700;
  box-shadow: 3px 3px 0 var(--shadow-y);
}
.nav-link-domain:hover { background: var(--yellow2); transform: translate(-1px,-1px); text-decoration: none; }

/* NAV CONTROLS: lang + theme */
.nav-control {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--bg2); color: var(--text3);
  border: 1px solid var(--border-col); padding: 5px 10px;
  cursor: pointer; transition: var(--t); white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.nav-control:hover { color: var(--text); border-color: var(--border-col2); background: var(--bg3); text-decoration: none; }
.nav-control.sm { padding: 3px 7px; font-size: 10px; }
.nav-badge {
  position: absolute; top: 1px; right: 1px;
  background: var(--red); color: #fff; font-size: 9px; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ============================================================
   GENERATOR SECTION
   ============================================================ */
.generator-section { max-width: 780px; margin: 0 auto; padding: 44px 24px 28px; }
.generator-box {
  border: 2px solid var(--border-col2);
  background: var(--bg2);
  padding: 30px 34px 26px;
  box-shadow: 6px 6px 0 var(--shadow-y);
  transition: background 0.2s ease;
}
.gen-title-row { text-align: center; margin-bottom: 24px; }
.gen-title { font-family: var(--font-disp); font-size: 26px; color: var(--text); margin-bottom: 6px; }
.gen-subtitle { font-size: 12px; color: var(--text3); line-height: 1.7; }

/* EMAIL BAR */
.email-bar-wrap { display: flex; gap: 8px; margin-bottom: 8px; }
.email-bar {
  flex: 1; min-width: 0; display: flex; align-items: center;
  border: 2px solid var(--text); background: var(--bg);
  box-shadow: 4px 4px 0 var(--border-col2); transition: var(--t);
  overflow: hidden;
}
.email-bar:focus-within { border-color: var(--yellow); box-shadow: 4px 4px 0 var(--yellow); }
.email-bar-input {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--text);
  background: transparent; border: none; outline: none; padding: 11px 14px;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.email-bar-divider { width: 2px; height: 26px; background: var(--border-col2); flex-shrink: 0; }
.email-bar-domain-btn {
  background: transparent; border: none; color: var(--text3);
  font-size: 14px; padding: 0 12px; cursor: pointer; height: 100%;
  transition: var(--t); flex-shrink: 0;
}
.email-bar-domain-btn:hover { color: var(--yellow); }
.btn-copy {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  background: var(--green); color: var(--bg); border: 2px solid var(--bg);
  padding: 0 18px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2); transition: var(--t);
}
.btn-copy:hover { filter: brightness(1.1); transform: translate(-1px,-1px); }

/* DOMAIN DROPDOWN */
.domain-dropdown {
  border: 2px solid var(--yellow); background: var(--bg3);
  margin-bottom: 10px; box-shadow: 4px 4px 0 var(--shadow-y);
}
.domain-dropdown-header { font-family: var(--font-mono); font-size: 10px; color: var(--yellow); letter-spacing: 0.2em; padding: 7px 12px 3px; }
.domain-option {
  font-family: var(--font-mono); font-size: 13px; padding: 9px 12px;
  cursor: pointer; transition: var(--t); display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border-col);
}
.domain-option:hover { background: var(--bg4); color: var(--yellow); }
.domain-option.active { background: rgba(245,230,66,0.08); color: var(--yellow); }
.domain-check { color: var(--green); font-weight: 700; }

/* INBOX LINK */
.inbox-direct-link {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text4); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.inbox-link-url { color: var(--text3); }
.inbox-link-url:hover { color: var(--yellow); }

/* BUTTONS */
.gen-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.gen-btn {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  padding: 8px 16px; border: 2px solid; cursor: pointer; transition: var(--t);
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
.gen-btn.primary  { background: var(--yellow); color: var(--bg); border-color: var(--bg); box-shadow: 3px 3px 0 rgba(0,0,0,0.3); }
.gen-btn.primary:hover  { background: var(--yellow2); transform: translate(-1px,-1px); box-shadow: 4px 4px 0 rgba(0,0,0,0.3); text-decoration: none; }
.gen-btn.secondary{ background: transparent; color: var(--text); border-color: var(--text); box-shadow: 3px 3px 0 var(--border-col2); }
.gen-btn.secondary:hover{ background: var(--bg3); transform: translate(-1px,-1px); text-decoration: none; }
.gen-btn.ghost    { background: transparent; color: var(--text3); border-color: var(--border-col2); }
.gen-btn.ghost:hover    { color: var(--text); border-color: var(--border-col2); text-decoration: none; }
.gen-btn.danger   { background: transparent; color: var(--red); border-color: var(--red); }
.gen-btn.danger:hover   { background: var(--red); color: #fff; text-decoration: none; }
.gen-btn.lg { font-size: 14px; padding: 12px 22px; }
.gen-btn.sm { font-size: 11px; padding: 5px 10px; }
.gen-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* STATUS BAR */
.gen-status-bar {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text4);
  padding-top: 12px; border-top: 1px solid var(--border-col);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }
.status-timer { margin-left: auto; color: var(--text4); }

/* ============================================================
   INBOX PREVIEW
   ============================================================ */
.inbox-preview-section { max-width: 780px; margin: 0 auto; padding: 0 24px 44px; }
.inbox-preview-wrap { border: 2px solid var(--border-col); background: var(--bg2); }
.inbox-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 2px solid var(--border-col);
  background: var(--bg3); flex-wrap: wrap; gap: 8px;
}
.inbox-preview-title { font-family: var(--font-mono); font-size: 12px; color: var(--text3); }
.inbox-preview-title span { color: var(--yellow); }
.inbox-preview-actions { display: flex; align-items: center; gap: 12px; }
.inbox-msg-count { font-family: var(--font-mono); font-size: 11px; color: var(--text4); }
.btn-open-full { font-family: var(--font-mono); font-size: 12px; color: var(--yellow); font-weight: 700; }
.inbox-message-list { min-height: 110px; }
.inbox-empty { padding: 36px 20px; text-align: center; color: var(--text4); }
.inbox-empty-icon { font-size: 38px; margin-bottom: 10px; opacity: 0.5; }
.inbox-empty-title { font-family: var(--font-disp); font-size: 20px; margin-bottom: 8px; color: var(--text3); }
.inbox-empty-sub { font-size: 12px; color: var(--text4); line-height: 1.7; }
.inbox-empty-sub strong { color: var(--text3); }

/* INLINE MESSAGE ITEMS */
.inbox-msg-item {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  padding: 11px 16px; border-bottom: 1px solid var(--border-col);
  cursor: pointer; transition: var(--t); gap: 2px 10px;
}
.inbox-msg-item:hover { background: var(--bg3); }
.inbox-msg-item.unread { border-left: 3px solid var(--green); }
.inbox-msg-item.unread .msg-item-subject { color: var(--text); font-weight: 700; }
.msg-item-from { font-family: var(--font-mono); font-size: 11px; color: var(--yellow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item-time { font-family: var(--font-mono); font-size: 10px; color: var(--text4); grid-row: 1; grid-column: 2; white-space: nowrap; align-self: center; }
.msg-item-subject { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 1; }
.msg-item-preview { font-size: 11px; color: var(--text4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 1 / -1; }
.msg-item-new { display: inline-block; background: var(--green); color: var(--bg); font-size: 9px; font-weight: 700; padding: 1px 5px; margin-left: 5px; }

/* ============================================================
   INFO SECTION
   ============================================================ */
.info-section { border-top: 2px solid var(--border-col); padding: 44px 24px; }
.info-inner { max-width: 780px; margin: 0 auto; display: grid; gap: 36px; }
.info-heading {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--text4); letter-spacing: 0.15em; text-transform: uppercase;
  border-bottom: 1px solid var(--border-col); padding-bottom: 8px; margin-bottom: 14px;
}
.info-block p { font-size: 13px; color: var(--text3); line-height: 1.8; margin-bottom: 8px; }
.info-block p strong { color: var(--text); }
.info-code-block { background: var(--bg3); border: 1px solid var(--border-col); padding: 9px 13px; margin: 6px 0; }
.info-code-block code { background: none; font-size: 13px; color: var(--green); }
.usecases-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.usecase { font-family: var(--font-mono); font-size: 11px; color: var(--text4); padding: 5px 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 2px solid var(--border-col); padding: 18px 24px; background: var(--bg2); }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-left { display: flex; align-items: center; gap: 10px; }
.footer-logo { font-family: var(--font-disp); font-size: 20px; color: var(--text4); }
.footer-sep { color: var(--border-col2); }
.footer-tagline { font-family: var(--font-mono); font-size: 11px; color: var(--text4); }
.footer-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-note { font-family: var(--font-mono); font-size: 10px; color: var(--text4); }
.footer-link { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.footer-link:hover { color: var(--yellow); }

/* ============================================================
   MESSAGE MODAL
   ============================================================ */
.msg-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.msg-modal-box {
  background: var(--bg2); border: 2px solid var(--text);
  box-shadow: 8px 8px 0 var(--shadow-y);
  width: 100%; max-width: 760px; max-height: 88vh;
  display: flex; flex-direction: column; animation: modalIn 0.15s ease;
}
@keyframes modalIn { from{transform:translateY(14px) scale(0.98);opacity:0} to{transform:none;opacity:1} }
.msg-modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 18px 12px; border-bottom: 2px solid var(--border-col); background: var(--bg3); gap: 10px; }
.msg-modal-subject { font-family: var(--font-disp); font-size: 24px; line-height: 1.1; flex: 1; }
.msg-modal-close { background: none; border: 1px solid var(--border-col2); color: var(--text3); font-size: 14px; cursor: pointer; padding: 4px 8px; transition: var(--t); flex-shrink: 0; }
.msg-modal-close:hover { border-color: var(--red); color: var(--red); }
.msg-modal-meta { display: flex; gap: 18px; flex-wrap: wrap; padding: 9px 18px; font-family: var(--font-mono); font-size: 12px; color: var(--text3); border-bottom: 2px solid var(--border-col); background: var(--bg3); }
.msg-modal-tabs { display: flex; border-bottom: 2px solid var(--border-col); flex-shrink: 0; }
.msg-tab { font-family: var(--font-mono); font-size: 11px; padding: 8px 14px; border: none; background: transparent; color: var(--text3); cursor: pointer; border-right: 1px solid var(--border-col); transition: var(--t); }
.msg-tab:hover { color: var(--text); }
.msg-tab.active { color: var(--yellow); background: var(--bg3); border-bottom: 2px solid var(--yellow); }
.msg-modal-body { flex: 1; overflow-y: auto; padding: 18px; font-size: 14px; color: var(--text); line-height: 1.8; }
.msg-modal-body::-webkit-scrollbar { width: 4px; }
.msg-modal-body::-webkit-scrollbar-thumb { background: var(--border-col2); }
.msg-modal-body-text { flex: 1; overflow-y: auto; padding: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--text3); white-space: pre-wrap; word-break: break-word; }
.msg-modal-footer { padding: 10px 18px; border-top: 2px solid var(--border-col); display: flex; justify-content: flex-end; background: var(--bg3); }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 6px; }
.toast { background: var(--yellow); color: var(--bg); border: 2px solid var(--bg); box-shadow: 3px 3px 0 rgba(0,0,0,0.3); padding: 10px 16px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; max-width: 300px; animation: slideIn 0.18s ease; }
.toast.error { background: var(--red); color: #fff; border-color: #fff; }
.toast.info { background: var(--bg3); color: var(--text); border-color: var(--border-col2); }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:none;opacity:1} }

/* ============================================================
   SHARED FORM INPUT
   ============================================================ */
.brutal-input {
  font-family: var(--font-mono); font-size: 14px;
  background: var(--bg); color: var(--text);
  border: 2px solid var(--border-col2);
  padding: 10px 13px; outline: none; width: 100%; transition: var(--t);
}
.brutal-input:focus { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.brutal-input.lg { font-size: 15px; padding: 11px 14px; }

/* ============================================================
   INBOX FULL PAGE
   ============================================================ */
body.inbox-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.inbox-header { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 2px solid var(--text); background: var(--bg); flex-shrink: 0; flex-wrap: wrap; }
.back-btn { font-family: var(--font-mono); font-size: 11px; color: var(--text3); border: 1px solid var(--border-col2); padding: 5px 10px; transition: var(--t); white-space: nowrap; }
.back-btn:hover { color: var(--text); border-color: var(--text); text-decoration: none; }
.inbox-email-display { flex: 1; min-width: 0; }
.inbox-badge { font-family: var(--font-mono); font-size: 9px; color: var(--green); letter-spacing: 0.2em; display: block; margin-bottom: 1px; }
.inbox-address { font-family: var(--font-mono); font-size: clamp(12px,1.8vw,16px); font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.inbox-address:hover { color: var(--yellow); }
.inbox-actions { display: flex; gap: 5px; flex-wrap: wrap; flex-shrink: 0; }
.live-banner { display: flex; align-items: center; gap: 10px; padding: 5px 18px; background: var(--bg2); border-bottom: 1px solid var(--border-col); font-family: var(--font-mono); font-size: 11px; color: var(--text3); flex-shrink: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
.msg-count-badge { margin-left: auto; color: var(--yellow); font-weight: 700; }
.inbox-layout { display: grid; grid-template-columns: 320px 1fr; flex: 1; overflow: hidden; min-height: 0; }
.message-list-panel { border-right: 2px solid var(--text); display: flex; flex-direction: column; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--border-col); flex-shrink: 0; }
.panel-title { font-family: var(--font-mono); font-size: 9px; color: var(--yellow); letter-spacing: 0.2em; }
.message-list { flex: 1; overflow-y: auto; }
.message-list::-webkit-scrollbar { width: 4px; }
.message-list::-webkit-scrollbar-thumb { background: var(--border-col2); }
.message-item { padding: 10px 12px; border-bottom: 1px solid var(--border-col); cursor: pointer; transition: var(--t); position: relative; }
.message-item:hover { background: var(--bg3); }
.message-item.active { background: var(--bg3); border-left: 3px solid var(--yellow); }
.message-item.unread { border-left: 3px solid var(--green); }
.message-item.unread .msg-item-subject { color: var(--text); font-weight: 700; }
.empty-state { padding: 30px 14px; text-align: center; color: var(--text4); }
.empty-icon { font-size: 34px; margin-bottom: 10px; opacity: 0.4; }
.empty-title { font-family: var(--font-disp); font-size: 20px; color: var(--text3); margin-bottom: 6px; }
.empty-sub { font-size: 11px; color: var(--text4); line-height: 1.7; }
.empty-sub strong { color: var(--text3); }
.message-view-panel { display: flex; flex-direction: column; overflow: hidden; }
.message-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--border-col2); gap: 8px; }
.placeholder-icon { font-size: 52px; }
.placeholder-text { font-family: var(--font-disp); font-size: 28px; }
.message-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.msg-header-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--border-col); flex-shrink: 0; flex-wrap: wrap; }
.msg-subject { font-family: var(--font-disp); font-size: 24px; color: var(--text); margin-bottom: 6px; line-height: 1.1; }
.meta-label { font-size: 9px; color: var(--text4); letter-spacing: 0.15em; }
.msg-from,.msg-date { font-family: var(--font-mono); font-size: 11px; margin-bottom: 3px; color: var(--text3); }
.msg-body-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.msg-body-tabs { display: flex; border-bottom: 1px solid var(--border-col); flex-shrink: 0; }
.tab-btn { font-family: var(--font-mono); font-size: 10px; padding: 8px 12px; border: none; background: transparent; color: var(--text3); cursor: pointer; border-right: 1px solid var(--border-col); transition: var(--t); }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--yellow); background: var(--bg3); border-bottom: 2px solid var(--yellow); }
.msg-body { flex: 1; overflow-y: auto; padding: 18px; color: var(--text); font-size: 14px; line-height: 1.8; }
.msg-body::-webkit-scrollbar { width: 4px; }
.msg-body::-webkit-scrollbar-thumb { background: var(--border-col2); }
.msg-body-text { flex: 1; overflow-y: auto; padding: 18px; color: var(--text3); font-family: var(--font-mono); font-size: 12px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }

/* ============================================================
   DOMAIN PAGE
   ============================================================ */
.domain-page { max-width: 860px; margin: 0 auto; padding: 0 24px 60px; }
.domain-page-header { border: 2px solid var(--text); background: var(--bg2); margin: 28px 0; box-shadow: 6px 6px 0 var(--shadow-y); }
.domain-page-header-inner { padding: 32px 36px; }
.domain-page-eyebrow { font-family: var(--font-mono); font-size: 10px; color: var(--yellow); letter-spacing: 0.2em; margin-bottom: 10px; }
.domain-page-title { font-family: var(--font-disp); font-size: clamp(36px,5vw,64px); line-height: 0.95; margin-bottom: 14px; white-space: pre-line; }
.domain-page-desc { font-size: 13px; color: var(--text3); line-height: 1.7; }

/* WIZARD */
.domain-wizard { border: 2px solid var(--border-col); background: var(--bg2); margin-bottom: 36px; }
.wizard-progress { display: flex; align-items: center; padding: 18px 24px; border-bottom: 2px solid var(--border-col); background: var(--bg3); }
.wp-step { display: flex; align-items: center; gap: 8px; opacity: 0.35; transition: var(--t); }
.wp-step.active { opacity: 1; }
.wp-step.done { opacity: 0.65; }
.wp-circle { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-col2); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; flex-shrink: 0; transition: var(--t); }
.wp-step.active .wp-circle { border-color: var(--yellow); background: var(--yellow); color: var(--bg); }
.wp-step.done .wp-circle { border-color: var(--green); background: var(--green); color: var(--bg); }
.wp-step.done .wp-circle::after { content: '✓'; }
.wp-label { font-family: var(--font-mono); font-size: 11px; color: var(--text3); white-space: nowrap; }
.wp-step.active .wp-label { color: var(--yellow); }
.wp-line { flex: 1; height: 1px; background: var(--border-col); margin: 0 8px; }
.wizard-panel { padding: 28px 28px 24px; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.wizard-panel-title { font-family: var(--font-disp); font-size: 26px; margin-bottom: 8px; }
.wizard-panel-desc { font-size: 13px; color: var(--text3); line-height: 1.7; margin-bottom: 20px; }
.wizard-field { margin-bottom: 18px; }
.wiz-label { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 7px; letter-spacing: 0.05em; }
.wiz-hint { font-size: 11px; color: var(--text4); margin-top: 6px; }
.wiz-error { font-family: var(--font-mono); font-size: 12px; color: var(--red); margin-top: 8px; }
.wizard-actions { display: flex; gap: 10px; margin-top: 22px; }
.wizard-actions.two { justify-content: space-between; }
.wiz-detected-domain { font-family: var(--font-mono); font-size: 13px; background: rgba(245,230,66,0.07); border: 1px solid rgba(245,230,66,0.25); padding: 9px 13px; margin-bottom: 16px; color: var(--text3); }
.wiz-detected-domain strong { color: var(--yellow); font-size: 15px; }
.dns-instructions-card { border: 2px solid var(--border-col); margin-bottom: 18px; overflow: auto; }
.dns-card-title { font-family: var(--font-mono); font-size: 10px; color: var(--yellow); letter-spacing: 0.15em; padding: 9px 12px; background: var(--bg3); border-bottom: 1px solid var(--border-col); }
.dns-table-full { width: 100%; border-collapse: collapse; }
.dns-table-full th { font-family: var(--font-mono); font-size: 10px; color: var(--text4); padding: 7px 12px; text-align: left; background: var(--bg); border-bottom: 1px solid var(--border-col); letter-spacing: 0.1em; }
.dns-table-full td { padding: 9px 12px; font-size: 12px; border-bottom: 1px solid var(--border-col); vertical-align: middle; color: var(--text); }
.dns-table-full tr:last-child td { border-bottom: none; }
.dns-table-full tr:hover td { background: var(--bg3); }
.dns-row-highlight td { background: rgba(245,230,66,0.04) !important; }
.dns-field-name { font-family: var(--font-mono); font-size: 11px; color: var(--text3); white-space: nowrap; }
.dns-note { font-size: 11px; color: var(--text4); }
.dns-badge-lg { display: inline-block; background: var(--yellow); color: var(--bg); font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 2px 8px; }
.dns-val-green { color: var(--green) !important; font-weight: 700; font-family: var(--font-mono); }
.dns-copy-row { display: flex; align-items: center; gap: 10px; }
.dns-copy-btn { background: none; border: 1px solid var(--border-col2); color: var(--text3); font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; cursor: pointer; transition: var(--t); }
.dns-copy-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.dns-warning-card { display: flex; gap: 12px; background: rgba(245,230,66,0.05); border: 1px solid rgba(245,230,66,0.2); padding: 14px; margin-bottom: 4px; font-size: 13px; color: var(--text3); line-height: 1.6; }
.dwc-icon { font-size: 20px; flex-shrink: 0; }
.dns-warning-card strong { color: var(--yellow); }
.wiz-confirm-card { border: 2px solid var(--border-col); background: var(--bg); margin-bottom: 14px; }
.wiz-confirm-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--border-col); gap: 10px; }
.wiz-confirm-row:last-child { border-bottom: none; }
.wiz-confirm-label { font-family: var(--font-mono); font-size: 11px; color: var(--text4); }
.wiz-confirm-val { font-family: var(--font-mono); font-size: 13px; }
.wiz-confirm-val.green { color: var(--green); }
.wiz-reg-error { margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--red); }
.wiz-success { text-align: center; padding: 14px 0; }
.wiz-success-icon { font-size: 52px; margin-bottom: 14px; }
.wiz-success-title { font-family: var(--font-disp); font-size: 36px; color: var(--green); margin-bottom: 8px; }
.wiz-success-sub { font-size: 14px; color: var(--text3); margin-bottom: 20px; }
.wiz-success-details { border: 1px solid rgba(26,255,122,0.2); background: rgba(26,255,122,0.04); padding: 14px; margin-bottom: 18px; text-align: left; }
.wiz-success-row { display: flex; justify-content: space-between; padding: 7px 0; font-family: var(--font-mono); font-size: 12px; color: var(--text3); border-bottom: 1px solid var(--border-col); }
.wiz-success-row:last-child { border-bottom: none; }
.wiz-success-row .green { color: var(--green); }
.wiz-success-tip { font-size: 13px; color: var(--text3); line-height: 1.7; margin-bottom: 22px; background: var(--bg3); border: 1px solid var(--border-col); padding: 12px 14px; text-align: left; }
.wiz-success-tip code { background: none; color: var(--yellow); }
.wiz-success-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.domain-faq { border: 2px solid var(--border-col); }
.faq-title { font-family: var(--font-disp); font-size: 26px; padding: 18px 22px; border-bottom: 2px solid var(--border-col); background: var(--bg3); }
.faq-item { border-bottom: 1px solid var(--border-col); }
.faq-item:last-child { border-bottom: none; }
.faq-q { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; cursor: pointer; transition: var(--t); font-size: 13px; gap: 10px; }
.faq-q:hover { background: var(--bg3); color: var(--yellow); }
.faq-arrow { flex-shrink: 0; color: var(--yellow); transition: transform 0.15s; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 22px 14px; font-size: 13px; color: var(--text3); line-height: 1.8; }
.faq-item.open .faq-a { display: block; }

/* ============================================================
   RESPONSIVE — Mobile First
   ============================================================ */

/* ---- TABLET (max 900px) ---- */
@media (max-width: 900px) {
  .generator-section { padding: 28px 16px 20px; }
  .inbox-preview-section { padding: 0 16px 32px; }
  .info-section { padding: 32px 16px; }
}

/* ---- MOBILE (max 600px) ---- */
@media (max-width: 600px) {

  /* === HEADER === */
  .site-header { position: sticky; top: 0; z-index: 200; }
  .header-inner {
    padding: 0 12px;
    height: auto;
    min-height: 52px;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .logo-icon { width: 30px; height: 30px; font-size: 15px; }
  .site-logo { font-size: 20px; }

  /* Hide regular inbox nav link on mobile */
  .nav-link:not(.nav-link-domain) { display: none; }

  /* Domain button — shorter on mobile */
  .nav-link-domain {
    font-size: 11px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  /* Theme + lang controls */
  .nav-control { padding: 5px 8px; font-size: 10px; }

  /* === GENERATOR BOX === */
  .generator-section { padding: 16px 12px 14px; }
  .generator-box {
    padding: 18px 14px 16px;
    box-shadow: 4px 4px 0 var(--shadow-y);
  }
  .gen-title { font-size: 20px; margin-bottom: 4px; }
  .gen-subtitle { font-size: 11px; }
  .gen-title-row { margin-bottom: 16px; }

  /* === EMAIL INPUT BAR === */
  .email-bar-wrap { gap: 6px; margin-bottom: 6px; }
  .email-bar { min-width: 0; }
  .email-bar-input {
    font-size: 12px;
    padding: 10px 10px;
    /* Ellipsis for long emails */
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }
  .email-bar-domain-btn { padding: 0 8px; font-size: 13px; }
  .btn-copy {
    font-size: 12px;
    padding: 0 14px;
    gap: 5px;
    flex-shrink: 0;
  }
  .copy-icon { font-size: 14px; }

  /* === INBOX DIRECT LINK === */
  .inbox-direct-link {
    font-size: 10px;
    margin-bottom: 12px;
    word-break: break-all;
    flex-direction: column;
    gap: 3px;
  }

  /* === ACTION BUTTONS === */
  .gen-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
  }
  .gen-btn { font-size: 11px; padding: 9px 8px; justify-content: center; gap: 4px; }
  .gen-btn.primary { grid-column: 1 / -1; font-size: 13px; padding: 11px 10px; }
  .gen-btn.secondary { }
  .gen-btn.ghost { }

  /* === STATUS BAR === */
  .gen-status-bar {
    font-size: 10px;
    padding-top: 10px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .status-timer { margin-left: 0; font-size: 9px; }

  /* === EMAIL STATUS PILL === */
  .email-status-bar { padding: 8px 10px; }
  .email-status-pill { font-size: 11px; padding: 4px 10px; }

  /* === INBOX PREVIEW === */
  .inbox-preview-section { padding: 0 12px 24px; }
  .inbox-preview-header {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .inbox-preview-title { font-size: 11px; }
  .inbox-preview-title span { word-break: break-all; }
  .inbox-preview-actions { align-self: flex-end; }
  .inbox-msg-item { padding: 10px 12px; }
  .msg-item-from { font-size: 10px; }
  .msg-item-subject { font-size: 11px; }
  .msg-item-preview { font-size: 10px; }
  .msg-item-time { font-size: 9px; }

  /* === INBOX EMPTY STATE === */
  .inbox-empty { padding: 24px 16px; }
  .inbox-empty-icon { font-size: 32px; }
  .inbox-empty-title { font-size: 18px; }
  .inbox-empty-sub { font-size: 11px; }

  /* === INFO SECTION === */
  .info-section { padding: 24px 12px; }
  .info-heading { font-size: 10px; }
  .info-block p { font-size: 12px; }
  .usecases-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .usecase { font-size: 10px; }

  /* === FOOTER === */
  .site-footer { padding: 14px 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-right { gap: 10px; }
  .footer-note { display: none; }

  /* === FULL INBOX PAGE === */
  .inbox-header {
    padding: 8px 12px;
    gap: 6px;
  }
  .back-btn { font-size: 10px; padding: 4px 8px; }
  .inbox-badge { font-size: 8px; }
  .inbox-address { font-size: 12px; }
  .inbox-actions { gap: 4px; }
  .inbox-actions .gen-btn.sm { font-size: 10px; padding: 4px 8px; }
  .live-banner { padding: 5px 12px; font-size: 10px; gap: 6px; flex-wrap: wrap; }
  .live-banner strong { word-break: break-all; }
  .inbox-layout { grid-template-columns: 1fr; }
  .message-list-panel {
    border-right: none;
    border-bottom: 2px solid var(--text);
    max-height: 42vh;
  }
  .panel-header { padding: 7px 10px; }
  .message-item { padding: 10px 10px; }
  .msg-item-from { font-size: 10px; }
  .msg-item-subject { font-size: 11px; }
  .msg-item-time { font-size: 9px; }
  .placeholder-icon { font-size: 40px; }
  .placeholder-text { font-size: 22px; }
  .msg-header-bar { padding: 12px 14px; }
  .msg-subject { font-size: 18px; }
  .msg-body { padding: 14px; font-size: 13px; }
  .msg-body-text { padding: 14px; font-size: 11px; }
  .tab-btn { font-size: 9px; padding: 7px 10px; }

  /* === MESSAGE MODAL === */
  .msg-modal-box { max-height: 92vh; }
  .msg-modal-subject { font-size: 18px; }
  .msg-modal-meta { font-size: 11px; padding: 8px 14px; gap: 10px; }
  .msg-modal-body { padding: 14px; font-size: 13px; }
  .msg-modal-body-text { padding: 14px; font-size: 11px; }
  .msg-tab { font-size: 10px; padding: 7px 10px; }

  /* === DOMAIN PAGE === */
  .domain-page { padding: 0 12px 40px; }
  .domain-page-header-inner { padding: 20px 16px; }
  .domain-page-title { font-size: 36px; }
  .wizard-panel { padding: 16px 14px; }
  .wizard-panel-title { font-size: 20px; }
  .wizard-progress { padding: 10px 10px; gap: 4px; }
  .wp-label { display: none; }
  .wp-line { margin: 0 4px; }
  .wp-circle { width: 24px; height: 24px; font-size: 11px; }
  .wizard-actions { flex-direction: column; gap: 8px; }
  .wizard-actions.two { flex-direction: row; }
  .wiz-confirmed-card { padding: 10px; }
  .dns-table-full th, .dns-table-full td { padding: 7px 8px; font-size: 11px; }
  .dns-copy-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .faq-q { padding: 12px 14px; font-size: 12px; }
  .faq-a { padding: 0 14px 12px; font-size: 12px; }
  .faq-title { font-size: 20px; padding: 14px 16px; }
}

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border-col2) var(--bg); }

/* ============================================================
   EMAIL STATUS — Approved / Not Supported
   ============================================================ */
.email-status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-col);
  margin-top: 2px;
  font-family: var(--font-mono); font-size: 12px;
}

.email-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  padding: 4px 12px;
  border-radius: 0;
  border: 2px solid;
  transition: var(--t);
}

.email-status-pill.approved {
  background: rgba(26,255,122,0.1);
  color: var(--green);
  border-color: var(--green);
}

.email-status-pill.not-supported {
  background: rgba(232,39,26,0.1);
  color: var(--red);
  border-color: var(--red);
}

.email-status-pill.checking {
  background: rgba(245,230,66,0.08);
  color: var(--yellow);
  border-color: var(--yellow);
}

/* Live banner status */
.live-banner-status { margin-left: auto; }

/* MX Validation box on domain page */
.mx-validation-box {
  background: var(--bg3);
  border: 2px solid var(--border-col);
  padding: 16px 20px;
  margin: 16px 0;
  text-align: left;
}

.mx-val-checking {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; color: var(--text3);
}

.mx-spinner {
  animation: spin 1.5s linear infinite;
  display: inline-block;
  font-size: 18px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.mx-val-result { }

/* ============================================================
   LANGUAGE SWITCH LINK — fix active state
   ============================================================ */
.nav-lang {
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Ensure lang link is always visible */
.header-nav .nav-lang {
  display: inline-flex !important;
}

/* ============================================================
   EXTRA MOBILE — very small screens (max 380px)
   ============================================================ */
@media (max-width: 380px) {
  .site-logo { font-size: 18px; }
  .nav-link-domain { font-size: 10px; padding: 6px 8px; }
  .email-bar-input { font-size: 11px; padding: 9px 8px; }
  .btn-copy { padding: 0 10px; }
  .copy-label { display: none; } /* show only icon on tiny screens */
  .gen-btn { font-size: 10px; padding: 8px 6px; }
  .email-status-pill { font-size: 10px; padding: 3px 8px; }
}

/* Touch devices — larger tap targets */
@media (hover: none) and (pointer: coarse) {
  .gen-btn { min-height: 44px; }
  .btn-copy { min-height: 44px; }
  .nav-link-domain { min-height: 36px; }
  .domain-option { min-height: 44px; }
  .message-item { min-height: 56px; }
  .inbox-msg-item { min-height: 56px; }
  .faq-q { min-height: 48px; }
}

/* ============================================================
   CUSTOM DOMAIN HINT
   ============================================================ */
.custom-domain-hint {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text3);
  background: rgba(79,195,247,0.06);
  border: 1px solid rgba(79,195,247,0.25);
  padding: 8px 12px;
  margin-bottom: 12px;
}
.cdh-icon { flex-shrink: 0; }
.cdh-check-link { color: var(--blue); text-decoration: underline; }
.cdh-check-link:hover { color: var(--yellow); }

@media (max-width: 600px) {
  .custom-domain-hint { font-size: 10px; padding: 6px 10px; }
}
