.crcpro-mail-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
}

.reader-header,
.reader-actions {
  overflow: visible !important;
}

.crcpro-mail-action-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(12, 18, 28, 0.16);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: #152033;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.crcpro-mail-action-trigger::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 160ms ease;
}

.crcpro-mail-actions.is-open .crcpro-mail-action-trigger::after {
  transform: rotate(180deg);
}

.crcpro-mail-action-trigger:hover,
.crcpro-mail-action-trigger:focus-visible {
  border-color: rgba(46, 108, 214, 0.62);
  background: #f4f8ff;
  transform: translateY(-1px);
  outline: none;
}

.crcpro-mail-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 3800;
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.crcpro-mail-action-menu[hidden] {
  display: none;
}

.crcpro-mail-action-menu-item {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: #152033;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.crcpro-mail-action-menu-item:hover,
.crcpro-mail-action-menu-item:focus-visible {
  background: #eef5ff;
  color: #174ea6;
  outline: none;
}

.crcpro-mail-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5, 10, 18, 0.58);
  backdrop-filter: blur(8px);
}

.crcpro-mail-action-window {
  width: min(1080px, calc(100vw - 44px));
  height: min(820px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #f8fafc;
  color: #132033;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.crcpro-mail-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 16px 18px;
  border-bottom: 1px solid #d9e0ea;
  background: #ffffff;
}

.crcpro-mail-action-header p {
  margin: 0 0 4px;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.crcpro-mail-action-header h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.crcpro-mail-action-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid #d6deea;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}

.crcpro-mail-action-form {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto auto 1fr;
  overflow: hidden;
  background: #f8fafc;
}

.crcpro-mail-action-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid #dde5ee;
  background: #edf3fb;
}

.crcpro-mail-action-ribbon button,
.crcpro-mail-action-primary {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #162033;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.crcpro-mail-action-ribbon button:hover,
.crcpro-mail-action-ribbon button:focus-visible {
  border-color: #2e6cd6;
  outline: none;
}

.crcpro-mail-action-primary {
  border-color: #1d5fd1 !important;
  background: #1d5fd1 !important;
  color: #ffffff !important;
}

.crcpro-mail-action-primary:disabled {
  border-color: #9fb3d5 !important;
  background: #9fb3d5 !important;
  cursor: wait;
}

.crcpro-mail-action-line,
.crcpro-mail-action-subject {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 16px;
  border-bottom: 1px solid #e1e7f0;
  background: #ffffff;
}

.crcpro-mail-action-line span,
.crcpro-mail-action-subject span {
  color: #475467;
  font-size: 0.85rem;
  font-weight: 800;
}

.crcpro-mail-action-line input,
.crcpro-mail-action-line select,
.crcpro-mail-action-subject input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #b8c4d6;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.crcpro-mail-action-line input::placeholder {
  color: #8a96a8;
}

.crcpro-mail-action-line input:focus,
.crcpro-mail-action-line select:focus,
.crcpro-mail-action-subject input:focus,
.crcpro-mail-action-editor:focus {
  border-color: #2e6cd6;
  outline: 3px solid rgba(46, 108, 214, 0.16);
}

.crcpro-mail-action-status,
.crcpro-mail-action-attachments {
  min-height: 0;
  padding: 8px 16px;
  color: #475467;
  font-size: 0.88rem;
  font-weight: 700;
  background: #f8fafc;
}

.crcpro-mail-action-status:empty {
  display: none;
}

.crcpro-mail-action-status.is-error {
  color: #a32121;
  background: #fff0f0;
}

.crcpro-mail-action-attachments {
  color: #1d4f9a;
  background: #eef5ff;
  border-bottom: 1px solid #d8e7fb;
}

.crcpro-mail-action-editor {
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 20px 22px 32px;
  border: 0;
  background: #ffffff;
  color: #111827;
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.crcpro-mail-action-editor blockquote,
.crcpro-mail-action-quote {
  margin: 18px 0 0;
  padding: 12px 0 12px 16px;
  border-left: 3px solid #a8b7cc;
  color: #39465a;
}

.crcpro-mail-action-forward-header {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dde5ee;
  border-radius: 8px;
  background: #f7f9fc;
  color: #334155;
}

.crcpro-mail-action-forward-header p {
  margin: 0 0 5px;
}

@media (max-width: 760px) {
  .reader-actions {
    min-width: 0;
    overflow: visible;
  }

  .crcpro-mail-actions {
    order: 0;
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .crcpro-mail-action-trigger {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.84rem;
    box-shadow: none;
  }

  .crcpro-mail-action-menu {
    min-width: 178px;
    right: 0;
  }

  .crcpro-mail-action-menu-item {
    min-height: 38px;
    font-size: 0.9rem;
  }

  .crcpro-mail-action-backdrop {
    display: block;
    padding: 0;
    background: #f8fafc;
    backdrop-filter: none;
  }

  .crcpro-mail-action-window {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .crcpro-mail-action-header {
    min-height: 64px;
    padding: 10px 12px;
  }

  .crcpro-mail-action-header h2 {
    font-size: 1rem;
  }

  .crcpro-mail-action-form {
    grid-template-rows: auto auto auto auto auto auto auto minmax(0, 1fr);
  }

  .crcpro-mail-action-ribbon {
    gap: 7px;
    padding: 10px 12px;
  }

  .crcpro-mail-action-ribbon button,
  .crcpro-mail-action-primary {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .crcpro-mail-action-line,
  .crcpro-mail-action-subject {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 12px;
  }

  .crcpro-mail-action-line input,
  .crcpro-mail-action-line select,
  .crcpro-mail-action-subject input {
    min-height: 39px;
    border-color: #9dadc3;
    font-size: 0.95rem;
  }

  .crcpro-mail-action-status,
  .crcpro-mail-action-attachments {
    padding: 7px 12px;
    font-size: 0.82rem;
  }

  .crcpro-mail-action-editor {
    padding: 14px 14px 120px;
    font-size: 0.97rem;
  }
}
