:root {
  color-scheme: light;
  font-family: Inter, "Geist", "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-product: Inter, "Geist", "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f5f8ff;
  --panel: #ffffff;
  --panel-soft: #f5f8ff;
  --panel-strong: #e6eaf4;
  --line: #d1d6e5;
  --line-soft: #e6eaf4;
  --text: #333b52;
  --heading: #0d0f2c;
  --muted: #656c86;
  --subtle: #969bb5;
  --primary: #3e57da;
  --primary-soft: #eef3ff;
  --primary-deep: #1f235b;
  --success: #1a280b;
  --success-soft: #ebf6df;
  --warning: #42230a;
  --warning-soft: #fffadb;
  --danger: #9f2f1d;
  --danger-soft: #fff1ec;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 2px 16px rgba(16, 24, 40, 0.08);
  --shadow-ring: rgb(209, 214, 229) 0 0 0 1px, rgba(16, 24, 40, 0.08) 0 2px 16px;
  --surface-tint: rgba(198, 215, 254, 0.18);
  --surface-tint-strong: rgba(198, 215, 254, 0.28);
  --surface-tint-soft: rgba(227, 235, 255, 0.5);
  --radius-control: 12px;
  --radius-panel: 16px;
  --radius-card: 24px;
  --work-card-min-height: calc(100vh - 118px);
  --work-card-inner-height: calc(var(--work-card-min-height) - 92px);
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 248, 255, 0.98) 44%, rgba(238, 243, 255, 1) 100%),
    var(--bg);
  font-family: var(--font-product);
  letter-spacing: 0;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card p {
  margin-top: 4px;
  color: var(--muted);
}

.auth-remember {
  margin-top: 2px;
}

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

button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid rgba(209, 214, 229, 0.92);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-deep);
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03), 0 4px 12px rgba(16, 24, 40, 0.04);
  font-weight: 650;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button:hover:not(:disabled),
.icon-button:hover {
  border-color: #c6d7fe;
  background: #f8fbff;
  color: var(--primary);
  box-shadow: 0 8px 22px rgba(62, 87, 218, 0.12);
  transform: translateY(-1px);
}

button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.selectable-value:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(62, 87, 218, 0.14), 0 2px 10px rgba(16, 24, 40, 0.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 1;
  border-color: #d7dee8;
  background: #eef2f8;
  color: #7c849d;
  box-shadow: none;
  transform: none;
}

.btn {
  min-height: 40px;
  border-radius: 999px;
  padding-inline: 16px;
  font-weight: 750;
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(62, 87, 218, 0.24);
}

.btn-primary:hover:not(:disabled) {
  border-color: #3248c6;
  background: #3248c6;
  color: #fff;
  box-shadow: 0 12px 28px rgba(62, 87, 218, 0.3);
}

.btn-primary:disabled {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--muted);
}

.btn-soft {
  border-color: #c6d7fe;
  background: #f8fbff;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(62, 87, 218, 0.08);
}

.btn-soft:hover:not(:disabled) {
  border-color: #9fb7ff;
  background: var(--primary-soft);
  color: #2f46c8;
  box-shadow: 0 8px 20px rgba(62, 87, 218, 0.14);
}

.btn-soft:disabled {
  border-color: #d7dee8;
  background: #f1f5f9;
  color: #64748b;
}

.btn-danger {
  border-color: #ffd7cc;
  background: #fff7f3;
  color: var(--danger);
  box-shadow: 0 4px 12px rgba(159, 47, 29, 0.08);
}

.btn-danger:hover:not(:disabled) {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 8px 20px rgba(159, 47, 29, 0.12);
}

.btn-danger:disabled {
  border-color: #d7dee8;
  background: #f1f5f9;
  color: #64748b;
}

.btn-disabled,
.btn-disabled:disabled {
  border-color: #d7dee8;
  background: #eef2f7;
  color: #8a98aa;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 999px;
}

.btn-verify {
  border-color: #bfe8d1;
  background: #effcf4;
  color: #15803d;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.08);
}

.btn-verify:hover:not(:disabled) {
  border-color: #86d4a8;
  background: #dcfce7;
  color: #166534;
  box-shadow: 0 8px 20px rgba(21, 128, 61, 0.14);
}

.btn-with-help {
  position: relative;
  gap: 6px;
  overflow: visible;
}

.help-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: currentColor;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.help-dot::after {
  position: absolute;
  right: -8px;
  bottom: calc(100% + 9px);
  z-index: 500;
  width: 260px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(3px);
  transition: opacity 140ms ease, transform 140ms ease;
  content: attr(data-tooltip);
}

.help-dot::before {
  position: absolute;
  right: 2px;
  bottom: calc(100% + 4px);
  z-index: 501;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  opacity: 0;
  pointer-events: none;
  transform: rotate(45deg) translateY(3px);
  transition: opacity 140ms ease, transform 140ms ease;
  content: "";
}

.help-dot:hover::after,
.help-dot:focus-visible::after,
.help-dot:hover::before,
.help-dot:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

.help-dot:hover::before,
.help-dot:focus-visible::before {
  transform: rotate(45deg) translateY(0);
}

.btn-icon-only {
  min-width: 30px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.modal-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-confirm {
  width: min(460px, calc(100vw - 32px));
}

.confirm-card {
  gap: 16px;
}

.add-account-button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #22c55e;
  color: #fff;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.24);
}

.add-account-button:hover:not(:disabled),
.add-account-button:focus-visible {
  background: #16a34a;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.28);
}

button::before {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-block;
  background: currentColor;
  mask: var(--btn-icon) center / 14px 14px no-repeat;
  content: "";
}

.add-account-button::before {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-block;
  background: currentColor;
  mask: var(--btn-icon) center / 14px 14px no-repeat;
  content: "";
}

