:root {
  --brand: #0b1f33;
  --accent: #3ddc64;
  --accent-muted: #dcfce7;
  --surface: #f4fbf7;
  --elev: #fff;
  --muted: #eef6f1;
  --border: #d7eee0;
  --border-strong: #b7e0c6;
  --ink: #0b1f33;
  --ink-muted: #5b6b7c;
  --ink-subtle: #8a97a8;
  --danger: #dc2626;
  --success: #059669;
  --sky: #0ea5e9;
  --amber: #f59e0b;
  --violet: #7c3aed;
  --radius: 14px;
  --shadow-soft: 0 1px 2px rgba(11, 31, 51, 0.04), 0 8px 24px rgba(11, 31, 51, 0.05);
  --shadow-card: 0 1px 2px rgba(11, 31, 51, 0.04), 0 10px 28px rgba(16, 185, 129, 0.06);
  --shadow-compose: 0 8px 10px 1px rgba(11, 31, 51, 0.14), 0 3px 14px 2px rgba(11, 31, 51, 0.12), 0 5px 5px -3px rgba(11, 31, 51, 0.2);
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --display: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--sans); background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
::selection { background: rgba(61, 220, 100, 0.2); color: var(--brand); }
a { color: inherit; text-decoration: none; }
.ico { width: 16px; height: 16px; flex-shrink: 0; }

