/* =========================================================
   Ratio Workspace — styles.css
   Domain: mail.palette-archive.com
   Palette: Corporate Navy (single)
   ========================================================= */

:root {
  --sans: Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', system-ui, sans-serif;
  --serif: Georgia, 'Noto Serif KR', serif;
  --mono: 'SF Mono', Menlo, Consolas, monospace;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-alt: #EEF2F7;
  --surface-deep: #E4EAF3;
  --border: #DDE3EC;
  --border-strong: #C6CEDA;
  --text: #0B2545;
  --text-muted: #5A6B85;
  --text-dim: #8A97AC;
  --primary: #0B2545;
  --primary-hover: #0F2E56;
  --primary-text: #FFFFFF;
  --accent: #2456C8;
  --accent-hover: #1D48A8;
  --accent-soft: #E3ECFB;
  --danger: #B4243B;
  --danger-soft: #FCE7EC;
  --success: #0F7A4A;
  --success-soft: #E4F3EC;
  --warn: #B8791B;
  --warn-soft: #FBEFDC;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, textarea { font-family: var(--sans); color: inherit; }
button { cursor: pointer; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }

/* App root */
#app {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active {
  display: flex;
}

/* =========================================================
   Wordmark
   ========================================================= */
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark-badge {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 15px; font-weight: 700; letter-spacing: -0.5px;
}
.wordmark-name {
  font-family: var(--serif);
  font-size: 18px; font-weight: 600; letter-spacing: -0.4px;
  color: var(--text);
}
.wordmark-suite {
  font-size: 12px; color: var(--text-dim);
  letter-spacing: 1px; text-transform: uppercase;
  margin-left: 6px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: 8px;
  padding: 12px 22px;
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.1px;
  transition: background 120ms;
  font-family: inherit;
}
.btn.primary {
  background: var(--primary); color: var(--primary-text);
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary:disabled { background: var(--border-strong); cursor: not-allowed; }

.btn.secondary {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--surface-alt); }

.btn.accent {
  background: var(--accent); color: #fff;
}
.btn.accent:hover { background: var(--accent-hover); }

.btn.big { padding: 14px 28px; font-size: 15px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: none;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms;
}
.icon-btn:hover { background: var(--surface-alt); }
.icon-btn.small { width: 32px; height: 32px; border-radius: 6px; }

/* =========================================================
   Onboarding
   ========================================================= */
.onb-topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 32px;
  background: var(--surface);
  gap: 20px;
}
.onb-topbar-hint {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: 0.2px;
}
.onb-topbar-hint a { color: var(--accent); cursor: pointer; text-decoration: none; }

.onb-body {
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 0;
}

.onb-rail {
  border-right: 1px solid var(--border);
  padding: 48px 36px;
  background: var(--surface);
  display: flex; flex-direction: column;
}
.onb-rail-eyebrow {
  font-size: 12px; letter-spacing: 2px;
  color: var(--text-dim); text-transform: uppercase;
  margin-bottom: 24px;
}
.onb-rail-title {
  font-size: 26px; font-weight: 600;
  line-height: 1.25; letter-spacing: -0.4px;
  margin: 0 0 8px;
}
.onb-rail-sub {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 40px;
}