button:not([data-send-email], [data-resend], [data-copy-webhook], [data-open-account-create], [data-save-account], [data-save-modal-rule], [data-save-rules-modal], [data-modal-load-samples], [data-load-more-emails], [data-add-static-field], [data-add-meta-field], [data-add-webhook], [data-remove-webhook], [data-remove-field], [data-stage-delete-rule], [data-sync], [data-open-account-edit], [data-open-account-rules], [data-delete-account])::before,
.nav-item::before,
.custom-select-trigger::before,
.pager button::before {
  content: none;
}

[data-send-email],
[data-confirm-email-bulk="send"],
[data-preview-rule],
[data-test-rule],
[data-test-telegram] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 11 21 3l-8 18-2-7-8-3zm6.2-.5 3.1 1.2 1.2 3.4 3.2-7.7-7.5 3.1z'/%3E%3C/svg%3E");
}

[data-preview-rule] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 4a6.5 6.5 0 0 1 5.2 10.4l4 4-1.4 1.4-4-4A6.5 6.5 0 1 1 10.5 4zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9zm-.8 2.2h1.7v1.3H9.7V8.2zm0 2.2h1.7v3H9.7v-3z'/%3E%3C/svg%3E");
}

[data-resend],
[data-sync] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.7 6.3A8 8 0 1 0 20 12h-2a6 6 0 1 1-1.8-4.3L13 11h8V3l-3.3 3.3z'/%3E%3C/svg%3E");
}

[data-open-account-create],
[data-add-static-field],
[data-add-meta-field],
[data-add-webhook] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z'/%3E%3C/svg%3E");
}

[data-save-account],
[data-save-modal-rule],
[data-save-rules-modal] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m9.2 16.2-3.4-3.4L4.4 14.2l4.8 4.8L20 8.2l-1.4-1.4-9.4 9.4z'/%3E%3C/svg%3E");
}

[data-modal-load-samples],
[data-load-more-emails] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4h2v8l3-3 1.4 1.4L12 15.8l-5.4-5.4L8 9l3 3V4zM5 18h14v2H5v-2z'/%3E%3C/svg%3E");
}

[data-open-account-edit] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 17.2V20h2.8L17.6 9.2l-2.8-2.8L4 17.2zM19.7 7.1a1 1 0 0 0 0-1.4l-1.4-1.4a1 1 0 0 0-1.4 0l-1 1 2.8 2.8 1-1z'/%3E%3C/svg%3E");
}

[data-open-account-rules] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16v3H4V5zm0 5h10v3H4v-3zm0 5h16v3H4v-3zm13.5-5 1.3 1.3L21 9.1l1.4 1.4-3.6 3.6-2.7-2.7 1.4-1.4z'/%3E%3C/svg%3E");
}

[data-delete-account],
[data-remove-field],
[data-remove-webhook],
[data-stage-delete-rule],
[data-confirm-email-bulk="delete"] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 4h8l1 2h4v2H3V6h4l1-2zm1 6h2v8H9v-8zm4 0h2v8h-2v-8zM6 10h12l-1 10H7L6 10z'/%3E%3C/svg%3E");
}

[data-copy-webhook] {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 3h10a2 2 0 0 1 2 2v10h-2V5H8V3zM4 7h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2zm0 2v10h10V9H4z'/%3E%3C/svg%3E");
}

[data-copy-webhook].copied {
  --btn-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m9.2 16.2-3.4-3.4L4.4 14.2l4.8 4.8L20 8.2l-1.4-1.4-9.4 9.4z'/%3E%3C/svg%3E");
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(209, 214, 229, 0.92);
  border-radius: 14px;
  padding: 10px 15px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(16, 24, 40, 0.02), 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: #c6d7fe;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 15px,
    calc(100% - 11px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--heading);
  font-weight: 750;
}

h2 {
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--heading);
  font-weight: 750;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f9ff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
  padding: 8px;
  margin: 8px 0 0;
  color: var(--heading);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #0d0f2c 0%, #151944 66%, #10133a 100%);
  color: #f8fafc;
  border-right: 0;
  box-shadow: 18px 0 46px rgba(13, 15, 44, 0.16);
}

