/* doublezero-mail UI — same editorial system as the landing page */

:root {
  --bg: #ffffff;
  --ink: #0a0c10;
  --ink-2: #2a2f37;
  --muted: #6c7280;
  --line: #e6e8ec;
  --accent: #2962ff;       /* sky-blue tech accent (same family as landing) */
  --accent-fade: #e5edff;
  --red: #d92d20;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 12px 32px -16px rgba(10,12,16,.18);
  --radius: 8px;
  font-family: 'Helvetica Neue', Helvetica, 'Apple SD Gothic Neo', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'kern', 'liga';
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

[hidden] { display: none !important; }

#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* When logged out, drop the sidebar and let the login fill the screen. */
body[data-auth="out"] #app { grid-template-columns: 1fr; }
body[data-auth="out"] .sidebar { display: none; }
body[data-auth="out"] .content { max-width: none; padding: 0; }
body[data-auth="out"] .login-gate { min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.brand-mark.big { width: 64px; height: 64px; }
.brand-word {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}

.compose-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
}
.compose-btn:hover { background: var(--accent); }
.compose-btn span:first-child { font-size: 16px; line-height: 1; }

.tabs { display: flex; flex-direction: column; gap: 2px; }
.tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  text-align: left;
  color: var(--ink-2);
  font-size: 13px;
}
.tab:hover { background: var(--accent-fade); }
.tab.active { background: var(--ink); color: var(--bg); font-weight: 600; }
.tab.active .badge { background: var(--bg); color: var(--ink); }
.badge {
  background: var(--accent-fade);
  color: var(--accent);
  font-weight: 600;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}

.account-block {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.account-block .name { color: var(--ink); font-weight: 600; }
.account-block .addr { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--accent); font-size: 11px; }

/* ── Content ─────────────────────────────────────────────────────── */
.content { padding: 24px 32px; max-width: 980px; }

h1, h2 { letter-spacing: -0.02em; margin: 0 0 16px; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }

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

/* Login */
.login-gate { display: grid; place-items: center; min-height: 80vh; }
.login-box {
  width: 360px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  text-align: center;
}
.login-box .brand-mark { margin: 0 auto 8px; }
.login-box input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}
.login-box input:focus { outline: 2px solid var(--accent); border-color: var(--accent); background: #fff; }
.email-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
  overflow: hidden;
}
.email-field:focus-within { outline: 2px solid var(--accent); border-color: var(--accent); background: #fff; }
.email-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 4px 10px 12px;
  font-family: inherit;
}
.email-field input:focus { outline: none; background: transparent; border: none; }
.login-error {
  margin: 4px 0 0;
  padding: 8px 10px;
  background: #fdecec;
  color: var(--red);
  border-radius: 6px;
  text-align: left;
}
.email-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px 0 2px;
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
}
.login-box button {
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-weight: 600;
}

/* List */
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.filters { display: flex; gap: 8px; }
.filters input, .filters select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
  font-size: 13px;
}

.list { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 24px 200px 1fr 80px;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  cursor: pointer;
  font-size: 13px;
}
.row { position: relative; }
.row:hover { background: var(--accent-fade); }
.row.cursor { background: var(--accent-fade); box-shadow: inset 3px 0 0 var(--accent); }
.row.unread { font-weight: 600; }

/* Hover quick-action buttons (compose-to / reply / trash) */
.row-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  gap: 4px;
  background: var(--bg);
  padding: 3px 4px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px -4px rgba(10,12,16,.12);
}
.row:hover .row-actions { display: flex; }
.row-action {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-2);
}
.row-action:hover { background: var(--accent); color: white; border-color: var(--accent); }
.row .star { font-size: 14px; color: var(--line); }
.row .star.on { color: #f5a524; }
.row .from { color: var(--ink); }
.row .subject { color: var(--ink-2); }
.row .subject .preview { color: var(--muted); margin-left: 6px; }
.row .date { color: var(--muted); font-size: 12px; text-align: right; }

.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 18px 0 8px;
}
.pager .pg-num,
.pager .pg-nav {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.pager .pg-num:hover:not(.on),
.pager .pg-nav:hover:not([disabled]) { background: var(--accent-fade); border-color: var(--accent-fade); }
.pager .pg-num.on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  font-weight: 600;
  cursor: default;
}
.pager .pg-nav[disabled] { opacity: .35; cursor: default; }
.pager .pg-gap { color: var(--muted); padding: 0 2px; user-select: none; }
.pager .pg-count { margin-left: 10px; color: var(--muted); font-size: 12px; }

/* Detail */
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.detail-actions { display: flex; gap: 8px; }
.detail h2 { margin: 0 0 8px; font-size: 22px; }
.detail .meta { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.detail .meta .dot { margin: 0 6px; }
.detail .body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 16px 0;
}
.detail .body:has(iframe) { white-space: normal; padding: 0; }
.detail .body iframe.body-frame {
  width: 100%;
  min-height: 300px;
  border: 0;
  display: block;
  background: #fff;
}
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.atts a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
}
.atts a:hover { border-color: var(--accent); color: var(--accent); }

