/* Create your own email. Layout follows the Data Night mockups.
   Error #F87171 and warning #FBBF24 are never the only signal:
   gutter icons and the words Error, Warning, and Check sit beside them. */

/* Fallback faces for these families are declared in extra.css, measured
   from the self-hosted files. A second copy here would win the cascade
   and put the builder back on the wrong metrics. */

.md-content__inner:has(#email-builder) {
  --md-text-font: "Inter", "Inter Fallback", "Segoe UI", sans-serif;
  font-family: var(--md-text-font);
}

/* The breadcrumb sits above the builder. Keep its font metrics matched
   so the builder does not move down when Inter loads. */
body:has(#email-builder) .md-path {
  font-family: "Inter", "Inter Fallback", "Segoe UI", sans-serif;
}

body:has(#email-builder) .md-header__title {
  font-family: "Space Grotesk", "Space Grotesk Fallback", "Inter", "Inter Fallback", sans-serif;
}

.md-typeset:has(#email-builder) :is(h1, h2, h3, h4) {
  font-family: "Space Grotesk", "Space Grotesk Fallback", "Inter", "Inter Fallback", sans-serif;
}

#email-builder {
  --md-code-font: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-family: "Inter", "Inter Fallback", "Segoe UI", sans-serif;
}

/* Loaded height of the builder at the two phone widths Lighthouse uses.
   The box stays put while the fallback above is swapped for the web font. */
@media screen and (max-width: 390px) {
  #email-builder {
    min-height: 1862.45px;
  }
}

@media screen and (min-width: 391px) and (max-width: 412px) {
  #email-builder {
    min-height: 1769.67px;
  }
}

.md-content__inner:has(.email-app) {
  max-width: 72rem;
}

.email-lead {
  color: var(--dn-text-muted);
  font-size: 1.05rem;
  max-width: 46rem;
}

.email-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 10px;
}

.email-tabs a {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--dn-text-muted);
  text-decoration: none;
  border: 1px solid var(--dn-border);
}

.email-tabs a.is-on,
.email-tabs a[aria-current="page"] {
  background: var(--dn-surface);
  color: var(--dn-text);
  border-color: #38bdf8;
}

.email-privacy {
  color: var(--dn-text-faint);
  font-size: 0.86rem;
  margin: 0 0 1.1rem;
}

.email-app {
  color: var(--dn-text);
}

.email-grid {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.email-grid-checker {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
}

.email-editor-column,
#email-checker .email-panel {
  min-width: 0;
}

#email-checker .email-editor-column,
#email-checker .email-editor {
  position: static;
}

@media screen and (max-width: 1100px) {
  .email-grid-checker {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (min-width: 1100px) {
  #email-checker .email-grid-checker {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  }

  #email-checker .email-panel {
    max-height: calc(100vh - 160px);
    overflow: auto;
  }
}

.email-card {
  background: var(--dn-surface);
  border: 1px solid var(--dn-border);
  border-radius: 12px;
  padding: 20px;
}

.email-app label,
.email-app .email-label {
  display: block;
  font-size: 13px;
  color: var(--dn-text-faint);
  margin: 14px 0 6px;
}

.email-var-tag {
  display: inline-block;
  flex: none;
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid var(--dn-border);
  border-radius: 999px;
  background: transparent;
  color: var(--dn-text-muted);
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  vertical-align: middle;
}

.email-switch-copy {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  text-align: left;
}

.email-switch-tail {
  white-space: nowrap;
}

.email-switch .email-var-tag {
  margin-left: 8px;
}

.email-fallback-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #9aa7b4;
  border-radius: 10px;
  background: #111b26;
}

.email-fallback-icon {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid #9aa7b4;
  border-radius: 999px;
  color: var(--dn-text);
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}

.email-fallback-note p {
  margin: 0;
  color: var(--dn-text-muted);
  font-size: 13px;
}

.email-app label:first-child,
.email-app .email-label:first-child {
  margin-top: 0;
}

.email-fixed {
  margin: 0;
  color: var(--dn-text-muted);
  font-size: 0.95rem;
}