.brand {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(198, 215, 254, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand strong {
  font-size: 21px;
  line-height: 1.1;
}

.brand span {
  color: #c6d7fe;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-version {
  position: absolute;
  right: 9px;
  bottom: 6px;
  color: rgba(220, 230, 255, 0.72);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  border: 0;
  background: transparent;
  color: #c6d7fe;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 650;
  box-shadow: none;
}

.side-nav .nav-item.active {
  background: linear-gradient(180deg, #526bfa 0%, #3e57da 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(62, 87, 218, 0.32);
}

.side-nav .nav-item:hover,
.side-nav .nav-item:focus-visible {
  background: rgba(128, 152, 249, 0.18);
  color: #fff;
}

.ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-block;
  color: currentColor;
  background: currentColor;
  mask: var(--icon) center / 16px 16px no-repeat;
}

.icon-mail {
  --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6h16v12H4V6zm2 2v.35l6 4.1 6-4.1V8H6zm12 8v-5.25l-6 4.1-6-4.1V16h12z'/%3E%3C/svg%3E");
}

.icon-leads {
  --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 4h10l4 4v12H5V4zm9 2H7v12h10V9h-3V6zM8.5 11h7v1.6h-7V11zm0 3h7v1.6h-7V14z'/%3E%3C/svg%3E");
}

.icon-webhooks {
  --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 7a5 5 0 0 1 8.7-3.4l1.9 1.9-1.4 1.4-1.9-1.9A3 3 0 0 0 10 9.2l1.3 1.3-1.4 1.4L8.6 10.6A5 5 0 0 1 7 7zm6.9 5.1 1.4-1.4 1.3 1.3A3 3 0 0 0 20.8 7.8l-1.9-1.9 1.4-1.4 1.9 1.9a5 5 0 0 1-7.1 7.1l-1.2-1.4zM8.7 16.7l8-8 1.4 1.4-8 8-1.4-1.4zM2 18a4 4 0 0 1 6.8-2.8l1.1 1.1-1.4 1.4-1.1-1.1A2 2 0 1 0 7.4 20l1.1-1.1 1.4 1.4-1.1 1.1A4 4 0 0 1 2 18z'/%3E%3C/svg%3E");
}

.icon-alert {
  --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3 2 20h20L12 3zm0 4 6.6 11H5.4L12 7zm-1 4h2v4h-2v-4zm0 5h2v2h-2v-2z'/%3E%3C/svg%3E");
}

.icon-settings {
  --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.8 3h2.4l.5 2.2c.6.2 1.1.4 1.6.7l2-1.2 1.7 1.7-1.2 2c.3.5.5 1 .7 1.6l2.2.5v2.4l-2.2.5c-.2.6-.4 1.1-.7 1.6l1.2 2-1.7 1.7-2-1.2c-.5.3-1 .5-1.6.7l-.5 2.2h-2.4l-.5-2.2c-.6-.2-1.1-.4-1.6-.7l-2 1.2L5 17.3l1.2-2c-.3-.5-.5-1-.7-1.6L3.3 13v-2.4l2.2-.5c.2-.6.4-1.1.7-1.6L5 6.5l1.7-1.7 2 1.2c.5-.3 1-.5 1.6-.7L10.8 3zM12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E");
}

.icon-logout {
  --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 4h8v2H7v12h6v2H5V4zm10.4 4.4 1.4-1.4L22 12l-5.2 5-1.4-1.4 2.7-2.6H10v-2h8.1l-2.7-2.6z'/%3E%3C/svg%3E");
}

.nav-bottom {
  margin-top: auto;
}

.nav-logout {
  color: #ffb4a8;
}

.side-nav .nav-logout:hover,
.side-nav .nav-logout:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fecaca;
}

.workspace {
  min-width: 0;
  padding: 28px;
  display: grid;
  gap: 20px;
  align-content: start;
  background:
    linear-gradient(90deg, rgb(227, 235, 255), rgb(198, 215, 254) 50%, rgb(128, 152, 249)),
    var(--bg);
}

.workspace-head,
.section-head,
.item-row,
.modal-head,
.modal-actions,
.rule-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.left-actions {
  justify-content: flex-start;
}

.workspace-head {
  min-height: 48px;
  padding: 0 2px;
  border-bottom: 0;
}

.workspace-head h1 {
  font-size: 32px;
  line-height: 1.2;
}

.section-head h2 {
  font-size: 20px;
}

.workspace-head p {
  display: none;
}

.modal-head p,
.muted,
small {
  color: var(--muted);
  font-size: 13px;
}

.view {
  display: none;
}

.app-notice {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid #c6d7fe;
  border-radius: 18px;
  background: rgba(238, 243, 255, 0.96);
  color: var(--primary-deep);
  padding: 11px 12px 11px 14px;
  font-size: 13px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.16);
  backdrop-filter: blur(10px);
  animation: toast-in 190ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-notice.hidden {
  display: none;
}

.app-notice.leaving {
  pointer-events: none;
  animation: toast-out 180ms ease-in forwards;
}

.app-notice button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  box-shadow: none;
  font-size: 18px;
  line-height: 1;
}

.app-notice button:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: none;
}

.app-notice.success {
  border-color: rgba(143, 190, 112, 0.55);
  background: rgba(235, 246, 223, 0.96);
  color: var(--success);
}

.app-notice.error {
  border-color: #ffd2ca;
  background: rgba(255, 241, 236, 0.96);
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.view.active {
  display: block;
}

#leads-view.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

#leads {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: var(--work-card-inner-height);
  min-height: 0;
}

#logs-view.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

#logs {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: var(--work-card-inner-height);
  min-height: 0;
}

#mail-view.active {
  display: grid;
  grid-template-columns: 356px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.accounts-column,
.mail-column,
#leads-view,
#webhooks-view,
#logs-view,
#settings-view {
  position: relative;
  height: var(--work-card-min-height);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(227, 235, 255, 0.58) 100%);
  border: 1px solid rgba(209, 214, 229, 0.84);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

#webhooks-view.active {
  display: grid;
  min-height: 0;
}

.placeholder-panel {
  display: grid;
  height: var(--work-card-inner-height);
  place-items: center;
}

.empty-webhooks {
  --empty-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 7a5 5 0 0 1 8.7-3.4l1.9 1.9-1.4 1.4-1.9-1.9A3 3 0 0 0 10 9.2l1.3 1.3-1.4 1.4L8.6 10.6A5 5 0 0 1 7 7zm6.9 5.1 1.4-1.4 1.3 1.3A3 3 0 0 0 20.8 7.8l-1.9-1.9 1.4-1.4 1.9 1.9a5 5 0 0 1-7.1 7.1l-1.2-1.4zM8.7 16.7l8-8 1.4 1.4-8 8-1.4-1.4zM2 18a4 4 0 0 1 6.8-2.8l1.1 1.1-1.4 1.4-1.1-1.1A2 2 0 1 0 7.4 20l1.1-1.1 1.4 1.4-1.1 1.1A4 4 0 0 1 2 18z'/%3E%3C/svg%3E");
}

.accounts-column {
  z-index: 10;
  overflow: visible;
}

.mail-column {
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

#emails {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: var(--work-card-inner-height);
  min-height: 0;
}

.account-list,
.account-card {
  overflow: visible;
}

.account-list,
.mail-list,
.list,
.stack,
.field-list {
  display: grid;
  gap: 8px;
}

.section-head {
  min-height: 38px;
  margin-bottom: 10px;
}

.mail-column > .section-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 142px 104px 44px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 10px;
  padding: 0 14px;
}