.shell { display: flex; height: 100vh; overflow: hidden; background: var(--surface); }
.sidebar {
  width: 248px;
  background: var(--elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.2s;
}
.shell.collapsed .sidebar { width: 72px; }
.brand { height: 56px; display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--border); }
.shell.collapsed .brand { justify-content: center; padding: 0; }
.brand-link { display: flex; min-width: 0; align-items: center; }
.brand img.lockup { height: auto; max-height: 40px; max-width: 176px; object-fit: contain; }
.brand img.mark { display: none; height: 32px; width: 32px; object-fit: contain; }
.shell.collapsed .brand img.lockup { display: none; }
.shell.collapsed .brand img.mark { display: block; }
.ws-name {
  margin: 10px 16px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.ws-switch { margin: 8px 12px 0; }
.ws-switch select { margin: 0; font-size: 12px; height: 32px; }
.shell.collapsed .ws-name, .shell.collapsed .ws-switch, .shell.collapsed .nav-label, .shell.collapsed .pill, .shell.collapsed .user-meta, .shell.collapsed .user-card .icon-btn { display: none; }
.compose-wrap { padding: 12px 8px 0; }
.compose-btn {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--brand);
  font: 700 14px var(--display);
  cursor: pointer;
  padding: 0 16px;
  box-shadow: 0 8px 20px rgba(61, 220, 100, 0.35);
}
.compose-btn:hover { filter: brightness(0.97); }
.shell.collapsed .compose-btn { justify-content: center; padding: 0; }
.sidebar nav { flex: 1; padding: 12px 8px; overflow: auto; }
.sidebar nav a, .side-foot a, .collapse-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.sidebar nav a .ico, .side-foot a .ico { color: var(--ink-subtle); }
.sidebar nav a.active { background: #dcfce7; color: var(--brand); font-weight: 700; }
.sidebar nav a.active .ico { color: #059669; }
.sidebar nav a:hover, .side-foot a:hover, .collapse-btn:hover { background: var(--muted); color: var(--ink); }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { background: var(--accent-muted); color: #065f46; border-radius: 99px; padding: 1px 6px; font-size: 10px; font-weight: 700; }
.pill.viewing { background: var(--brand); color: #fff; padding: 4px 8px; font-size: 11px; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 8px; }
.collapse-btn { width: 100%; border: 0; background: transparent; cursor: pointer; font: inherit; color: var(--ink-muted); text-align: left; }
.shell.collapsed .sidebar nav a, .shell.collapsed .side-foot a, .shell.collapsed .collapse-btn { justify-content: center; padding: 8px 0; }
.user-card {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px;
}
.shell.collapsed .user-card { justify-content: center; border: 0; background: transparent; padding: 4px; }
.avatar {
  display: inline-flex;
  height: 32px;
  width: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar.sm { height: 32px; width: 32px; }
.user-meta { min-width: 0; flex: 1; }
.user-meta p { margin: 0; font-size: 12px; font-weight: 600; }
.user-meta p + p { font-size: 10px; font-weight: 400; color: var(--ink-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shell .site-footer { display: none; }
.topbar {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(244, 251, 247, 0.86);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}
.topbar-title h1 { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.topbar-title p { margin: 0; font-size: 12px; color: var(--ink-muted); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.live-badge {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}
.live-badge i { width: 6px; height: 6px; border-radius: 99px; background: var(--success); display: block; }
@media (min-width: 640px) { .live-badge { display: inline-flex; } }
.search-btn { display: none; }
@media (min-width: 640px) { .search-btn { display: inline-flex; } }
.search-btn kbd {
  margin-left: 8px;
  border: 1px solid var(--border);
  background: var(--muted);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--ink-subtle);
}
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--ink-muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--muted); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }

.content {
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.flash {
  margin: 16px 24px 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  font-size: 14px;
  word-break: break-word;
  flex-shrink: 0;
}
.team-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.team-row code { font-size: 11px; word-break: break-all; }
.invite-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 16px;
  margin-top: 12px;
}
.flash.error { background: #fef2f2; border-color: #fecaca; color: var(--danger); }

.card {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.card.pad-0, .card.table-card { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 12px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-7 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi-card { padding: 20px; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--ink-muted); margin: 0; }
.kpi { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin: 6px 0 0; }
.kpi-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-muted);
  color: #059669;
}
.grid-7 .kpi-card:nth-child(7n+1) { background: linear-gradient(180deg, #fff, #ecfdf5); border-color: #bbf7d0; }
.grid-7 .kpi-card:nth-child(7n+2) { background: linear-gradient(180deg, #fff, #e0f2fe); border-color: #bae6fd; }
.grid-7 .kpi-card:nth-child(7n+2) .kpi-icon { background: #e0f2fe; color: #0369a1; }
.grid-7 .kpi-card:nth-child(7n+3) { background: linear-gradient(180deg, #fff, #fef3c7); border-color: #fde68a; }
.grid-7 .kpi-card:nth-child(7n+3) .kpi-icon { background: #fde68a; color: #b45309; }
.grid-7 .kpi-card:nth-child(7n+4) { background: linear-gradient(180deg, #fff, #ede9fe); border-color: #ddd6fe; }
.grid-7 .kpi-card:nth-child(7n+4) .kpi-icon { background: #ede9fe; color: #6d28d9; }
.grid-7 .kpi-card:nth-child(7n+5) { background: linear-gradient(180deg, #fff, #fce7f3); border-color: #fbcfe8; }
.grid-7 .kpi-card:nth-child(7n+5) .kpi-icon { background: #fce7f3; color: #be185d; }
.grid-7 .kpi-card:nth-child(7n+6) { background: linear-gradient(180deg, #fff, #ffedd5); border-color: #fed7aa; }
.grid-7 .kpi-card:nth-child(7n+6) .kpi-icon { background: #ffedd5; color: #c2410c; }
.grid-7 .kpi-card:nth-child(7n+7) { background: linear-gradient(180deg, #fff, #d1fae5); border-color: #6ee7b7; }
.kpi-delta { margin: 12px 0 0; font-size: 12px; font-weight: 600; color: var(--success); }

label { font-size: 14px; font-weight: 500; color: var(--ink); display: block; margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--ink-muted); display: block; margin-bottom: 6px; font-weight: 400; }
input, select, textarea {
  width: 100%;
  height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: 14px var(--sans);
  color: var(--ink);
  background: var(--elev);
  margin-bottom: 12px;
}
textarea { height: auto; min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 220, 100, 0.2);
}
input::placeholder, textarea::placeholder { color: var(--ink-subtle); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  padding: 0 16px;
  height: 40px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--display);
  box-shadow: var(--shadow-soft);
}
.btn.sm { height: 34px; padding: 0 12px; font-size: 12px; gap: 6px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.accent { background: var(--accent); color: var(--brand); box-shadow: 0 8px 18px rgba(61, 220, 100, 0.32); }
.btn.brand { background: var(--brand); color: #fff; }
.btn.outline, .btn:not(.accent):not(.brand):not(.danger):not(.ghost) {
  background: var(--elev);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.2); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: transparent; box-shadow: none; }
.btn.danger:hover { background: #fef2f2; }
.btn:hover { filter: brightness(0.97); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-subtle); background: var(--muted); padding: 10px 14px; font-weight: 600; }
td { padding: 12px 14px; border-top: 1px solid var(--border); }
tr:hover td { background: rgba(247, 248, 250, 0.8); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-muted); font-size: 14px; }
.strong { font-weight: 600; }
.ok { color: var(--success); }
.bad { color: var(--danger); }
.page-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--muted);
  color: var(--ink-muted);
  text-transform: uppercase;
}
.status.RUNNING, .status.sent { background: var(--accent-muted); color: #065f46; }
.status.SCHEDULED { background: #eff6ff; color: #1d4ed8; }
.status.PAUSED, .status.DRAFT { background: #fff7ed; color: #c2410c; }

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-color: #86efac;
  background:
    radial-gradient(ellipse 50% 80% at 100% 0%, #86efac 0%, transparent 55%),
    linear-gradient(135deg, #ecfdf5, #e0f2fe);
  padding: 28px;
}
.banner .strong { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.caps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding-top: 4px; padding-bottom: 4px; }
@media (min-width: 640px) { .caps { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .caps { grid-template-columns: repeat(8, 1fr); } }
.cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 8px;
  text-align: center;
}
.cap:hover { background: var(--muted); }
.cap i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-muted);
  color: #059669;
}
.cap:nth-child(8n+2) i { background: #e0f2fe; color: #0369a1; }
.cap:nth-child(8n+3) i { background: #fef3c7; color: #b45309; }
.cap:nth-child(8n+4) i { background: #ede9fe; color: #6d28d9; }
.cap:nth-child(8n+5) i { background: #fce7f3; color: #be185d; }
.cap:nth-child(8n+6) i { background: #ffedd5; color: #c2410c; }
.cap:nth-child(8n+7) i { background: #d1fae5; color: #047857; }
.cap:nth-child(8n+8) i { background: #e0f2fe; color: #0e7490; }
.cap span { font-size: 11px; font-weight: 500; }

.setup-slots { display: grid; gap: 12px; }
@media (min-width: 800px) { .setup-slots { grid-template-columns: repeat(3, 1fr); } }
.setup-slots article, .setup-slot { border: 1px dashed var(--border); border-radius: 12px; padding: 16px; color: inherit; text-decoration: none; display: block; }
.setup-slots article.ok, .setup-slot.ok { border-style: solid; border-color: var(--accent); background: var(--accent-muted); }
.setup-slot:hover { border-color: var(--accent); }
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 4px 10px;
}
.tag.gmail { background: #fee2e2; color: #b91c1c; }
.tag.gd { background: var(--accent-muted); color: #065f46; }

.steps { gap: 4px; margin-bottom: 16px; }
.steps button { border: 0; background: transparent; font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--ink-subtle); cursor: pointer; letter-spacing: 0.04em; padding: 6px 10px; border-radius: 999px; }
.steps button.on { background: var(--accent-muted); color: var(--brand); }

dialog.compose {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(720px, 96vw);
  max-height: min(92vh, 900px);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(11, 31, 51, 0.22);
  background: #fff;
}
dialog.compose::backdrop { background: rgba(11, 31, 51, 0.34); backdrop-filter: blur(2px); }
.compose-form { display: flex; flex-direction: column; max-height: min(92vh, 900px); }
.compose-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f7faf8, #eef6f1);
  border-bottom: 1px solid var(--border);
}
.compose-title {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.compose-sub { margin: 4px 0 0; font-size: 12px; color: var(--ink-muted); }
.compose-body {
  padding: 16px 18px;
  overflow: auto;
  display: grid;
  gap: 12px;
}
.compose-field { display: grid; gap: 6px; }
.compose-field > label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.compose-field input,
.compose-field select {
  width: 100%;
  margin: 0;
}
.compose-hint { margin: 6px 0 0; font-size: 12px; color: var(--ink-subtle); }
.compose-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  background: #fbfcfb;
}
.compose-pane {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.compose-pane-head {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f7faf8, #eef6f1);
  border-bottom: 1px solid var(--border);
}
.compose-pane-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 14px;
}
.compose-merge {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.compose-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}
.compose-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: #ecfdf5;
}
.compose-sig {
  border: 1px dashed #cbd5d1;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfcfb;
}
.compose-sig.empty { opacity: 0.9; }
.compose-sig-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.compose-sig-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.compose-sig-edit {
  font-size: 12px;
  font-weight: 600;
  color: var(--sky);
}
.compose-sig-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.compose-sig-body img {
  max-width: 180px;
  height: auto;
  margin-top: 8px;
  display: block;
}
.compose-sig-toggle { margin: 0; }
.compose-attach-label { margin-top: 10px !important; }
.compose-attach-hint { margin: 6px 0 0; font-size: 12px; }
.mp-attach-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mp-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-attach-item .inbox-attachment-chip { margin: 0; }
.mp-attach-remove {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 16px;
}
.mp-attach-remove:hover {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.mp-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.mp-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8faf9, #f1f5f3);
}
.mp-ed-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  min-width: 28px;
  height: 30px;
  padding: 0 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}
.mp-ed-btn:hover { background: var(--accent-muted); border-color: #a7f3d0; }
.mp-ed-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.mp-ed-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.15);
  padding: 0;
  cursor: pointer;
}
.mp-editor-surface {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
}
.mp-editor-surface:empty:before {
  content: attr(data-placeholder);
  color: var(--ink-subtle);
  pointer-events: none;
}
.mp-editor-surface.mp-editor-invalid {
  box-shadow: inset 0 0 0 1px #b91c1c;
}
.mp-editor-input[hidden] { display: none !important; }

/* Auth (login / register) — corporate light, scoped so .shell is untouched */
body.auth {
  --forest: #123026;
  --g: #1b8a45;
  --paper: #f4f5f3;
  --ink: #12211a;
  --auth-text: #12211a;
  --auth-muted: #5c6b64;
  --sans: Inter, ui-sans-serif, system-ui, sans-serif;
  --display: "Source Serif 4", Georgia, serif;
  --num: Inter, ui-sans-serif, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
body.auth .auth-shell { display: grid; min-height: 100vh; }
@media (min-width: 1024px) {
  body.auth .auth-shell { grid-template-columns: 1fr 1fr; }
}
body.auth .auth-aside {
  display: none;
  position: relative;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  padding: 48px;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #d8ddd9;
}
@media (min-width: 1024px) {
  body.auth .auth-aside { display: flex; padding: 56px 64px; }
}
body.auth .auth-glow { display: none; }
body.auth .auth-aside::after { display: none; }
body.auth .auth-aside > * { position: relative; }
body.auth .auth-logo {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
body.auth .auth-aside .logo { height: auto; max-height: 44px; max-width: 200px; object-fit: contain; }
body.auth .auth-tagline {
  margin: 28px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--g);
}
body.auth .auth-headline {
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  max-width: 28rem;
  margin: 12px 0 0;
  color: var(--forest);
  letter-spacing: -0.02em;
}
body.auth .auth-headline span { color: var(--forest); font-style: italic; font-weight: 500; }
body.auth .auth-lead {
  margin: 20px 0 0;
  max-width: 28rem;
  color: var(--auth-muted);
  line-height: 1.65;
  font-size: 16px;
}
body.auth .auth-stats { display: grid; gap: 1px; background: #d8ddd9; border: 1px solid #d8ddd9; }
body.auth .auth-stats div {
  border: 0;
  background: #fbfcfb;
  border-radius: 0;
  padding: 16px 18px;
  box-shadow: none;
}
body.auth .auth-stats p {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--forest);
  letter-spacing: -0.015em;
}
body.auth .auth-stats span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--auth-muted);
  font-weight: 500;
}
body.auth .auth-feed { display: none; }
body.auth .live-kicker { display: none; }
body.auth .auth-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
body.auth .auth-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d8ddd9;
  background: #fff;
  border-radius: 2px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--forest);
  font-weight: 600;
}
body.auth .auth-pills .ico { color: var(--g); width: 14px; height: 14px; }
body.auth .auth-main {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  padding: 32px 20px;
  background: var(--paper);
  color: var(--ink);
}
@media (min-width: 1024px) {
  body.auth .auth-main {
    background: var(--paper);
    padding: 48px 40px;
  }
}
body.auth .auth-box {
  --ink: #12211a;
  --ink-muted: #5c6b64;
  --ink-subtle: #7a8a82;
  --elev: #fff;
  --border: #d8ddd9;
  --brand: #123026;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid #d8ddd9;
  border-radius: 0;
  padding: 36px 32px;
  box-shadow: none;
}
body.auth .auth-mobile-logo { display: inline-flex; margin-bottom: 24px; }
body.auth .auth-mobile-logo img { height: auto; max-height: 40px; max-width: 180px; object-fit: contain; }
@media (min-width: 1024px) { body.auth .auth-mobile-logo { display: none; } }
body.auth .auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
  background: #e7f4ec;
  color: #146337;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
}
body.auth .auth-box h1 {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  margin: 16px 0 0;
  letter-spacing: -0.02em;
  color: var(--forest);
}
body.auth .auth-box .sub { margin: 8px 0 0; font-size: 14px; color: var(--ink-muted); line-height: 1.5; }
body.auth .auth-box form { margin-top: 28px; }
body.auth .auth-box input {
  height: 48px;
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
  border-radius: 2px;
}
body.auth .auth-box input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(18, 48, 38, 0.12);
}
body.auth .auth-box .btn.accent {
  background: var(--forest);
  color: #fff;
  box-shadow: none;
  border-radius: 2px;
}
body.auth .auth-foot { margin-top: 24px; text-align: center; font-size: 14px; color: var(--ink-muted); }
body.auth .auth-foot a { color: var(--forest); font-weight: 700; }
body.auth .auth-foot a:hover { text-decoration: underline; }
body.auth .auth-note { color: var(--ink-muted); font-size: 13px; }
body.auth .auth-note a { color: var(--forest); font-weight: 700; }
body.auth .auth-note a:hover { text-decoration: underline; }

/* Company portal /c/{slug} */
body.auth.portal {
  background: #0b1f33;
}
body.auth.portal .mp-chat { display: none; }
.portal-shell {
  display: grid;
  min-height: 100vh;
}
@media (min-width: 960px) {
  .portal-shell { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}
.portal-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  color: #fff;
  padding: 28px 24px 36px;
  background:
    radial-gradient(ellipse 90% 55% at -10% -10%, rgba(61, 220, 100, 0.28), transparent 52%),
    radial-gradient(ellipse 70% 45% at 110% 110%, rgba(14, 165, 233, 0.22), transparent 48%),
    #0b1f33;
}
.portal-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.portal-brand > * { position: relative; }
.portal-brand-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.portal-logo {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 7px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.portal-logo img {
  height: 28px;
  max-width: 148px;
  object-fit: contain;
}
.portal-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #86efac;
}
.portal-mark {
  display: inline-flex;
  width: 84px;
  height: 84px;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: var(--accent);
  color: var(--brand);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.06em;
  box-shadow: 0 18px 40px rgba(61, 220, 100, 0.35);
}
.portal-name {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin: 22px 0 0;
  max-width: 16ch;
}
.portal-owner {
  margin-top: 28px;
  max-width: 28rem;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.portal-owner-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86efac;
}
.portal-owner-name { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.portal-owner-email { margin: 4px 0 0; font-size: 13px; color: #8a97a8; }
.portal-owner-email a { color: #dcfce7; font-weight: 600; }
.portal-owner-email a:hover { text-decoration: underline; }
.portal-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.portal-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #d7e3ea;
}
.portal-points .ico { color: #4ade80; margin-top: 2px; }
.portal-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 40px;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(220, 252, 231, 0.7), transparent 50%),
    #f4fbf7;
}
.portal-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(11, 31, 51, 0.12);
}
.portal-card-logo { display: inline-flex; margin-bottom: 20px; }
.portal-card-logo img { height: 32px; }
@media (min-width: 960px) { .portal-card-logo { display: none; } }
.portal-card h2 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 14px 0 0;
  line-height: 1.15;
}
.portal-card .sub { margin: 8px 0 0; font-size: 14px; color: var(--ink-muted); line-height: 1.5; }
.portal-card form { margin-top: 24px; }
.portal-card input { height: 48px; }
.portal-card .bad { margin: 0 0 12px; }
.portal-actions { display: grid; gap: 10px; margin-top: 24px; }
.portal-actions .btn { justify-content: center; width: 100%; }
@media (max-width: 959px) {
  .portal-mark { width: 64px; height: 64px; font-size: 24px; border-radius: 18px; }
  .portal-name { max-width: none; }
}

.site-footer {
  flex-shrink: 0;
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border-top: 0;
  background:
    radial-gradient(ellipse 80% 70% at -10% 120%, rgba(61, 220, 100, 0.16), transparent 52%),
    radial-gradient(ellipse 50% 50% at 110% -20%, rgba(14, 165, 233, 0.12), transparent 48%),
    #071422;
  color: #c5d0da;
  text-align: left;
  font-family: Outfit, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.55;
}
.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #3ddc64 0%, #34d399 42%, #0ea5e9 100%);
}
.site-footer-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.site-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 36px 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer-logo {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.site-footer-logo img { height: auto; max-height: 32px; max-width: 160px; object-fit: contain; }
.site-footer-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #86efac;
}
.site-footer-name {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}
.site-footer-inner {
  display: grid;
  gap: 16px;
  padding: 28px 0;
}
@media (min-width: 640px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .site-footer-inner { grid-template-columns: 1.2fr 1fr 1fr 0.85fr; gap: 18px; }
}
.site-footer-brand { padding: 8px 4px 8px 0; }
.site-footer-tag {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
}
.site-footer-blurb {
  margin: 12px 0 0;
  max-width: 28ch;
  color: #9aa8b5;
  line-height: 1.6;
}
.site-footer-web {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(134, 239, 172, 0.28);
  background: rgba(61, 220, 100, 0.08);
  color: #dcfce7;
  font-weight: 700;
  font-size: 13px;
}
.site-footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.site-footer-web:hover { background: rgba(61, 220, 100, 0.16); color: #fff; text-decoration: none; }
.site-footer-web .ico { color: #4ade80; }
.site-footer-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px 20px 22px;
}
.site-footer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #86efac;
}
.site-footer-label .ico { width: 14px; height: 14px; color: #4ade80; }
.site-footer address {
  margin: 0;
  font-style: normal;
  color: #e8eef3;
  line-height: 1.7;
}
.site-footer-nav { display: flex; flex-direction: column; gap: 10px; }
.site-footer-nav a { color: #e8eef3; font-weight: 600; }
.site-footer-nav a:hover { color: #fff; text-decoration: underline; }
.site-footer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding: 16px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #8a97a8;
  font-size: 12px;
}
.site-footer-bar p { margin: 0; }
.site-footer a { font-weight: 700; color: #dcfce7; }
.site-footer a:hover { text-decoration: underline; }

/* Landing + auth footer: solid company band, not neon. */
body.landing .site-footer.site-footer,
body.auth .site-footer.site-footer {
  background: #123026;
  color: rgba(255, 255, 255, 0.68);
}
body.landing .site-footer .site-footer-logo,
body.auth .site-footer .site-footer-logo {
  background: #fff;
  border: 0;
  box-shadow: none;
  padding: 8px 10px;
}
body.landing .site-footer .site-footer-name,
body.auth .site-footer .site-footer-name { color: #fff; }
body.landing .site-footer .site-footer-kicker,
body.landing .site-footer .site-footer-tag,
body.landing .site-footer .site-footer-label,
body.auth .site-footer .site-footer-kicker,
body.auth .site-footer .site-footer-tag,
body.auth .site-footer .site-footer-label { color: #9fd4b0; }
body.landing .site-footer .site-footer-blurb,
body.landing .site-footer .site-footer-bar,
body.auth .site-footer .site-footer-blurb,
body.auth .site-footer .site-footer-bar { color: rgba(255, 255, 255, 0.62); }
body.landing .site-footer address,
body.auth .site-footer address { color: rgba(255, 255, 255, 0.88); }
body.landing .site-footer a,
body.auth .site-footer a,
body.landing .site-footer .site-footer-nav a,
body.auth .site-footer .site-footer-nav a { color: #e7f4ec; }
body.landing .site-footer a:hover,
body.auth .site-footer a:hover { color: #fff; }
body.landing .site-footer .site-footer-web,
body.auth .site-footer .site-footer-web {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e7f4ec;
}
body.landing .site-footer .site-footer-card,
body.auth .site-footer .site-footer-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.mailbox-edit { margin-top: 16px; }
.mailbox-edit .field { margin-bottom: 10px; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.thread { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.thread:hover { background: var(--surface); }
.thread.unread { background: rgba(220, 252, 231, 0.35); }
.thread .class { color: var(--accent); font-size: 11px; font-weight: 600; margin-top: 4px; }

.content:has(.inbox-shell) {
  max-width: none;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.inbox-account-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) auto;
  gap: 14px 18px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 16px;
  flex-shrink: 0;
}
.inbox-account-select label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
  margin-bottom: 4px;
}
.inbox-account-select select { margin: 0; width: 100%; }
.inbox-account-meta .strong { margin: 0; font-size: 14px; }
.inbox-account-meta .muted { margin: 2px 0 0; font-size: 12px; }
.inbox-folder-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--ink-muted);
}
.inbox-folder-stats a {
  color: inherit;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
}
.inbox-folder-stats a:hover { background: #eef8f1; }
.inbox-folder-stats a.on {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
}
.inbox-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: 100%;
}
@media (max-width: 960px) {
  .inbox-account-bar { grid-template-columns: 1fr; }
  .inbox-folder-stats { justify-content: flex-start; }
}
.inbox-list,
.inbox-read {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  box-shadow: var(--shadow-card);
}
.inbox-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.inbox-list-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--display);
}
.inbox-filters {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.inbox-chip {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
.inbox-chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.inbox-thread-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.inbox-thread {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.inbox-thread:hover { background: var(--surface); }
.inbox-thread.active {
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 var(--accent);
}
.inbox-thread.unread strong { font-weight: 800; }
.inbox-thread.unread .inbox-thread-subject { color: var(--ink); font-weight: 700; }
.inbox-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
  color: #065f46;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.inbox-avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 10px; }
.inbox-thread-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.inbox-thread-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.inbox-thread-top strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-thread-top time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ink-subtle);
}
.inbox-thread-subject {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-thread-preview {
  font-size: 12px;
  color: var(--ink-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-thread .badge { margin-top: 4px; width: fit-content; }
.inbox-empty, .inbox-empty-pane {
  padding: 40px 24px;
  text-align: center;
}
.inbox-empty-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 6px;
}
.inbox-read-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f8faf9);
}
.inbox-read-meta { min-width: 0; flex: 1; }
.inbox-read-meta h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.25;
  font-family: var(--display);
  font-weight: 700;
}
.inbox-read-meta > p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.inbox-lead-line { margin-top: 8px !important; }
.inbox-lead-line a { color: var(--sky); text-decoration: underline; }
.inbox-read-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.inbox-messages {
  flex: 1;
  overflow: auto;
  padding: 16px 20px 24px;
  background: #f7faf8;
  min-height: 0;
}
.inbox-message {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(11, 31, 51, 0.03);
}
.inbox-message-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.inbox-message-head > div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.inbox-message-head strong { font-size: 13px; }
.inbox-message-head time { font-size: 11px; white-space: nowrap; }
.inbox-message-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}
.inbox-message-body p { margin: 0 0 12px; }
.inbox-message-body p:last-child { margin-bottom: 0; }
.inbox-message-body a { color: #0369a1; text-decoration: underline; word-break: break-word; }
.inbox-attachments {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.inbox-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8faf9;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  max-width: 100%;
}
.inbox-attachment-chip:hover {
  border-color: var(--sky);
  background: #eef8ff;
}
.inbox-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.inbox-email-html {
  overflow-x: auto;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.inbox-email-html table {
  max-width: 100% !important;
  width: auto !important;
}
.inbox-email-html img {
  max-width: 100% !important;
  height: auto !important;
}
.inbox-email-html a {
  color: #0369a1;
  text-decoration: underline;
}
.inbox-inline-missing {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f3;
  color: var(--ink-subtle);
  font-size: 11px;
}

@media (max-width: 960px) {
  .main { overflow: auto; }
  .content:has(.inbox-shell) { overflow: visible; }
  .inbox-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .inbox-list { max-height: 42vh; }
  .inbox-read { min-height: 55vh; }
}

.activity-log { max-height: 420px; overflow: auto; }
.activity-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-row time { color: var(--ink-subtle); font-size: 11px; }
.activity-row strong { font-size: 13px; }
.send-all-review {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #f8faf9);
}
.gmail-compose {
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.1);
  max-width: 720px;
}
.gmail-compose-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #404040;
  color: #fff;
}
.gmail-compose-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.gmail-compose-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}
.gmail-compose-meta {
  border-bottom: 1px solid #e8eaed;
}
.gmail-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 9px 14px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
}
.gmail-row:last-child { border-bottom: 0; }
.gmail-row-from { align-items: start; }
.gmail-cc-input {
  width: 100%;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  color: #202124;
}
.gmail-cc-input:focus { outline: none; }
.gmail-cc-input::placeholder { color: #80868b; }
.gmail-from-pick { min-width: 0; width: 100%; }
.gmail-from-select {
  width: 100%;
  margin: 0;
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: #202124;
}
.gmail-from-select:focus {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
  border-color: #1a73e8;
}
.gmail-from-pick .hint { margin: 6px 0 0; }
.gmail-label {
  color: #5f6368;
  font-size: 13px;
}
.gmail-value {
  color: #202124;
  word-break: break-word;
}
.gmail-subject { font-weight: 600; }
.gmail-compose-body {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 16px 18px 20px;
  font-size: 14px;
  line-height: 1.55;
  color: #202124;
}
.gmail-compose-body img {
  max-width: 220px !important;
  width: auto !important;
  height: auto !important;
  display: block;
  margin-top: 10px;
}
.gmail-attach {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
}
.gmail-compose-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid #e8eaed;
  background: #fafafa;
}
.gmail-send {
  min-width: 96px;
  border-radius: 24px !important;
  padding-left: 22px !important;
  padding-right: 22px !important;
}
.gmail-options {
  margin-top: 14px;
  max-width: 720px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0;
}
.gmail-options > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.gmail-options > summary::-webkit-details-marker { display: none; }
.gmail-options-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}
.grid.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 800px) {
  .grid.grid-3 { grid-template-columns: 1fr; }
  .activity-row { grid-template-columns: 1fr; }
  .gmail-row { grid-template-columns: 56px minmax(0, 1fr); }
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { margin: 0; }
.field > input, .field > select, .field > textarea { margin-bottom: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; margin: 10px 0; }
.check input { width: auto; height: auto; margin: 3px 0 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.badge.success { background: #ecfdf5; color: #047857; }
.badge.warning { background: #fffbeb; color: #b45309; }
.badge.accent { background: var(--accent-muted); color: #065f46; }
.badge.muted { background: var(--muted); color: var(--ink-muted); }
.badge.danger { background: #fef2f2; color: #b91c1c; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-title { margin: 0; font-size: 14px; font-weight: 600; }
.card-desc { margin: 2px 0 0; font-size: 13px; color: var(--ink-muted); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat-label { margin: 0; font-size: 11px; color: var(--ink-subtle); }
.stat-value { margin: 4px 0 0; font-size: 14px; font-weight: 600; }
.bar { height: 8px; background: var(--muted); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #3ddc64, #0ea5e9); border-radius: 99px; }
.host-panel {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 220, 100, 0.16), transparent),
    var(--elev);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}
.host-panel-inner { display: grid; gap: 24px; padding: 28px; }
@media (min-width: 900px) { .host-panel-inner { grid-template-columns: 1.2fr 0.8fr; } }
.host-panel h2 { font-family: var(--display); font-size: 32px; font-weight: 700; margin: 8px 0 0; letter-spacing: -0.03em; }
.host-steps { list-style: none; margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.8); }
.host-steps li { display: flex; gap: 12px; margin-top: 12px; }
.host-steps li:first-child { margin-top: 0; }
.host-n { width: 28px; height: 28px; border-radius: 99px; background: var(--accent-muted); color: #065f46; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.host-hosts { padding: 20px 28px 28px; border-top: 1px solid var(--border); background: var(--surface); }
.host-btn {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  border: 1px solid var(--border); background: var(--elev); border-radius: 12px;
  padding: 14px; text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%;
}
.host-btn:hover { border-color: var(--accent); background: rgba(220,252,231,0.4); }
.chart { height: 220px; width: 100%; }
.chart svg { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-muted); margin-top: 8px; }
.legend b { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; }
.monitor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; text-align: center; }
.monitor-grid div { background: var(--muted); border-radius: 8px; padding: 8px 4px; }
.monitor-grid p { margin: 0; font-size: 14px; font-weight: 600; }
.monitor-grid span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-subtle); }
.dash-split { display: grid; gap: 16px; }
@media (min-width: 1100px) { .dash-split { grid-template-columns: 2fr 1fr; } }
.dash-split > .card { margin-bottom: 0; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-subtle); margin: 0 0 8px; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.steps button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-subtle); cursor: pointer; padding: 8px 12px; border-radius: 8px; }
.steps button.on { background: var(--accent-muted); color: var(--brand); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.mp-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  font-family: var(--sans);
  color: var(--ink);
}
.mp-chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 16px 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(11, 31, 51, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mp-chat-fab:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(11, 31, 51, 0.32); }
.mp-chat-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mp-chat.is-open .mp-chat-fab { display: none; }
.mp-chat-fab-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-chat-fab-ico .ico { width: 18px; height: 18px; }
.mp-chat-fab-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding-right: 8px;
  text-align: left;
}
.mp-chat-fab-copy strong {
  font: 700 13px/1.1 var(--display);
  letter-spacing: -0.01em;
}
.mp-chat-fab-copy em {
  font: 500 10px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.mp-chat-panel[hidden] { display: none !important; }
.mp-chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(392px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 40px));
  background: #fff;
  border: 1px solid rgba(11, 31, 51, 0.08);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(11, 31, 51, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: mp-chat-in 0.22s ease;
}
@keyframes mp-chat-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.mp-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(180deg, #10263d, var(--brand));
  color: #fff;
}
.mp-chat-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mp-chat-ava {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.mp-chat-ava img { width: 22px; height: 22px; object-fit: contain; }
.mp-chat-head p {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.mp-chat-head .mp-chat-brand span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}
.mp-chat-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(61, 220, 100, 0.22);
}
.mp-chat-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-chat-close:hover { background: rgba(255, 255, 255, 0.16); }
.mp-chat-close .ico { width: 16px; height: 16px; }
.mp-chat-log {
  flex: 1;
  overflow: auto;
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(61, 220, 100, 0.08), transparent 60%),
    #f7faf8;
}
.mp-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}
.mp-chat-row.bot { align-self: stretch; }
.mp-chat-row.user { align-self: flex-end; justify-content: flex-end; }
.mp-chat-row .mp-chat-ava {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: none;
}
.mp-chat-row .mp-chat-ava img { width: 16px; height: 16px; }
.mp-chat-msg {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.mp-chat-msg.bot {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(11, 31, 51, 0.04);
}
.mp-chat-msg.user {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.mp-chat-msg.pending {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 10px 14px;
}
.mp-chat-dots { display: inline-flex; gap: 4px; }
.mp-chat-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: mp-chat-dot 1s ease-in-out infinite;
}
.mp-chat-dots i:nth-child(2) { animation-delay: 0.15s; }
.mp-chat-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes mp-chat-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.mp-chat-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 4px 36px;
}
.mp-chat-prompts[hidden] { display: none !important; }
.mp-chat-prompts button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: #065f46;
  font: 600 12px/1 var(--sans);
  padding: 8px 11px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(11, 31, 51, 0.04);
}
.mp-chat-prompts button:hover { border-color: var(--accent); background: var(--accent-muted); }
.mp-chat-prompts button .ico { width: 13px; height: 13px; }
.mp-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 14px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.mp-chat-form input.mp-chat-input {
  flex: 1;
  width: auto;
  height: 44px;
  margin: 0;
  border-radius: 999px;
  background: #f7faf8;
  font-size: 13px;
}
.mp-chat-form button[type="submit"] {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(61, 220, 100, 0.28);
}
.mp-chat-form button[type="submit"]:hover { filter: brightness(0.97); }
.mp-chat-form button .ico { width: 16px; height: 16px; }
@media (max-width: 480px) {
  .mp-chat { right: 12px; bottom: 12px; }
  .mp-chat-fab { width: 56px; height: 56px; padding: 0; justify-content: center; }
  .mp-chat-fab-copy { display: none; }
  .mp-chat-fab-ico { width: 56px; height: 56px; }
  .mp-chat-panel {
    width: calc(100vw - 24px);
    height: min(640px, calc(100vh - 24px));
    border-radius: 20px;
  }
}
body.legal { background: var(--paper, #f5f6f3); }