.email-help,
.email-caption,
.email-download-note,
.email-status,
.email-hint {
  color: var(--dn-text-muted);
  font-size: 13px;
  margin: 6px 0 0;
}

.email-markers {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--dn-border);
  border-radius: 8px;
  background: #111b26;
}

.email-markers p,
.email-markers li {
  margin: 0;
  color: var(--dn-text-muted);
  font-size: 13px;
}

.email-markers-title {
  color: var(--dn-text) !important;
  font-weight: 600;
  margin-bottom: 4px !important;
}

.email-marker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.email-app input[type="text"],
.email-app textarea {
  width: 100%;
  box-sizing: border-box;
  background: #111b26;
  border: 1px solid var(--dn-border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--dn-text);
  font: inherit;
}

.email-app input.is-invalid,
.email-app textarea.is-invalid {
  border-color: #f87171;
}

.email-field-msg {
  min-height: 0;
  margin: 6px 0 0;
  font-size: 13px;
}

.email-field-msg.is-error {
  color: #f87171;
}

.email-field-msg.is-hint {
  color: var(--dn-text-muted);
}

.email-chips,
.email-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.email-seg {
  gap: 0;
  border: 1px solid var(--dn-border);
  border-radius: 8px;
  overflow: hidden;
  width: min(100%, 280px);
}

.email-type-hint {
  margin: 0.4rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #9AA7B4;
  font-size: 13px;
  line-height: 1.4;
}

.md-typeset .email-app button.email-chip,
.md-typeset .email-app button.email-seg-btn,
.md-typeset .email-app button.email-switch,
.md-typeset .email-app button.email-btn,
.md-typeset .email-app button.email-tab,
.md-typeset .email-app button.email-text-btn,
.md-typeset .email-app button.email-sticky {
  font-family: inherit;
  cursor: pointer;
}

.md-typeset .email-app button.email-chip {
  border: 1px solid var(--dn-border);
  border-radius: 999px;
  background: transparent;
  color: var(--dn-text-muted);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 500;
}

.md-typeset .email-app button.email-chip.is-on {
  border-color: #38bdf8;
  color: #38bdf8;
}

.md-typeset .email-app button.email-seg-btn {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dn-text-muted);
  padding: 8px 12px;
  font-weight: 600;
}

.md-typeset .email-app button.email-seg-btn.is-on {
  background: #38bdf8;
  color: #0f1720;
}

.md-typeset .email-app button.email-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dn-text-muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.email-switch-track {
  width: 38px;
  height: 22px;
  margin-left: auto;
  border-radius: 11px;
  background: #2a3847;
  position: relative;
  flex: none;
}

.email-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0f1720;
}

.email-switch.is-on .email-switch-track {
  background: #a3e635;
}

.email-switch.is-on .email-switch-track::after {
  left: 19px;
}

.email-more {
  margin-top: 16px;
  border-top: 1px solid var(--dn-border);
  padding-top: 8px;
}

.email-more summary {
  cursor: pointer;
  color: var(--dn-text);
  font-weight: 600;
}

.email-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--dn-text-faint);
  font-size: 13px;
}

.email-ptabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--dn-border);
  margin: -4px 0 16px;
}

.md-typeset .email-app button.email-tab {
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--dn-text-faint);
  font-weight: 600;
}

.md-typeset .email-app button.email-tab.is-on {
  color: var(--dn-text);
  border-bottom-color: #38bdf8;
}

.email-frame-wrap {
  background: #f3f6f9;
  border-radius: 8px;
  max-width: 100%;
}

.email-frame-wrap iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 280px;
  border: 0;
  background: #f3f6f9;
}

/* Tab stops on the wrapper. Keyboard focus on the iframe does not
   match :focus-within, so a ring painted on the iframe never shows.
   #38BDF8 is the site link color. */