.account-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  width: 100%;
  min-height: 92px;
  text-align: left;
  align-items: start;
  padding: 12px 12px 36px;
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.account-card:hover:not(:disabled) {
  transform: none;
  border-color: #c6d7fe;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.account-card.selected {
  border-color: #c6d7fe;
  background: #fff;
  box-shadow: inset 4px 0 0 var(--primary), 0 12px 28px rgba(62, 87, 218, 0.12);
}

.account-card strong,
.account-card small,
.mail-row strong,
.mail-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger-line {
  color: var(--danger);
}

.rule-dot {
  grid-column: 1 / 2;
  display: grid;
  gap: 3px;
  min-width: 0;
  max-width: 190px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.rule-dot:not(.list) {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--panel-strong);
  white-space: nowrap;
}

.rule-line {
  display: grid;
  grid-template-columns: 96px 38px;
  gap: 7px;
  align-items: center;
  width: 168px;
  max-width: 100%;
  min-height: 19px;
  border-radius: 0;
  padding: 0;
  background: transparent;
  white-space: nowrap;
}

.rule-line.on {
  color: inherit;
  background: transparent;
}

.rule-line.off {
  color: inherit;
  background: transparent;
}

.rule-title {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.rule-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 18px;
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 700;
  text-align: right;
}

.rule-state::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.rule-line.on .rule-state {
  background: var(--success-soft);
  color: var(--success);
}

.rule-line.off .rule-state {
  background: var(--danger-soft);
  color: var(--danger);
}

.actions-menu {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.test-webhook-menu {
  position: relative;
  right: auto;
  bottom: auto;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.test-webhook-menu .menu {
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  min-width: 220px;
}

.actions-menu .icon-button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-deep);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
}

.actions-menu .icon-button:hover {
  transform: none;
}

.menu {
  position: absolute;
  right: 0;
  top: 32px;
  z-index: 1000;
  min-width: 196px;
  display: grid;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.16);
  backdrop-filter: blur(10px);
}

.menu span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}

.custom-select {
  position: relative;
  min-width: 150px;
}

.custom-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  justify-content: stretch;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px 9px 14px;
  border: 1px solid rgba(209, 214, 229, 0.92);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03), 0 4px 12px rgba(16, 24, 40, 0.04);
  font-weight: 650;
}

.custom-select.open .custom-select-trigger,
.field-type-select.open .custom-select-trigger {
  border-color: #9db6fb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(62, 87, 218, 0.12), 0 8px 22px rgba(16, 24, 40, 0.1);
}

.custom-select-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.custom-select-caret {
  justify-self: end;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.custom-select-caret::before {
  width: 14px;
  height: 14px;
  display: block;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m7 9 5 5 5-5H7z'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  content: "";
}

.custom-select.open .custom-select-caret,
.field-type-select.open .custom-select-caret {
  transform: rotate(180deg);
  background: var(--primary);
  color: #fff;
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.lead-filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(220px, 320px);
  align-items: center;
}

.lead-filter-row input {
  min-height: 38px;
  border-radius: 999px;
}

.sender-filter {
  width: min(420px, 100%);
}

.sender-filter-box {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid rgba(209, 214, 229, 0.92);
  border-radius: 999px;
  padding: 4px 8px 4px 13px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03), 0 4px 12px rgba(16, 24, 40, 0.04);
}

.sender-filter-box.open {
  border-color: #9db6fb;
  box-shadow: 0 0 0 4px rgba(62, 87, 218, 0.12), 0 8px 22px rgba(16, 24, 40, 0.1);
}

.sender-filter-icon {
  width: 16px;
  height: 16px;
  background: var(--primary);
  opacity: 0.82;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4a6 6 0 0 1 4.8 9.6l4.3 4.3-1.4 1.4-4.3-4.3A6 6 0 1 1 10 4zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.sender-filter-box input {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--heading);
}

.sender-filter-box input:focus-visible {
  box-shadow: none;
}

.sender-filter-clear {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  border-radius: 999px;
  padding: 0;
  color: var(--muted);
  box-shadow: none;
}

.sender-suggest-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: min(460px, 100%);
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.16);
  backdrop-filter: blur(10px);
}

.sender-suggest-menu button {
  justify-content: flex-start;
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 7px 10px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
}

.sender-suggest-menu button:hover {
  background: linear-gradient(180deg, #f7faff 0%, #eef3ff 100%);
  color: var(--primary);
}

.custom-select-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: max(100%, 220px);
  min-width: 100%;
  max-width: min(420px, calc(100vw - 32px));
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.16);
  backdrop-filter: blur(10px);
}

.custom-select-menu button {
  justify-content: flex-start;
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
  border-radius: 12px;
  transform: none;
}

.custom-select-menu button:hover,
.custom-select-menu button.active {
  background: linear-gradient(180deg, #f7faff 0%, #eef3ff 100%);
  color: var(--primary);
  box-shadow: none;
  transform: none;
}

.custom-select-menu button.active {
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--primary);
}

.section-head-filter-left {
  justify-content: flex-start;
}

.section-head-filter-left h2 {
  order: 2;
}

.section-head-filter-left .custom-select {
  min-width: 260px;
  max-width: 360px;
}

.mail-filter-wrap {
  display: grid;
  grid-column: 1 / 3;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#mail-list-meta {
  position: relative;
  display: grid;
  grid-column: 3 / 6;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

#mail-list-meta strong {
  color: var(--primary);
  font-size: 13px;
}

.bulk-actions-menu {
  position: relative;
  justify-self: end;
  right: auto;
  bottom: auto;
  display: inline-flex;
  align-items: center;
  height: 30px;
}

.bulk-actions-menu .menu {
  right: 0;
  left: auto;
}

.bulk-actions-menu .icon-button {
  min-width: 104px;
  min-height: 30px;
  padding: 5px 10px;
  border-color: var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, #eef3ff 100%);
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(62, 87, 218, 0.12);
  font-size: 12px;
}