/* AI reply-draft banner (biz@ 고객센터 auto-reply) */
.ai-draft {
  margin: 14px 0;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-fade), #fff);
  padding: 14px 16px;
}
.ai-draft-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-draft-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
}
.ai-draft-note { font-size: 12px; color: var(--muted); }
.ai-draft-body {
  margin: 10px 0 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  max-height: 320px;
  overflow-y: auto;
  white-space: normal;
}
.ai-draft-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.draft-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-fade);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: middle;
}
.replied-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: #1a7f4b;
  background: #e6f6ec;
  border: 1px solid #b7e3c6;
  border-radius: 4px;
  padding: 0 6px;
  margin-right: 6px;
  vertical-align: middle;
}

/* AI 초안 검토 탭 */
.drafts-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.draft-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.drafts-help { margin: 4px 0 14px; }
.drafts-list { display: flex; flex-direction: column; gap: 12px; }
.draft-card {
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.draft-card:hover { border-color: var(--accent); }
.draft-check { padding-top: 2px; }
.draft-check input { width: 18px; height: 18px; cursor: pointer; }
.draft-main { flex: 1; min-width: 0; }
.draft-metaline { font-size: 13px; color: var(--ink); }
.draft-subj { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 2px 0 8px; }
.draft-orig { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.draft-orig > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px; list-style: none; }
.draft-orig > summary::-webkit-details-marker { display: none; }
.draft-orig > summary::before { content: '▸ '; }
.draft-orig[open] > summary::before { content: '▾ '; }
.draft-orig-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  padding: 0 12px 12px;
  max-height: 200px;
  overflow-y: auto;
  white-space: normal;
}
.draft-quote-note { margin-top: 8px; font-size: 11px; color: var(--muted); font-style: italic; }
.draft-reply-label { font-size: 11px; font-weight: 700; color: var(--accent); margin: 0 0 5px; }
.draft-edit-hint { font-weight: 500; color: var(--muted); }
.draft-edit {
  width: 100%;
  box-sizing: border-box;
  font: 13px/1.7 inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 90px;
  overflow-y: auto;
}
.draft-edit:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.draft-save-state { margin-right: auto; align-self: center; }
.draft-preview {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--accent-fade);
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 220px;
  overflow-y: auto;
}
.draft-card-actions { display: flex; gap: 8px; margin-top: 10px; }
button.small, .ghost.small { font-size: 12px; padding: 5px 10px; }