.email-frame-wrap:focus-visible,
.email-frame-wrap:focus-within {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

.email-app .email-frame-wrap iframe:focus,
.email-app .email-frame-wrap iframe:focus-visible {
  outline: none;
}

.email-subject-line {
  margin: 0 0 10px;
  color: var(--dn-text);
  font-size: 14px;
}

.md-typeset .email-app pre.email-code-view,
.md-typeset .email-app pre.email-template-view {
  max-height: 32rem;
  overflow: auto;
  margin: 0;
  padding: 12px 14px;
  background: #111b26;
  border: 1px solid var(--dn-border);
  border-radius: 8px;
  box-shadow: none;
  color: var(--dn-text);
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 13px;
  line-height: calc(1.7 * 13px);
  white-space: pre;
}

.email-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.md-typeset .email-app button.email-btn {
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  border: 1px solid var(--dn-border);
  background: transparent;
  color: var(--dn-text);
}

.md-typeset .email-app button.email-btn-primary {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0f1720;
}

.md-typeset .email-app button.email-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.md-typeset .email-app button.email-text-btn {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #38bdf8;
  font-weight: 600;
}

.email-text-actions {
  display: flex;
  gap: 16px;
  margin: 8px 0 0;
}

.email-download-note {
  align-self: center;
}

.email-codebox {
  display: flex;
  height: 32rem;
  background: #111b26;
  border: 1px solid var(--dn-border);
  border-radius: 12px;
  overflow: hidden;
}

.email-gutter {
  width: 4.6rem;
  overflow: hidden;
  flex: none;
  padding: 12px 0;
  color: var(--dn-text-faint);
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 13px;
  line-height: calc(1.7 * 13px);
}

.email-gline {
  display: flex;
  align-items: center;
  height: calc(1.7 * 13px);
  line-height: calc(1.7 * 13px);
  padding: 0 8px 0 6px;
}

.email-gicon {
  width: 1rem;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.email-gline.is-error {
  background: rgba(248, 113, 113, 0.1);
  box-shadow: inset 3px 0 #f87171;
}

.email-gline.is-error .email-gicon {
  color: #f87171;
}

.email-gline.is-warning {
  background: rgba(251, 191, 36, 0.08);
  box-shadow: inset 3px 0 #fbbf24;
}

.email-gline.is-warning .email-gicon {
  color: #fbbf24;
}

.email-gline.is-check .email-gicon {
  color: var(--dn-text-faint);
}

.email-gnum {
  margin-left: auto;
}

.email-code-main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.email-highlight,
.email-code-main textarea {
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 13px;
  line-height: calc(1.7 * 13px);
  tab-size: 4;
}

.md-typeset .email-app pre.email-highlight {
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  white-space: pre;
  color: var(--dn-text);
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 13px;
  line-height: calc(1.7 * 13px);
}

.email-line {
  height: calc(1.7 * 13px);
  line-height: calc(1.7 * 13px);
}

.email-line.is-error {
  background: rgba(248, 113, 113, 0.1);
  box-shadow: inset 3px 0 #f87171;
}

.email-line.is-warning {
  background: rgba(251, 191, 36, 0.08);
  box-shadow: inset 3px 0 #fbbf24;
}

.email-line.is-error .email-wavy,
#email-checker .cm-lintRange-error {
  background-image: none;
  text-decoration: underline wavy #f87171;
}

.email-line.is-warning .email-wavy,
#email-checker .cm-lintRange-warning {
  background-image: none;
  text-decoration: underline wavy #fbbf24;
}

#email-checker .cm-lintRange-info {
  background-image: none;
  text-decoration: underline dotted #9aa7b4;
}

.md-typeset .email-app .email-code-main textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  resize: none;
  overflow: auto;
  color: transparent;
  caret-color: #e6edf3;
  background: transparent;
  white-space: pre;
}

.email-code-main textarea::selection {
  color: transparent;
  background: rgba(56, 189, 248, 0.28);
}

.email-code-main textarea::placeholder {
  color: var(--dn-text-faint);
}

/* Shared with the builder preview. The live checker overrides these below. */
.tok-key {
  color: var(--dn-violet-text);
}

.tok-str {
  color: var(--chart-3);
}

.tok-cmt {
  color: var(--dn-text-faint);
}

.email-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.email-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.email-pill-error {
  background: #f87171;
  color: #0f1720;
}