.bulk-actions-menu .icon-button:hover {
  background: var(--primary);
  color: #fff;
  transform: none;
}

.check-control {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.check-control input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-control span {
  width: 18px;
  height: 18px;
  border: 1px solid #bed0fd;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 8px rgba(62, 87, 218, 0.08);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.check-control:hover span {
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(62, 87, 218, 0.16);
}

.check-control input:checked + span,
.check-control input:indeterminate + span {
  border-color: var(--primary);
  background:
    var(--btn-icon, url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='m9.2 16.2-3.4-3.4L4.4 14.2l4.8 4.8L20 8.2l-1.4-1.4-9.4 9.4z'/%3E%3C/svg%3E")) center / 13px 13px no-repeat,
    var(--primary);
}

.check-control input:indeterminate + span {
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M6 11h12v2H6z'/%3E%3C/svg%3E") center / 13px 13px no-repeat,
    var(--primary);
}

.menu span:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.menu [data-delete-account] {
  color: var(--danger);
}

.hidden {
  display: none;
}

.mail-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 142px 104px 44px;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid rgba(209, 214, 229, 0.92);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease;
}

.mail-column .sender-filter,
.mail-column .sender-filter-box {
  width: 100%;
  min-width: 0;
}

.mail-check {
  justify-self: start;
}

.mail-main {
  min-width: 0;
}

.mail-state {
  display: grid;
  gap: 5px;
  justify-items: end;
  justify-self: end;
  width: 142px;
}

.mail-date {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.mail-state .status-badge {
  justify-self: end;
  width: 118px;
  max-width: 118px;
}

.mail-leads-button {
  width: 104px;
  justify-self: end;
}

.mail-row [data-send-email] {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: #9fb7ff;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(62, 87, 218, 0.22);
}

.mail-row [data-send-email]::before {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  mask-size: 18px 18px;
}

.mail-row [data-send-email]:hover:not(:disabled) {
  border-color: #3248c6;
  background: #3248c6;
  color: #fff;
  box-shadow: 0 10px 22px rgba(62, 87, 218, 0.3);
}

.mail-row [data-send-email]:disabled {
  border-color: #d7dee8;
  background: #eef3ff;
  color: #94a3b8;
  box-shadow: none;
}

.mail-row:hover {
  border-color: #c6d7fe;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: inset 4px 0 0 rgba(62, 87, 218, 0.78), 0 10px 24px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.mail-row-email_error {
  border-color: rgba(239, 68, 68, 0.32);
  box-shadow: inset 4px 0 0 var(--danger), 0 1px 0 rgba(16, 24, 40, 0.03);
}

.mail-row-email_error:hover {
  border-color: rgba(239, 68, 68, 0.46);
  box-shadow: inset 4px 0 0 var(--danger), 0 10px 24px rgba(239, 68, 68, 0.12);
}

.sample-picker-list {
  max-height: 62vh;
  overflow: auto;
}

.sample-picker-row {
  width: 100%;
  text-align: left;
}

.sample-picker-row.selected {
  border-color: #c6d7fe;
  background: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.sample-picker-row.disabled-sample {
  border-color: #ffd2ca;
  background: #fff7f5;
  color: #8c1d18;
  cursor: not-allowed;
}

.sample-picker-row.disabled-sample:hover {
  border-color: #ffd2ca;
  background: #fff7f5;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 12px;
  min-height: 420px;
}

.preview-grid .mail-row {
  grid-template-columns: minmax(0, 1fr) 150px 118px;
}

.preview-result {
  min-height: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.preview-result h3 {
  margin: 12px 0 6px;
  font-size: 14px;
}

.preview-result pre {
  max-height: 180px;
  overflow: auto;
  border-radius: var(--radius-control);
  padding: 9px;
  background: #fff;
  font-size: 12px;
}

.preview-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 750;
}

.preview-status.good {
  background: var(--success-soft);
  color: var(--success);
}

.preview-status.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.mail-row button {
  justify-self: end;
  width: 116px;
  min-width: 116px;
}

.list-action-button,
.mail-row button.list-action-button,
.lead-resend {
  width: 104px;
  min-width: 104px;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.list-action-button.is-loading {
  position: relative;
  overflow: hidden;
}

.list-action-button.is-loading::after {
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(62, 87, 218, 0.16), transparent);
  animation: load-fill 900ms ease-in-out infinite;
  content: "";
}

.mail-row button[data-send-email] {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
}

.lead-resend {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: #9fb7ff;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(62, 87, 218, 0.22);
}

.lead-resend::before {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  mask-size: 18px 18px;
}

.lead-resend:hover:not(:disabled) {
  border-color: #3248c6;
  background: #3248c6;
  color: #fff;
  box-shadow: 0 10px 22px rgba(62, 87, 218, 0.3);
}

.mail-list {
  min-height: 0;
  align-content: start;
}

.load-previous-slot {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.pager-slot {
  min-height: 40px;
  display: flex;
  align-items: end;
  justify-content: center;
}

.mail-list-empty {
  min-height: 280px;
  place-content: center;
}

.centered-empty {
  text-align: center;
  border-style: dashed;
}

.load-previous-mails {
  position: relative;
  overflow: visible;
  justify-self: center;
  margin-top: 6px;
}

.load-previous-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.load-previous-mails span {
  position: relative;
  z-index: 1;
}

.load-previous-mails.loading::after {
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.28), rgba(37, 99, 235, 0.08));
  animation: load-fill 900ms ease-in-out infinite;
  content: "";
}

@keyframes load-fill {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(235%);
  }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 0 0;
}

.pager button {
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  padding: 0 8px;
}

.pager button:hover:not(:disabled) {
  background: var(--primary-soft);
  color: var(--primary);
}

.pager button.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.pager button:disabled {
  opacity: 0.35;
  background: transparent;
}

.pager-arrow {
  font-size: 22px;
  line-height: 1;
}

.pager-ellipsis {
  min-width: 14px;
  text-align: center;
  color: #7f90d8;
  font-weight: 800;
}

.pager-ellipsis.ghost {
  color: #9fb2f5;
  opacity: 0.42;
}

.item,
.settings-block,
.empty-state {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.item {
  display: grid;
  gap: 4px;
}

.lead-item {
  padding: 0;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.lead-item:hover {
  border-color: #c6d7fe;
  box-shadow: inset 4px 0 0 rgba(62, 87, 218, 0.78), 0 10px 24px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.leads-list {
  min-height: 0;
  align-content: start;
}

.leads-list-empty {
  place-content: center;
}

.lead-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px 136px 116px;
  gap: 8px;
  align-items: center;
  position: relative;
  min-height: 58px;
  padding: 9px 12px;
  cursor: pointer;
}

.lead-title-cell {
  min-width: 0;
}

.lead-title-cell strong,
.lead-title-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-date {
  width: 164px;
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.lead-summary .status-badge {
  justify-self: center;
  width: 136px;
  max-width: 136px;
}

.lead-actions {
  display: inline-flex;
  gap: 6px;
  justify-self: end;
  justify-content: flex-end;
  width: 44px;
  max-width: 100%;
}

.lead-actions [data-cancel-lead] {
  position: static;
}

.lead-cancel-delivery {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border-color: #ffd7cc;
  background: #fff7f3;
  color: var(--danger);
  box-shadow: 0 8px 18px rgba(159, 47, 29, 0.08);
}

.lead-cancel-delivery::before {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6.4 5 12.6 12.6-1.4 1.4L5 6.4 6.4 5zm12.6 1.4L6.4 19 5 17.6 17.6 5 19 6.4z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  content: "";
}

.lead-cancel-delivery:hover:not(:disabled) {
  border-color: #ffb8a8;
  background: var(--danger-soft);
  color: var(--danger);
}

.lead-item > .muted,
.lead-item > .delivery-hint,
.lead-item > pre {
  margin-left: 10px;
  margin-right: 10px;
}

.lead-item > pre {
  margin-bottom: 10px;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 10px 10px;
}

.lead-detail-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(198, 215, 254, 0.22);
}

.lead-detail-grid strong {
  font-size: 11px;
  color: var(--muted);
}

.lead-detail-grid small {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webhook-copy-cell {
  grid-column: span 2;
}

.webhook-copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.webhook-copy-field em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-hook-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  border-color: #c6d7fe;
  background: #f8fbff;
  color: var(--primary);
  box-shadow: none;
}

.copy-hook-button::before {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
  mask: var(--btn-icon) center / 15px 15px no-repeat;
  content: "";
}

.copy-hook-button:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #e8edf5;
  color: var(--primary-deep);
}

.copy-hook-button.copied {
  border-color: var(--success-soft);
  background: var(--success-soft);
  color: var(--success);
}

.copy-hook-button.copied:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #e8edf5;
  color: var(--success);
}

.lead-item-compact {
  background: #fff;
}

.empty-state {
  color: var(--muted);
}

.centered-empty.empty-state {
  min-height: 168px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
}

.centered-empty.empty-state::before {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 999px;
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px #c6d7fe;
  content: "";
  mask: var(--empty-icon) center / 18px 18px no-repeat;
  background-color: var(--primary);
}

.centered-empty.empty-state strong {
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
}

.centered-empty.empty-state span {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty-mail,
.empty-accounts {
  --empty-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6h16v12H4V6zm2 2v.35l6 4.1 6-4.1V8H6zm12 8v-5.25l-6 4.1-6-4.1V16h12z'/%3E%3C/svg%3E");
}

.empty-leads,
.empty-fields {
  --empty-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 4h10l4 4v12H5V4zm9 2H7v12h10V9h-3V6zM8.5 11h7v1.6h-7V11zm0 3h7v1.6h-7V14z'/%3E%3C/svg%3E");
}

.empty-logs {
  --empty-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3 2 20h20L12 3zm0 4 6.6 11H5.4L12 7zm-1 4h2v4h-2v-4zm0 5h2v2h-2v-2z'/%3E%3C/svg%3E");
}

.empty-settings {
  --empty-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.8 3h2.4l.5 2.2c.6.2 1.1.4 1.6.7l2-1.2 1.7 1.7-1.2 2c.3.5.5 1 .7 1.6l2.2.5v2.4l-2.2.5c-.2.6-.4 1.1-.7 1.6l1.2 2-1.7 1.7-2-1.2c-.5.3-1 .5-1.6.7l-.5 2.2h-2.4l-.5-2.2c-.6-.2-1.1-.4-1.6-.7l-2 1.2L5 17.3l1.2-2c-.3-.5-.5-1-.7-1.6L3.3 13v-2.4l2.2-.5c.2-.6.4-1.1.7-1.6L5 6.5l1.7-1.7 2 1.2c.5-.3 1-.5 1.6-.7L10.8 3zM12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E");
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  max-width: 126px;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  text-align: center;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.status-badge.good {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.work {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-badge.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.neutral {
  background: var(--panel-strong);
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.delivery-hint {
  margin-top: 6px;
  border: 1px solid #ffd7cc;
  border-radius: var(--radius-control);
  background: var(--danger-soft);
  color: #8c1d18;
  padding: 8px;
  font-size: 13px;
}

.modal {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: var(--radius-card);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(13, 15, 44, 0.24);
  animation: modal-in 160ms ease-out;
}

.modal-wide {
  width: min(1180px, calc(100vw - 32px));
}

.email-leads-modal-card {
  width: min(980px, calc(100vw - 32px));
}

.email-leads-modal-list {
  display: grid;
  gap: 10px;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.44);
}

.modal-card {
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overflow-x: clip;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-tint-soft) 100%);
}

.modal-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  margin: 4px -24px -24px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  padding: 0;
  border-color: var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
  color: var(--muted);
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.08);
}

.modal-close:hover:not(:disabled) {
  border-color: #c6d7fe;
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateY(-1px);
}

.modal-close span {
  display: block;
  margin-top: -1px;
  font-size: 21px;
  line-height: 1;
}

.logs-panel > summary {
  cursor: pointer;
  font-weight: 700;
}

.settings-block {
  display: grid;
  gap: 10px;
}

.settings-block h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.settings-form-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.38fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(209, 214, 229, 0.72);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-row strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.settings-row small {
  font-size: 11px;
}

.settings-control {
  min-width: 0;
}

.settings-control input,
.settings-control select {
  min-height: 40px;
  border-color: transparent;
  border-radius: 999px;
  background-color: #fff;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.05), 0 1px 0 rgba(255, 255, 255, 0.8);
}

.settings-control input:focus,
.settings-control select:focus {
  border-color: #b7cdfd;
  box-shadow: 0 0 0 3px rgba(62, 87, 218, 0.12);
}

.webhook-list {
  display: grid;
  gap: 8px;
}

.webhook-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, rgba(198, 215, 254, 0.16) 100%);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.webhook-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 32px;
  gap: 8px;
  align-items: center;
}