/* 대화 스레드 (메일 상세 하단) */
.thread { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; }
.thread-head { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; }
.thread-item { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.thread-item.current { border-color: var(--accent); background: var(--accent-fade); }
.thread-item > summary {
  cursor: pointer; list-style: none; padding: 9px 12px; font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.thread-item > summary::-webkit-details-marker { display: none; }
.thread-dir { font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }
.thread-dir.in { color: #1a7f4b; background: #e6f6ec; }
.thread-dir.out { color: var(--accent); background: #fff; border: 1px solid var(--accent); }
.thread-date { font-size: 11px; color: var(--muted); }
.thread-prev { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-body {
  font-size: 13px; line-height: 1.7; color: var(--ink);
  padding: 0 12px 12px; white-space: normal;
}

/* Compose */
.compose-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.compose { display: flex; flex-direction: column; gap: 14px; }
.compose label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.compose label.readonly { color: var(--muted); }
.compose input, .compose textarea, .compose select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
  font-size: 13px;
  color: var(--ink);
}
.compose input:focus, .compose textarea:focus, .compose select:focus { outline: 2px solid var(--accent); border-color: var(--accent); background: #fff; }
.compose select[data-input="from"] { max-width: 320px; }
.compose textarea { font-family: inherit; resize: vertical; }
/* Compose — field blocks (rich editor + attachments) */
.field-block { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; color: var(--muted); }

/* ── Multi-recipient chips (To / CC / BCC) ─────────────────────────── */
.addr-block { position: relative; gap: 4px; }
.addr-head { display: flex; justify-content: space-between; align-items: center; }
.addr-toggles { display: flex; gap: 12px; }
.addr-toggle {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  color: var(--accent);
}
.addr-toggle:hover { text-decoration: underline; }
.addr-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
  min-height: 41px;
  cursor: text;
}
.addr-field:focus-within {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
  background: #fff;
}
.compose .addr-field input.addr-input {
  flex: 1;
  min-width: 180px;
  border: 0;
  background: transparent;
  padding: 4px 2px;
}
.compose .addr-field input.addr-input:focus { outline: none; background: transparent; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px 3px 10px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: var(--accent-fade);
  color: var(--ink);
  font-size: 12.5px;
}
.chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.invalid { background: #fdeceb; border-color: var(--red); color: var(--red); }
.chip-x {
  border: 0;
  background: none;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  opacity: .55;
}
.chip-x:hover { opacity: 1; }
.addr-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.suggest-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
}
.suggest-item:hover, .suggest-item.active { background: var(--accent-fade); }
.suggest-item .s-name { font-weight: 600; }
.suggest-item .s-addr { color: var(--muted); }

/* Rich-text editor */
.editor-field {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.editor-field:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
  padding: 5px 6px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
}
.tb-btn:hover { background: var(--accent-fade); color: var(--accent); }
.tb-btn.active { background: var(--accent); color: #fff; }
.tb-btn svg { width: 16px; height: 16px; display: block; }
.tb-b { font-weight: 800; }
.tb-i { font-style: italic; font-family: Georgia, 'Times New Roman', serif; }
.tb-u { text-decoration: underline; }
.tb-s { text-decoration: line-through; }
.tb-select {
  height: 30px;
  max-width: 120px;
  margin: 0 2px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
}
.tb-select:hover { border-color: var(--accent); }
.tb-select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.tb-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--line); }
.tb-colors { display: inline-flex; align-items: center; gap: 4px; padding: 0 3px; }
.tb-swatch {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .1s;
}
.tb-swatch:hover { transform: scale(1.15); }
.editor {
  min-height: 300px;
  max-height: 56vh;
  overflow-y: auto;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  outline: none;
  word-break: break-word;
}
.editor.is-empty::before,
.editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.editor > :first-child { margin-top: 0; }
.editor p { margin: 0 0 10px; }
.editor h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 18px 0 8px;
}
.editor h3 { font-size: 17px; font-weight: 700; margin: 14px 0 6px; }
.editor ul, .editor ol { margin: 0 0 10px; padding-left: 24px; }
.editor blockquote {
  margin: 10px 0;
  padding: 4px 0 4px 14px;
  border-left: 3px solid var(--accent-fade);
  color: var(--muted);
}
.editor a { color: var(--accent); }
.editor img { max-width: 100%; height: auto; }

/* Attachments — drag-and-drop dropzone + chips */
.attach {
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.attach:hover { border-color: var(--accent); }
.compose-view.dragging .attach {
  border-color: var(--accent);
  background: var(--accent-fade);
}
.attach-prompt {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}
.attach-clip { width: 16px; height: 16px; flex: none; color: var(--accent); }
.attach-browse { color: var(--accent); font-weight: 600; text-decoration: underline; }
.attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.attach-list:empty { display: none; }
.attach-list:not(:empty) { margin-top: 12px; }
.att-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
}
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { color: var(--muted); font-size: 11px; flex: none; }
.att-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-fade);
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
}
.att-remove:hover { background: var(--red); color: #fff; }
.att-uploading { color: var(--muted); }
.att-spinner {
  width: 12px;
  height: 12px;
  flex: none;
  border: 2px solid var(--accent-fade);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: att-spin .6s linear infinite;
}
@keyframes att-spin { to { transform: rotate(360deg); } }

.compose-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

/* Settings */
.settings { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.settings label.readonly span { padding: 10px 12px; border-radius: 6px; background: #f5f7fa; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--accent); }
.settings input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}
.settings input:focus { outline: 2px solid var(--accent); border-color: var(--accent); background: #fff; }

/* Teams */
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.teams .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.teams .card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.teams .card .name { font-weight: 600; }
.teams .card .addr { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--accent); }

/* Buttons */
button.primary {
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  align-self: flex-start;
}
button.primary:hover { background: var(--accent); }
button.ghost {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12px;
}
button.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Address links (clickable email addresses → compose) ─────────── */
.addr-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 120ms ease;
}
.addr-link:hover { border-bottom-color: var(--accent); }
.detail .body .addr-link { font-weight: 500; }

/* ── Delivery status badges ───────────────────────────────────────── */
.badge-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  margin-right: 6px;
  border-radius: 4px;
  vertical-align: middle;
}
.badge-sent       { background: #eef2f6; color: #6b7280; }
.badge-delivered  { background: #e6f4ea; color: #137333; }
.badge-bounced    { background: #fce8e6; color: #c5221f; }
.badge-complained { background: #fef7e0; color: #b06000; }
.badge-delayed    { background: #fff3e0; color: #c2410c; }
.status-line { margin: 4px 0 8px; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
  }
  .brand-word { display: none; }
  .tabs { flex-direction: row; }
  .account-block { margin-top: 0; border: none; }
  .content { padding: 16px; }
  .row { grid-template-columns: 24px 100px 1fr; }
  .row .date { display: none; }
}

/* Transient toast (clipboard feedback, etc.) */
.dz-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 24px -8px rgba(10, 12, 16, .45);
  max-width: 80vw;
  transition: opacity .18s ease, transform .18s ease;
}
.dz-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