.email-pill-warning {
  background: #fbbf24;
  color: #0f1720;
}

.email-pill-check {
  border: 1px solid var(--dn-border);
  color: var(--dn-text-muted);
}

.email-legend {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--dn-text-muted);
  font-size: 13px;
}

.email-legend li {
  margin: 0 0 2px;
}

.email-issue {
  border: 1px solid var(--dn-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 10px;
  background: #111b26;
}

.email-issue.is-error {
  border-left: 3px solid #f87171;
}

.email-issue.is-warning {
  border-left: 3px solid #fbbf24;
}

.email-issue.is-check {
  border-left: 3px solid #9aa7b4;
}

.md-typeset .email-app .email-name-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.md-typeset .email-app .email-name-list li {
  margin: 0 0 4px;
  color: var(--dn-text);
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 12px;
}

.md-typeset .email-app .email-name-list code {
  font-family: inherit;
}

.email-issue-label {
  float: right;
  margin: 0 0 4px 8px;
  color: var(--dn-text-faint);
  font-size: 12px;
}

.email-issue h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--dn-text);
}

.email-issue p {
  margin: 0 0 8px;
  color: var(--dn-text-muted);
  font-size: 13px;
}

.md-typeset .email-app .email-issue pre {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
}

.md-typeset .email-app .email-issue pre,
.md-typeset .email-app .email-issue pre > code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.md-typeset .email-app .email-issue pre > code {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dn-text-muted);
  white-space: pre-wrap;
}

.email-banner {
  margin: 0 0 12px;
  color: var(--dn-text-muted);
}

.email-app :focus-visible:not(.cm-content) {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.email-sticky {
  display: none;
}

.email-bar-space {
  height: 0;
  overflow: hidden;
}

.email-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#email-checker .email-how {
  margin: 24px 0 0;
  border: 1px solid var(--dn-border);
  border-radius: 10px;
  background: #111b26;
  color: var(--dn-text);
}

#email-checker .email-how > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  list-style: none;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

#email-checker .email-how > summary::marker,
#email-checker .email-how > summary::-webkit-details-marker {
  display: none;
  content: "";
}

#email-checker .email-how > summary::before {
  content: none;
  display: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  background: none;
  -webkit-mask-image: none;
  mask-image: none;
  position: static;
}

#email-checker .email-how > summary::after {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 2px 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: none;
  -webkit-mask-image: none;
  mask-image: none;
  position: static;
  transform: rotate(-45deg);
}

#email-checker .email-how[open] > summary::after {
  transform: rotate(45deg);
}

#email-checker .email-how-body {
  padding: 0 14px 12px;
}

#email-checker .email-how-body p {
  margin: 0 0 8px;
  color: var(--dn-text-muted);
  font-size: 13px;
}

#email-checker .email-sticky {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
}

#email-checker .email-sticky[hidden] {
  display: none !important;
}

#email-checker .email-sticky.is-clear,
#email-checker .email-sticky.is-names,
#email-checker .email-sticky.is-cutoff,
#email-checker .email-sticky.is-issues {
  display: flex;
  align-items: center;
  justify-content: center;
}

#email-checker .email-sticky.is-clear {
  color: #A3E635;
  border: 1px solid #A3E635;
  background: rgba(163, 230, 53, 0.12);
}

#email-checker .email-sticky.is-names,
#email-checker .email-sticky.is-cutoff {
  height: 48px;
  color: #8B98A5;
  border: 1px solid #8B98A5;
  background: rgba(139, 152, 165, 0.12);
  padding: 6px 12px;
  font-size: 13px;
  line-height: 15px;
}

#email-checker .email-sticky.is-issues {
  color: #0f1720;
  border: 0;
  background: #38bdf8;
}

#email-checker .email-sticky.has-cutoff-note {
  flex-direction: column;
  gap: 2px;
  height: auto;
  min-height: 48px;
}

#email-checker .email-sticky-note {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.email-next {
  margin-top: 28px;
}

#email-checker .email-editor,
#email-checker .cm-editor {
  background: #18222e;
  border-radius: 8px;
}