.webhook-row-head strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webhook-row-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
}

.webhook-row-fields input[data-webhook-auth] {
  grid-column: 1 / -1;
}

.webhook-row-fields input {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
}

.webhook-remove-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
}

.settings-row:has(.webhook-list) {
  grid-template-columns: minmax(130px, 0.25fr) minmax(0, 1fr);
  align-items: start;
}

.settings-row:has(.webhook-list) > span:first-child {
  padding-top: 10px;
}

.settings-row:has(.webhook-list) .settings-control {
  display: grid;
  gap: 8px;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.inline-control .btn {
  min-height: 38px;
  border-radius: 999px;
  white-space: nowrap;
}

.sample-template-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  justify-items: start;
  width: 100%;
  min-height: 44px;
  margin-top: 9px;
  border-radius: 999px;
  padding-inline: 14px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-tint) 100%);
}

.sample-template-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.sample-template-button strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-template-button .help-dot {
  justify-self: end;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.switch-row span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.switch-row strong {
  font-size: 13px;
  line-height: 1.25;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-control::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transition: transform 160ms ease;
  content: "";
}

.switch-row input:checked + .switch-control {
  border-color: var(--primary);
  background: var(--primary);
}

.switch-row input:checked + .switch-control::after {
  transform: translateX(14px);
}

.switch-row:focus-within {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.inline-switch {
  display: inline-flex;
  align-items: center;
  width: 36px;
  min-height: 24px;
  justify-content: center;
}

.inline-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.inline-switch input:not(:checked) + .switch-control {
  border-color: var(--line);
  background: var(--panel-strong);
}

.inline-switch input:checked + .switch-control {
  border-color: var(--primary);
  background: var(--primary);
}

.inline-switch input:checked + .switch-control::after {
  transform: translateX(14px);
}

.inline-switch input:not(:checked) + .switch-control::after {
  transform: translateX(0);
}

.two-col,
.designer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.rule-settings {
  display: grid;
  gap: 10px;
}

.rule-block-list {
  display: grid;
  gap: 8px;
}

.rule-block {
  overflow: visible;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-tint) 100%);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03), 0 8px 22px rgba(16, 24, 40, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.rule-block.open {
  border-color: #c6d7fe;
  background: #fff;
  box-shadow: inset 4px 0 0 var(--primary), 0 14px 34px rgba(62, 87, 218, 0.12);
}

.rule-block-head {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 140ms ease;
}

.rule-block-head:hover {
  background: rgba(198, 215, 254, 0.18);
}

.rule-title-area {
  display: grid;
  grid-template-columns: minmax(300px, 390px) 182px;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.rule-block-title {
  display: grid;
  gap: 2px;
  min-width: 0;
  justify-content: stretch;
  min-height: 30px;
  padding: 0 2px;
  text-align: left;
}

.rule-block-title strong,
.rule-block-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-test-actions,
.rule-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rule-test-actions {
  justify-content: flex-start;
  width: 182px;
  min-width: 182px;
}

.rule-test-actions .btn {
  min-height: 30px;
  padding-inline: 10px;
}

.rule-head-actions {
  grid-column: 3;
  justify-content: flex-end;
  white-space: nowrap;
}

.rule-block-state {
  display: inline-flex;
  width: 18px;
  min-width: 18px;
  justify-content: center;
  align-items: center;
  color: var(--primary);
}

.caret-arrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.mini-switch {
  display: inline-flex;
  align-items: center;
  width: 36px;
  justify-content: center;
}

.mini-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mini-switch input:not(:checked) + .switch-control {
  border-color: var(--line);
  background: var(--panel-strong);
}

.mini-switch input:checked + .switch-control {
  border-color: var(--primary);
  background: var(--primary);
}

.mini-switch input:checked + .switch-control::after {
  transform: translateX(14px);
}

.mini-switch input:not(:checked) + .switch-control::after {
  transform: translateX(0);
}

.draft-active-label {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.rule-block-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.rule-summary {
  display: grid;
  grid-template-columns: 110px minmax(160px, 0.8fr) minmax(0, 1.4fr);
  gap: 8px;
  align-items: stretch;
}

.rule-summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(198, 215, 254, 0.16);
}

.rule-summary strong,
.rule-summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-summary strong {
  color: var(--text);
  font-size: 13px;
}

.rule-summary small {
  color: var(--muted);
  font-size: 11px;
}

.email-canvas {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(16, 24, 40, 0.03);
  white-space: pre-wrap;
  line-height: 1.65;
  outline: none;
}

.compact-canvas {
  max-height: none;
  overflow: visible;
}

.selectable-value {
  display: inline;
  border-radius: 4px;
  background: var(--primary-soft);
  color: #153f8f;
  cursor: pointer;
  padding: 1px 3px;
}

.selectable-value:hover,
.selectable-value:focus {
  background: #cfe0ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
  outline: none;
}

.field-chip {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-tint) 100%);
  border-left-width: 4px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03), 0 8px 20px rgba(16, 24, 40, 0.04);
}