.onb-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.onb-step {
  display: flex; gap: 14px;
  padding: 12px 0;
  align-items: flex-start;
}
.onb-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.onb-step.active .onb-step-num {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.onb-step.done .onb-step-num {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.onb-step-label {
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  padding-top: 3px;
}
.onb-step.active .onb-step-label { color: var(--text); font-weight: 600; }
.onb-step.done .onb-step-label { color: var(--text); }
.onb-step-label small {
  display: block;
  font-size: 12px; font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
}

.onb-rail-foot {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 12px; color: var(--text-dim);
  line-height: 1.6;
}
.onb-rail-foot .infra-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.onb-rail-foot a { color: var(--accent); cursor: pointer; text-decoration: none; }

.onb-main {
  overflow-y: auto;
  padding: 56px 72px;
  display: flex; justify-content: center;
}
.onb-content {
  width: 100%;
  max-width: 640px;
}

.back-link {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 13px;
  display: flex; align-items: center; gap: 6px;
  padding: 0; margin-bottom: 24px;
}

.step-eyebrow {
  font-size: 12px; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 12px;
}
.step-title {
  font-size: 34px; font-weight: 600;
  letter-spacing: -0.8px; line-height: 1.2;
  margin: 0 0 10px;
}
.step-lead {
  font-size: 15px; color: var(--text-muted);
  line-height: 1.55; margin-bottom: 40px;
}
.step-lead code {
  background: var(--surface-alt);
  padding: 2px 6px; border-radius: 4px;
  font-family: var(--mono); font-size: 13px;
}
.step-lead .en {
  color: var(--text-dim); font-size: 13px;
  display: block; margin-top: 4px;
}

/* Fields */
.field-label {
  display: block;
  font-size: 13px; font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}
.field-label .en {
  color: var(--text-dim); font-weight: 400;
  margin-left: 4px;
}

.input-shell {
  display: flex; align-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 120ms;
}
.input-shell.error { border-color: var(--danger); }
.input-shell:focus-within { border-color: var(--accent); }
.input-shell .prefix {
  padding: 0 14px;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  height: 52px;
  display: flex; align-items: center;
}
.input-shell .suffix {
  padding: 0 16px;
  border-left: 1px solid var(--border);
  background: var(--surface-alt);
  height: 48px;
  display: flex; align-items: center;
  color: var(--text-muted);
  font-family: var(--mono); font-size: 15px;
}
.input-shell input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 0 16px; height: 52px;
  font-size: 16px;
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: 0.2px;
}
.input-shell.small input { height: 48px; font-size: 15px; }
.input-shell.small .prefix { height: 48px; }

.field-input {
  width: 100%;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 16px; height: 48px;
  font-size: 15px; color: var(--text);
  outline: none;
}
.field-input:focus { border-color: var(--accent); }

.field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

/* Info card (accent soft) */
.info-card {
  padding: 16px;
  background: var(--accent-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  line-height: 1.6;
  margin-top: 20px;
}
.info-card .title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.info-card .desc { color: var(--text-muted); }

.info-card.muted {
  background: var(--surface-alt);
  color: var(--text-muted);
  display: flex; gap: 12px;
  font-size: 12px;
  line-height: 1.6;
}
.info-card.muted .title {
  color: var(--text); font-weight: 500;
  margin-bottom: 2px;
}

/* Domain badge */
.domain-badge {
  font-size: 13px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: 6px;
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 16px; margin-bottom: 24px;
}
.domain-badge code {
  font-family: var(--mono);
  color: var(--text); font-weight: 500;
}

/* DNS table */
.dns-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.dns-row {
  display: grid;
  grid-template-columns: 70px 80px 1fr 40px;
  padding: 14px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
}
.dns-row:last-child { border-bottom: none; }
.dns-row.header {
  background: var(--surface-alt);
  font-family: var(--sans);
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.dns-badge {
  background: var(--primary); color: #fff;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px;
  font-family: var(--sans);
  display: inline-block;
}
.dns-host { color: var(--text-dim); font-size: 12px; margin-bottom: 2px; }
.dns-value {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dns-copy {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.dns-copy:hover { background: var(--surface-alt); }

.verify-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 20px;
}
.verify-btn {
  padding: 10px 16px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  display: flex; align-items: center; gap: 8px;
}
.verify-btn.verified {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}
.verify-hint { font-size: 13px; color: var(--text-dim); }

.step-actions {
  margin-top: 40px;
  display: flex; gap: 12px;
}

/* 2FA option */
.opt-check {
  display: flex; gap: 12px;
  padding: 16px;
  background: var(--surface-alt);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 120ms;
}
.opt-check.on { background: var(--accent-soft); }
.opt-check .checkbox {
  width: 20px; height: 20px; border-radius: 4px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.opt-check.on .checkbox {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.opt-check .title {
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.opt-check .title .en { color: var(--text-dim); font-weight: 400; }
.opt-check .desc {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px; line-height: 1.5;
}

.legal-hint {
  font-size: 12px; color: var(--text-dim);
  margin-top: 12px;
}
.legal-hint a { color: var(--accent); cursor: pointer; text-decoration: none; }

/* =========================================================
   Webmail
   ========================================================= */
.wm-topbar {
  height: 56px;
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wm-topbar-left {
  width: 224px;
  display: flex; align-items: center; gap: 12px;
}
.wm-search {
  flex: 1; max-width: 720px;
  position: relative;
}
.wm-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  display: flex;
  pointer-events: none;
}
.wm-search input {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 0 44px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.wm-search input:focus { background: var(--surface); border-color: var(--accent); }
.wm-topbar-right {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}

.avatar {
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  border: none;
  flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; font-size: 11px; }
.avatar.md { width: 36px; height: 36px; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.avatar.soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.avatar.system {
  background: var(--text-muted); color: #fff;
}

/* User dropdown */
.user-menu {
  position: relative;
  margin-left: 4px;
}
.user-menu-panel {
  position: absolute;
  right: 0; top: 44px;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(11,37,69,0.18);
  padding: 16px;
  z-index: 100;
  display: none;
}
.user-menu-panel.open { display: block; }
.user-menu-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.user-menu-head .name { font-size: 14px; font-weight: 500; }
.user-menu-head .email {
  font-size: 12px; color: var(--text-muted);
  font-family: var(--mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 8px;
  border-radius: 6px;
  background: transparent; border: none;
  color: var(--text); font-size: 13px;
  text-align: left;
  margin-top: 4px;
}
.menu-item:hover { background: var(--surface-alt); }

.wm-body {
  flex: 1;
  display: grid;
  grid-template-columns: 244px minmax(360px, 420px) 1fr;
  min-height: 0;
}

/* Sidebar */
.wm-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 4px;
}
.compose-btn {
  background: var(--primary); color: var(--primary-text);
  border: none; border-radius: 24px;
  padding: 14px 24px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(11,37,69,0.2);
  align-self: flex-start;
}
.compose-btn:hover { background: var(--primary-hover); }

.folder-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 16px;
  border-radius: 0 24px 24px 0;
  background: transparent; border: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  margin-right: 4px;
}
.folder-btn:hover { background: var(--surface-alt); }
.folder-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.folder-btn .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.folder-btn.active .count { color: var(--accent); }

.side-divider {
  height: 1px; background: var(--border);
  margin: 16px 12px 8px;
}
.side-heading {
  padding: 4px 16px;
  font-size: 11px; font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.label-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 16px;
  border-radius: 0 24px 24px 0;
  background: transparent; border: none;
  color: var(--text);
  font-size: 13px; text-align: left;
}
.label-btn:hover { background: var(--surface-alt); }
.label-dot {
  width: 12px; height: 12px; border-radius: 3px;
  flex-shrink: 0;
}
.label-btn .en { font-size: 11px; color: var(--text-dim); margin-left: auto; }

.side-card {
  margin-top: auto;
  padding: 14px;
  background: var(--surface-alt);
  border-radius: 10px;
  font-size: 12px; color: var(--text-muted);
  line-height: 1.55;
  margin: 12px 4px 0;
}
.side-card .head {
  display: flex; align-items: center; gap: 6px;
  color: var(--success); font-weight: 500;
  margin-bottom: 6px;
}
.side-card a {
  background: transparent; border: none;
  color: var(--accent); padding: 0; margin-top: 8px;
  display: block;
  font-size: 12px;
  cursor: pointer;
}

/* Mail list */
.wm-list {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-height: 0;
}
.wm-list-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.wm-list-head .title {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.2px;
}
.wm-list-head .sub {
  font-size: 12px; color: var(--text-dim);
  margin-top: 2px;
}
.wm-list-scroll {
  flex: 1;
  overflow-y: auto;
}

.mail-row {
  padding: 14px 20px 14px 16px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: var(--surface);
  display: flex; gap: 12px;
  cursor: pointer;
  transition: background 100ms;
}
.mail-row:hover { background: var(--surface-alt); }
.mail-row.selected {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.mail-row.selected:hover { background: var(--accent-soft); }
.mail-row-body { min-width: 0; flex: 1; }
.mail-row-top {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 2px;
}
.mail-row-from {
  font-size: 13px; font-weight: 500;
  color: var(--text);
  flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-row.unread .mail-row-from { font-weight: 700; }
.mail-row-time {
  font-size: 11px; color: var(--text-dim);
  flex-shrink: 0;
}
.mail-row.unread .mail-row-time {
  color: var(--accent); font-weight: 600;
}
.mail-row-subject {
  font-size: 13px; color: var(--text);
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.mail-row.unread .mail-row-subject { font-weight: 600; }
.mail-row-subject .star { color: var(--warn); display: flex; flex-shrink: 0; }
.mail-row-subject-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-row-preview {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-row-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
}
.mail-row-foot .attachment { color: var(--text-dim); display: flex; }
.chip {
  font-size: 10px; letter-spacing: 0.5px;
  font-weight: 600; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  background: var(--surface-alt);
  color: var(--text-muted);
  display: inline-block;
}

/* Mail reader */
.wm-reader {
  background: var(--bg);
  overflow-y: auto;
  display: flex; flex-direction: column;
  min-height: 0;
}
.reader-actionbar {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.reader-actionbar .divider {
  width: 1px; height: 20px;
  background: var(--border);
  margin: 0 6px;
}
.reader-actionbar .pos {
  margin-left: auto;
  font-size: 12px; color: var(--text-dim);
}

.reader-body {
  padding: 32px 40px;
  max-width: 780px;
  width: 100%;
}
.reader-title-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 20px;
}
.reader-title {
  flex: 1;
  font-size: 22px; font-weight: 600;
  line-height: 1.35; letter-spacing: -0.3px;
  margin: 0;
}
.reader-chip {
  font-size: 10px; letter-spacing: 0.5px;
  font-weight: 600; text-transform: uppercase;
  padding: 4px 8px; border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-muted);
  flex-shrink: 0; margin-top: 4px;
}

.reader-sender {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.reader-sender-name { font-size: 14px; font-weight: 500; }
.reader-sender-name .email { color: var(--text-dim); font-weight: 400; }
.reader-sender-meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}
.reader-body-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.attachment-card {
  margin-top: 32px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  display: flex; align-items: center; gap: 14px;
}
.attachment-thumb {
  width: 40px; height: 48px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px;
}
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 13px; font-weight: 500; }
.attachment-meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}

.reader-actions {
  margin-top: 40px;
  display: flex; gap: 10px;
}
.reader-actions .btn {
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  padding: 10px 20px;
  font-size: 13px;
}
.reader-actions .btn:hover { background: var(--surface-alt); }

/* Empty state */
.reader-empty {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* =========================================================
   Compose (fullscreen)
   ========================================================= */
.compose-fs {
  position: absolute; inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  z-index: 300;
}
.compose-fs.active { display: flex; }

.compose-topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
  flex-shrink: 0;
}
.compose-topbar .title {
  font-size: 14px; font-weight: 500;
  color: var(--text);
}
.compose-topbar .autosave {
  font-size: 12px; color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
}
.compose-topbar .autosave .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.compose-fs-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 0;
}

.compose-editor-col {
  overflow-y: auto;
  padding: 40px 8vw 40px;
  display: flex; justify-content: center;
}
.compose-editor {
  width: 100%;
  max-width: 780px;
}

.compose-side {
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}
.compose-side-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
.compose-tab {
  flex: 1;
  padding: 14px 12px;
  background: transparent; border: none;
  color: var(--text-muted);
  font-size: 12px; font-weight: 500;
  border-bottom: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.compose-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.compose-side-panel { padding: 20px; display: none; }
.compose-side-panel.active { display: block; }
.compose-side-heading {
  font-size: 13px; font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.compose-side-sub {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.attach-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.attach-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--surface-alt);
  border-radius: 8px;
  font-size: 12px;
}
.attach-item .thumb {
  width: 28px; height: 32px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.attach-item .name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-weight: 500;
}
.attach-item .size { color: var(--text-dim); }
.attach-item .rm {
  background: transparent; border: none;
  color: var(--text-dim); padding: 2px;
  display: flex;
}

.ai-suggest {
  padding: 12px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.ai-suggest .title {
  display: flex; align-items: center; gap: 6px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.ai-actions {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 12px;
}
.ai-action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px; font-weight: 500;
  text-align: left;
  transition: background 120ms;
}
.ai-action-btn:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.ai-action-btn .desc {
  display: block;
  font-size: 11px; color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.schedule-list { display: flex; flex-direction: column; gap: 8px; }
.schedule-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.schedule-item:hover { border-color: var(--border-strong); }
.schedule-item .when { font-size: 13px; font-weight: 500; color: var(--text); }
.schedule-item .desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.schedule-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .info { flex: 1; }
.toggle-row .info .name { font-size: 13px; font-weight: 500; }
.toggle-row .info .desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.switch {
  width: 40px; height: 22px; border-radius: 12px;
  background: var(--border-strong);
  position: relative;
  transition: background 120ms;
  border: none;
  flex-shrink: 0;
  cursor: pointer;
}
.switch.on { background: var(--accent); }
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left 120ms;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch.on::after { left: 20px; }

/* Compose editor form */
.compose-field {
  display: flex; align-items: center; gap: 12px;
  min-height: 40px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.compose-field .lbl {
  width: 48px;
  font-size: 12px; color: var(--text-dim);
  font-weight: 500;
  flex-shrink: 0;
}
.compose-field input,
.compose-field .from-text {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text);
  padding: 4px 0;
  font-family: var(--mono);
}
.compose-field .subject-input {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
}
.compose-field .cc-toggle {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 12px;
  padding: 0 4px;
}
.compose-field .cc-toggle:hover { color: var(--accent); }

.compose-format-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.compose-format-bar .divider {
  width: 1px; height: 18px;
  background: var(--border);
  margin: 0 4px;
}
.fmt-select {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
  outline: none;
}

.compose-body-input {
  width: 100%;
  min-height: 320px;
  border: none; outline: none;
  background: transparent;
  padding: 20px 0;
  font-size: 14px; line-height: 1.7;
  color: var(--text);
  resize: none;
  font-family: inherit;
}

.compose-signature {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.compose-signature .sig-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Compose footer (bottom action bar) */
.compose-foot {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.send-split {
  display: inline-flex;
  border-radius: 20px;
  overflow: hidden;
  background: var(--primary);
}
.send-split .send-main {
  padding: 10px 22px;
  background: transparent;
  color: var(--primary-text);
  border: none;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.send-split .send-main:hover { background: rgba(255,255,255,0.08); }
.send-split .send-caret {
  padding: 0 12px;
  background: transparent;
  color: var(--primary-text);
  border: none;
  border-left: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center;
}
.send-split .send-caret:hover { background: rgba(255,255,255,0.08); }

/* Recipient chips */
.recipient-chips {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px;
  flex: 1; min-width: 0;
}
.chip-r {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 16px;
  padding: 4px 4px 4px 10px;
  font-size: 12px; font-weight: 500;
  font-family: var(--sans);
}
.chip-r .rm {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: transparent;
  border: none; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.chip-r .rm:hover { background: rgba(36,86,200,0.15); }
.recipient-chips input {
  flex: 1; min-width: 120px;
}

/* =========================================================
   Security
   ========================================================= */
.sec-topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  flex-shrink: 0;
}
.sec-topbar .email {
  margin-left: auto;
  font-size: 13px; color: var(--text-muted);
}

.sec-body {
  flex: 1; overflow-y: auto;
  padding: 40px 32px;
}
.sec-inner {
  max-width: 1080px; margin: 0 auto;
}
.sec-eyebrow {
  font-size: 12px; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 12px;
}
.sec-title {
  font-size: 32px; font-weight: 600;
  letter-spacing: -0.6px;
  margin: 0 0 8px;
}
.sec-title .green { color: var(--success); }
.sec-lead {
  font-size: 15px; color: var(--text-muted);
  line-height: 1.55; margin-bottom: 40px;
}
.sec-lead .en {
  color: var(--text-dim); font-size: 13px;
  display: block; margin-top: 4px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.metric-label {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 8px;
}
.metric-label .en { color: var(--text-dim); }
.metric-row {
  display: flex; align-items: baseline; gap: 10px;
}
.metric-value {
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.8px;
  font-family: var(--serif);
}
.metric-delta {
  font-size: 12px;
  font-weight: 500;
}
.metric-delta.up { color: var(--success); }
.metric-delta.flat { color: var(--warn); }

.metric-bar {
  margin-top: 12px;
  height: 4px;
  background: var(--surface-alt);
  border-radius: 2px;
  overflow: hidden;
}
.metric-bar > div {
  height: 100%;
  background: var(--success);
  opacity: 0.7;
}

.sec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.card-head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head .title {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.2px;
}
.card-head .sub {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
}

.setting-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .badge {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.setting-row.on .badge {
  background: var(--accent-soft); color: var(--accent);
}
.setting-row.ok .badge {
  background: var(--success-soft); color: var(--success);
}
.setting-row .info { flex: 1; min-width: 0; }
.setting-row .info .name { font-size: 13px; font-weight: 500; }
.setting-row .info .desc {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--sans);
}
.setting-row .info .desc.mono { font-family: var(--mono); }

/* Activity */
.activity-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: none; }
.activity-row .badge {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.activity-row.suspicious .badge {
  background: var(--danger-soft);
  color: var(--danger);
}
.activity-row .info { flex: 1; min-width: 0; }
.activity-row .info .name {
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.activity-row .info .meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}
.activity-row .info .meta .ip {
  font-family: var(--mono);
}
.chip-tone {
  font-size: 10px;
  padding: 2px 6px; border-radius: 3px;
  font-weight: 600; letter-spacing: 0.5px;
}
.chip-tone.success { background: var(--success-soft); color: var(--success); }
.chip-tone.danger { background: var(--danger-soft); color: var(--danger); }

.session-end-btn {
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  padding: 6px 12px; border-radius: 6px;
  font-size: 12px;
}

.sec-card-margin { margin-top: 16px; }


/* =========================================================
   Login screen
   ========================================================= */
.login-shell {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 40px 20px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
}
.login-card .brand {
  display: flex; justify-content: center;
  margin-bottom: 28px;
}
.login-title {
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  text-align: center;
}
.login-sub {
  font-size: 13px; color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}
.login-sub .en { color: var(--text-dim); display: block; margin-top: 2px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label {
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  margin-bottom: -8px;
}
.login-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px; color: var(--text);
  outline: none;
  font-family: var(--mono);
}
.login-form input:focus { border-color: var(--accent); }
.login-form input.otp {
  font-family: var(--mono);
  letter-spacing: 8px;
  text-align: center;
  font-size: 22px;
  font-weight: 500;
}
.login-actions {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.login-actions .btn.primary { width: 100%; justify-content: center; padding: 12px; }
.login-remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
}
.login-remember .cb {
  width: 16px; height: 16px; border-radius: 3px;
  border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
}
.login-remember .cb.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.login-forgot {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent); cursor: pointer;
  background: transparent; border: none;
}
.login-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.login-sep::before, .login-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.sso-list { display: flex; flex-direction: column; gap: 8px; }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
}
.sso-btn:hover { background: var(--surface-alt); }
.login-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.login-foot a { color: var(--accent); cursor: pointer; text-decoration: none; }

/* 2FA step */
.otp-hint {
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 20px;
  display: flex; gap: 10px; align-items: flex-start;
}
.otp-hint .icon { color: var(--accent); flex-shrink: 0; display: flex; }

.login-back {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; margin-bottom: 20px;
  cursor: pointer;
}

/* =========================================================
   Search results
   ========================================================= */
.search-body {
  flex: 1; overflow-y: auto;
  padding: 24px 32px 40px;
}
.search-inner { max-width: 960px; margin: 0 auto; }
.search-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.search-title {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
}
.search-title .q {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 18px;
}
.search-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.filter-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 16px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--border-strong); }
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chip .close {
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
}

.result-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.result-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.result-empty .big { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

/* =========================================================
   Settings
   ========================================================= */
.settings-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 0;
}
.settings-nav {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 12px;
  overflow-y: auto;
}
.settings-nav .heading {
  padding: 4px 16px 12px;
  font-size: 11px; font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
}
.settings-nav-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 16px;
  border-radius: 6px;
  background: transparent; border: none;
  color: var(--text);
  font-size: 13px; font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.settings-nav-btn:hover { background: var(--surface-alt); }
.settings-nav-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.settings-content {
  overflow-y: auto;
  padding: 40px 48px;
}
.settings-inner { max-width: 720px; }
.settings-h1 {
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0 0 4px;
}
.settings-sub {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 32px;
}
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-size: 15px; font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.2px;
}
.settings-section .section-sub {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 20px;
}
.settings-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.settings-grid-2 .full { grid-column: 1 / -1; }
.settings-textarea {
  width: 100%; min-height: 120px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px; color: var(--text);
  outline: none; resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}
.settings-textarea:focus { border-color: var(--accent); }

.rule-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.rule-row:last-child { border-bottom: none; }
.rule-row .desc { flex: 1; font-size: 13px; }
.rule-row .desc .cond { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.vacation-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: 8px;
  margin-bottom: 16px;
}
.vacation-toggle .info { flex: 1; }
.vacation-toggle .info .name { font-size: 14px; font-weight: 500; }
.vacation-toggle .info .desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* =========================================================
   Team management (admin)
   ========================================================= */
.team-body { flex: 1; overflow-y: auto; padding: 40px 32px; }
.team-inner { max-width: 1080px; margin: 0 auto; }
.team-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.team-head h1 {
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.4px; margin: 0;
}
.team-head .sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.team-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.team-row {
  display: grid;
  grid-template-columns: 44px 1fr 120px 120px 100px 40px;
  align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }
.team-row.header {
  background: var(--surface-alt);
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.team-name .n { font-size: 13px; font-weight: 500; }
.team-name .e { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.role-pill {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}
.role-pill.owner { background: var(--primary); color: #fff; }
.role-pill.admin { background: var(--accent-soft); color: var(--accent); }
.role-pill.member { background: var(--surface-alt); color: var(--text-muted); }
.role-pill.guest { background: var(--warn-soft); color: var(--warn); }
.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.status-dot .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
}
.status-dot.invited .dot { background: var(--warn); }
.status-dot.suspended .dot { background: var(--danger); }

/* =========================================================
   Mobile drawer overlay
   ========================================================= */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(11,37,69,0.5);
  z-index: 200;
  display: none;
}
.drawer-scrim.open { display: block; }

/* =========================================================
   RESPONSIVE — Tablet (≤1023px)
   ========================================================= */
@media (max-width: 1023px) {
  /* Onboarding: rail becomes top step-bar */
  .onb-body {
    grid-template-columns: 1fr;
  }
  .onb-rail {
    padding: 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .onb-rail-title { font-size: 20px; }
  .onb-rail-sub { margin-bottom: 20px; font-size: 13px; }
  .onb-steps {
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
  }
  .onb-step {
    padding: 6px 12px;
    min-width: 160px;
  }
  .onb-rail-foot { display: none; }
  .onb-main {
    padding: 32px 24px;
  }
  .step-title { font-size: 26px; }

  /* Webmail: hide reader by default, show as overlay when selected */
  .wm-body {
    grid-template-columns: 220px 1fr;
  }
  .wm-reader {
    position: absolute;
    top: 56px; right: 0; bottom: 0;
    width: 60%;
    z-index: 50;
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 24px rgba(11,37,69,0.08);
    display: none;
  }
  .wm-reader.open { display: flex; }

  /* Compose FS: side becomes bottom sheet */
  .compose-fs-body {
    grid-template-columns: 1fr;
  }
  .compose-side {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 40vh;
  }

  /* Security: 2 cols instead of 4 for metrics */
  .metric-grid { grid-template-columns: repeat(2, 1fr); }

  /* Settings */
  .settings-shell { grid-template-columns: 200px 1fr; }
  .settings-content { padding: 28px 24px; }

  /* Team */
  .team-row {
    grid-template-columns: 40px 1fr 100px 80px 40px;
  }
  .team-row .col-dept { display: none; }
  .team-row.header .col-dept { display: none; }
}

/* =========================================================
   RESPONSIVE — Mobile (≤767px)
   ========================================================= */
@media (max-width: 767px) {
  /* Onboarding */
  .onb-topbar { padding: 0 16px; height: 56px; }
  .onb-topbar-hint { display: none; }
  .onb-main { padding: 24px 20px; }
  .step-title { font-size: 22px; }
  .step-lead { font-size: 13px; margin-bottom: 24px; }
  .dns-row {
    grid-template-columns: 56px 60px 1fr 36px;
    padding: 12px;
    font-size: 11px;
  }
  .dns-badge { font-size: 10px; padding: 2px 6px; }
  .verify-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .step-actions { flex-direction: column; gap: 8px; }
  .step-actions .btn { width: 100%; justify-content: center; }
  .btn.big { padding: 14px 20px; font-size: 14px; width: 100%; justify-content: center; }

  /* Webmail: single column, drawer sidebar */
  .wm-topbar { padding: 0 12px; gap: 8px; }
  .wm-topbar-left { width: auto; }
  .wm-topbar-left .wordmark-suite { display: none; }
  .wm-search { max-width: none; }
  .wm-search input { padding: 0 12px 0 40px; height: 36px; font-size: 13px; }
  .wm-search-icon { left: 12px; }
  .wm-topbar-right button[title="AI 어시스턴트"],
  .wm-topbar-right button[title="앱"] {
    display: none;
  }

  .wm-body {
    grid-template-columns: 1fr;
    position: relative;
  }
  .wm-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 210;
    transform: translateX(-100%);
    transition: transform 200ms ease-out;
    box-shadow: 4px 0 24px rgba(11,37,69,0.15);
  }
  .wm-sidebar.open { transform: translateX(0); }
  .wm-list { border-right: none; }
  .wm-reader {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    z-index: 60;
    box-shadow: none;
  }
  .reader-body { padding: 20px 20px 32px; }
  .reader-title { font-size: 18px; }
  .reader-actions { flex-direction: column; gap: 8px; }
  .reader-actions .btn { width: 100%; justify-content: center; }

  /* Compose FS */
  .compose-topbar .autosave span:not(.dot) { font-size: 10px; }
  .compose-editor-col { padding: 20px 16px; }
  .compose-side { max-height: 45vh; }
  .compose-side-panel { padding: 16px; }
  .compose-foot { padding: 10px 12px; gap: 6px; }
  .send-split .send-main { padding: 10px 16px; font-size: 12px; }

  /* Security */
  .sec-body { padding: 24px 16px; }
  .sec-title { font-size: 22px; }
  .sec-lead { font-size: 13px; margin-bottom: 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 22px; }
  .sec-grid { grid-template-columns: 1fr; }
  .setting-row, .activity-row { padding: 14px 16px; }
  .activity-row .info .name { flex-wrap: wrap; }

  /* Settings */
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px;
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }
  .settings-nav .heading { display: none; }
  .settings-nav-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--surface-alt);
  }
  .settings-nav-btn.active { background: var(--accent-soft); }
  .settings-content { padding: 20px 16px; }
  .settings-inner { max-width: none; }
  .settings-section { padding: 18px; }
  .settings-grid-2 { grid-template-columns: 1fr; gap: 12px; }

  /* Login */
  .login-card { padding: 28px 22px; }
  .login-title { font-size: 20px; }

  /* Team */
  .team-body { padding: 20px 12px; }
  .team-row {
    grid-template-columns: 36px 1fr 80px 36px;
    padding: 12px;
    gap: 8px;
  }
  .team-row .col-role, .team-row.header .col-role { display: none; }
  .team-name .e { display: none; }
}

/* Menu hamburger visibility on mobile */
.wm-menu-mobile { display: none; }
@media (max-width: 767px) {
  .wm-menu-mobile { display: flex; }
}

/* Print / accessibility */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