/* Hold the empty editor at the mounted height so CodeMirror does not push
   the page down. On a phone that is the 240px editor plus the 56px gap
   under the sticky bar. */
#email-checker .email-editor {
  min-height: 420px;
}

#email-checker .cm-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 60vh;
  overflow: hidden;
  color: #e6edf3;
}

@media screen and (min-width: 1100px) {
  #email-checker .cm-editor {
    min-height: 420px;
    max-height: calc(100vh - 160px);
  }
}

#email-checker .cm-scroller {
  overflow: auto;
  max-width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 14px;
  line-height: calc(1.7 * 14px);
}

#email-checker .cm-content {
  padding: 20px 16px 20px 20px;
  color: #e6edf3;
  caret-color: #e6edf3;
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 14px;
  line-height: calc(1.7 * 14px);
}

#email-checker .cm-content:focus,
#email-checker .cm-content:focus-visible {
  outline: none;
}

#email-checker .cm-line {
  padding: 0;
  white-space: pre;
  color: #e6edf3;
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 14px;
  line-height: calc(1.7 * 14px);
}

/* Web Designer syntax colours. These beat the shared .tok-* rules.
   Colour and italic only, so red and amber stay on the lint underlines. */
#email-checker .tok-key {
  color: #a78bfa;
}

#email-checker .tok-fn {
  color: #38bdf8;
}

#email-checker .tok-str {
  color: #a3e635;
}

#email-checker .tok-num {
  color: #f0abfc;
}

#email-checker .tok-cmt {
  color: #8b98a5;
  font-style: italic;
}

#email-checker .cm-gutters {
  background: #18222e;
  border-right: 1px solid #243241;
  min-width: 48px;
  min-height: 420px !important;
  color: #8b98a5;
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
  font-size: 14px;
}

#email-checker .cm-lineNumbers .cm-gutterElement {
  color: #8b98a5;
  text-align: right;
  padding: 0 12px 0 8px;
  min-width: 36px;
  line-height: calc(1.7 * 14px);
}

#email-checker .cm-gutter-lint {
  width: 16px;
}

#email-checker .cm-gutter-lint .cm-gutterElement {
  padding-left: 2px;
  padding-right: 0;
}

#email-checker .cm-lint-marker {
  width: auto;
  height: auto;
  min-height: 1em;
  content: none;
  cursor: pointer;
  font-family: Inter, "Inter Fallback", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

#email-checker .cm-lint-marker-error {
  color: #f87171;
}

#email-checker .cm-lint-marker-warning {
  color: #fbbf24;
}

#email-checker .cm-lint-marker-info {
  color: #8b98a5;
}

#email-checker .cm-activeLine,
#email-checker .cm-activeLineGutter {
  background-color: rgba(56, 189, 248, 0.06);
}

#email-checker .cm-line.is-line-target {
  background-color: rgba(56, 189, 248, 0.28);
}

#email-checker .email-expand {
  display: none;
}

#email-checker .cm-editor.cm-focused {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

#email-checker .cm-placeholder {
  color: var(--dn-text-faint);
}

#email-checker .cm-tooltip.cm-tooltip-autocomplete {
  background: #18222e;
  border: 1px solid #2b3a4a;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

#email-checker .cm-tooltip-autocomplete ul {
  max-height: 256px;
  min-width: 280px;
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
}

#email-checker .cm-tooltip-autocomplete ul li {
  display: flex;
  align-items: center;
  height: 32px;
  line-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--dn-text);
}

#email-checker .cm-tooltip-autocomplete ul li[aria-selected] {
  background: rgba(56, 189, 248, 0.12);
  color: var(--dn-text);
  box-shadow: inset 2px 0 #38bdf8;
}

#email-checker .cm-completionLabel {
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
}

#email-checker .cm-completionDetail {
  margin-left: auto;
  padding-left: 16px;
  color: var(--dn-text-muted);
  font-family: Inter, "Inter Fallback", "Segoe UI", sans-serif;
  font-size: 12px;
  font-style: normal;
}