.field-chip .item-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 30px;
}

.field-chip .item-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--heading);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-required {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
  font-weight: 750;
}

.field-required::before {
  content: "* ";
}

.field-type-select {
  position: relative;
  min-width: 0;
}

.field-type-trigger {
  width: 100%;
  max-width: none;
  border-color: transparent;
  border-radius: 999px;
  background-color: #fff;
  min-height: 40px;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.05);
}

.field-type-select .custom-select-menu {
  left: 0;
  right: 0;
  min-width: 100%;
  max-width: none;
  z-index: 40;
}

.field-tools {
  display: block;
  margin-bottom: 8px;
}

.field-add-button {
  width: 100%;
  justify-content: center;
  border-color: rgba(67, 96, 225, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  color: var(--primary);
  font-weight: 750;
}

.field-chip textarea {
  min-height: 72px;
  resize: vertical;
}

.static-field-value {
  width: 100%;
  border-color: rgba(67, 96, 225, 0.14);
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(16, 24, 40, 0.04);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  padding-top: 11px;
}

.static-field-value:focus {
  border-color: rgba(67, 96, 225, 0.55);
  box-shadow: 0 0 0 3px rgba(67, 96, 225, 0.13);
  outline: none;
}

.static-field-value::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.meta-field-note {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 8px;
  background: var(--panel-soft);
}

.selected-value {
  font-weight: 650;
}

.field-color-1 {
  border-color: #93c5fd;
}

.field-color-2 {
  border-color: #86efac;
}

.field-color-3 {
  border-color: #fcd34d;
}

.field-color-4 {
  border-color: #f0abfc;
}

.field-color-5 {
  border-color: #67e8f9;
}

.field-color-6 {
  border-color: #fca5a5;
}

.selectable-value.field-color-1 {
  background: #dbeafe;
  color: #1e3a8a;
}

.selectable-value.field-color-2 {
  background: #dcfce7;
  color: #14532d;
}

.selectable-value.field-color-3 {
  background: #fef3c7;
  color: #78350f;
}

.selectable-value.field-color-4 {
  background: #fae8ff;
  color: #701a75;
}

.selectable-value.field-color-5 {
  background: #cffafe;
  color: #164e63;
}

.selectable-value.field-color-6 {
  background: #fee2e2;
  color: #7f1d1d;
}

.success-text {
  color: var(--success);
  font-weight: 700;
}

.error-text {
  color: var(--danger);
  font-weight: 700;
}

.email-body {
  max-height: 70vh;
  overflow: auto;
}

.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.log-list {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 0;
}

.log-row {
  border: 1px solid rgba(209, 214, 229, 0.92);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
  font-size: 12px;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.log-row:hover {
  border-color: #c6d7fe;
  box-shadow: inset 4px 0 0 rgba(62, 87, 218, 0.78), 0 10px 24px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.log-row > summary {
  display: grid;
  grid-template-columns: 148px 86px 210px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border-radius: 0;
  padding: 0 12px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.log-row > summary:hover {
  background: rgba(198, 215, 254, 0.18);
}

.log-time,
.log-source {
  color: var(--muted);
}

.log-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 76px;
  border-radius: 999px;
  padding: 2px 7px;
  text-align: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.log-level::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.log-warn .log-level {
  background: var(--warning-soft);
  color: var(--warning);
}

.log-error .log-level {
  background: var(--danger-soft);
  color: var(--danger);
}

.log-message {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-row pre {
  margin: 0 12px 12px;
  padding: 12px;
  font-size: 11px;
  max-height: 220px;
  overflow: auto;
  border-radius: 14px;
  background: #f7f9ff;
}

.settings-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px;
  background: var(--panel-soft);
}

.settings-tab {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  padding-inline: 14px;
}

.settings-tab:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.settings-tab.active {
  background: var(--panel);
  color: var(--primary);
  box-shadow: 0 7px 18px rgba(62, 87, 218, 0.12);
}

@media (max-width: 980px) {
  .app-shell,
  #mail-view.active,
  .designer-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
  }

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

  .mail-column > .section-head,
  .mail-filter-wrap,
  #mail-list-meta {
    grid-template-columns: 1fr;
    grid-column: auto;
    padding-inline: 0;
    justify-items: stretch;
    text-align: left;
  }

  .lead-summary {
    grid-template-columns: 1fr;
  }

  .mail-date,
  .mail-state,
  .lead-date,
  .mail-state .status-badge,
  .lead-summary .status-badge,
  .mail-row button {
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }

  .mail-check {
    justify-self: start;
  }

  .mail-row button,
  .lead-actions {
    width: 100%;
  }

  .mail-row button[data-send-email] {
    width: 100%;
  }

  .lead-actions [data-cancel-lead] {
    position: static;
  }

  .lead-detail-grid {
    grid-template-columns: 1fr;
  }

  .webhook-copy-cell {
    grid-column: auto;
  }

  .webhook-row-fields,
  .rule-summary {
    grid-template-columns: 1fr;
  }

  .log-row > summary {
    grid-template-columns: 1fr 48px;
  }

  .log-source,
  .log-message {
    grid-column: 1 / -1;
  }

  .log-row pre {
    margin-left: 0;
  }

  .preview-grid,
  .preview-grid .mail-row {
    grid-template-columns: 1fr;
  }
}