#email-checker .cm-tooltip.cm-tooltip-hover,
#email-checker .cm-tooltip.cm-tooltip-lint {
  background: transparent;
  border: 0;
  box-shadow: none;
}

#email-checker .email-hover-stack .email-issue {
  max-width: 360px;
  margin: 0;
}

#email-checker .cm-diagnostic {
  padding: 0;
  margin: 0;
}

@media screen and (max-width: 760px) {
  #email-checker .email-editor {
    min-height: 296px;
  }

  #email-checker .cm-editor,
  #email-checker .cm-scroller,
  #email-checker .cm-gutters {
    min-height: 240px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .email-app *,
  .email-app *::before,
  .email-app *::after,
  .email-tabs a {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media screen and (max-width: 760px) {
  .email-grid,
  .email-grid-checker {
    grid-template-columns: 1fr;
  }

  #email-checker .cm-editor,
  #email-checker .cm-content,
  #email-checker .cm-line,
  #email-checker .cm-gutters {
    font-size: 13px;
  }

  #email-checker .cm-content,
  #email-checker .cm-line,
  #email-checker .cm-gutterElement {
    line-height: calc(1.7 * 13px);
  }

  #email-builder:not(.is-panel-open) .email-panel {
    display: none;
  }

  #email-builder.is-panel-open .email-form,
  #email-builder.is-panel-open .email-editor-column {
    display: none;
  }

  #email-builder .email-sticky {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    margin: 0;
    border: 0;
    border-radius: 0;
    border-top: 1px solid var(--dn-border);
    background: #38bdf8;
    color: #0f1720;
    font-weight: 700;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }

  #email-checker .cm-scroller {
    padding-bottom: 56px;
  }

  #email-checker .email-sticky.is-clear,
  #email-checker .email-sticky.is-names,
  #email-checker .email-sticky.is-cutoff,
  #email-checker .email-sticky.is-issues {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    width: auto;
    margin: 0;
    border-radius: 0;
    min-height: 48px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  #email-checker .email-sticky.is-issues {
    border-top: 1px solid var(--dn-border);
  }

  #email-checker .email-sticky.is-names,
  #email-checker .email-sticky.is-cutoff {
    height: auto;
    min-height: 48px;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  }

  #email-checker.email-app,
  .md-content__inner:has(.email-app) {
    padding-bottom: 72px;
  }

  #email-builder .email-bar-space {
    height: 64px;
  }

  /* The sticky Preview bar covers the bottom of the viewport. Keep a
     focused field, its validation message, and the last field above it,
     including the home-indicator inset. */
  html:has(#email-builder) {
    scroll-padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  #email-builder {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  #email-builder .email-frame-wrap,
  #email-builder .email-frame-wrap iframe {
    min-height: 640px;
  }

  /* Loaded Inter height of the builder lead, so the fallback font
     does not grow it and push the next paragraph down. */
  .md-content__inner:has(#email-builder) > .email-lead {
    min-height: 68px;
  }
}

@media screen and (max-width: 627px) {
  .md-content__inner:has(#email-builder) > .email-lead {
    min-height: 102px;
  }
}

@media screen and (max-width: 415px) {
  .md-content__inner:has(#email-builder) > .email-lead {
    min-height: 135px;
  }
}

@media screen and (max-width: 331px) {
  .md-content__inner:has(#email-builder) > .email-lead {
    min-height: 169px;
  }
}

@media screen and (max-width: 639px) {
  #email-checker .email-editor {
    min-height: calc(min(240px, 50vh) + 56px);
  }

  #email-checker .cm-editor {
    max-height: 50vh;
    min-height: min(240px, 50vh) !important;
  }

  #email-checker .cm-scroller {
    overscroll-behavior: auto;
    min-height: 0 !important;
  }

  #email-checker.is-editor-expanded .cm-editor {
    max-height: none;
    overflow: visible;
  }

  #email-checker.is-editor-expanded .cm-scroller {
    overflow: visible;
    flex: none;
    min-height: min(240px, 50vh) !important;
  }

  #email-checker .email-expand {
    display: inline-block;
    margin-top: 8px;
  }
}
