/* Quiet surfaces, clear content. Glass is reserved for the application chrome. */
:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #65686f;
  --line: rgba(31, 35, 42, .09);
  --canvas: #f5f5f7;
  --surface: #fff;
  --glass: rgba(255, 255, 255, .72);
  --accent: #0066cc;
  --accent-hover: #0055ad;
  --green: #426552;
  --amber: #86612c;
  --radius: 22px;
  --shadow: 0 3px 8px rgba(28, 32, 39, .025), 0 18px 48px rgba(28, 32, 39, .035);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse at 0 0, #e7edf1 0, transparent 46%), radial-gradient(ellipse at 95% 10%, #eeeef2 0, transparent 48%);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; transition: background .16s ease, border-color .16s ease, box-shadow .16s ease; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-underline-offset: 3px; }
button, a, input, textarea, select, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid rgba(0, 102, 204, .65); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -1.15px; margin-bottom: 10px; font-weight: 650; }
h2 { font-size: 17px; letter-spacing: -.35px; margin-bottom: 12px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { line-height: 1.6; }
small { font-size: 12px; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; }
input, textarea, select {
  border: 1px solid rgba(31, 35, 42, .15); border-radius: 10px; background: rgba(255, 255, 255, .9);
  color: var(--ink); padding: 10px 12px; width: 100%; min-width: 0; font-size: 13px; min-height: 40px;
}
textarea { resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(0, 102, 204, .12); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); flex: none; width: 16px; height: 16px; min-height: 0; margin: 0; }
[hidden], .hidden { display: none !important; }
.main, .editor, .preview-column, .sidebar { min-width: 0; }
.app { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 35px 17px 22px; display: flex; flex-direction: column;
  background: rgba(237, 239, 242, .68); border-right: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 1px 0 0 var(--line); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin: 0 15px 43px; text-decoration: none; }
.brand-logo { display: block; width: 153px; max-width: 100%; height: auto; object-fit: contain; }
.brand small { margin-left: 3px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .1px; }
.sidebar-label { display: flex; justify-content: space-between; align-items: center; margin: 0 14px 12px; font-size: 11px; font-weight: 600; color: var(--muted); }
#customer-count { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 6px; background: rgba(35, 38, 43, .045); font-size: 10px; font-variant-numeric: tabular-nums; }
.sidebar nav { display: grid; gap: 5px; padding: 3px; margin: -3px; overflow: auto; }
.customer-item { display: flex; gap: 11px; align-items: center; width: 100%; padding: 12px 11px; border: 1px solid transparent; border-radius: 13px; text-align: left; background: transparent; color: #575960; font-size: 13px; }
.customer-item:hover { background: rgba(255, 255, 255, .5); }
.customer-item.active { background: rgba(255, 255, 255, .9); border-color: rgba(255, 255, 255, .95); color: var(--ink); box-shadow: 0 2px 5px #20212405, 0 6px 16px #20212406; }
.customer-item > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.customer-item small { display: block; font-size: 10px; line-height: 1.5; font-weight: 400; color: var(--muted); margin-top: 4px; }
.customer-monogram { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid rgba(31, 35, 42, .06); border-radius: 9px; background: rgba(255, 255, 255, .5); font-size: 11px; font-weight: 550; letter-spacing: -.1px; color: #70727a; }
.customer-item.active .customer-monogram { background: #f1f3f5; color: #45474c; }
.add-customer { display: flex; justify-content: center; gap: 7px; background: rgba(255, 255, 255, .35); border: 1px solid rgba(31, 35, 42, .07); border-radius: 11px; color: #565960; padding: 11px 7px; margin: 19px 3px 0; font-size: 12px; }
.add-customer:hover { background: rgba(255, 255, 255, .85); }
.sidebar-bottom { display: flex; gap: 9px; align-items: center; margin-top: auto; padding: 20px 6px 0; font-size: 11px; }
.sidebar-bottom small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }
.account-dot { display: grid; place-items: center; width: 31px; height: 31px; flex: none; border-radius: 50%; background: #e3e5e9; color: #62656b; font-size: 10px; }
.account-info { min-width: 0; }
#account-name { display: block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.icon-button { display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 6px; min-width: 29px; min-height: 29px; }
.icon-button:hover { background: rgba(31, 35, 42, .055); color: var(--ink); }
.icon-button svg { width: 16px; height: 16px; }
.sidebar-bottom .icon-button { margin-left: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 0 36px; font-size: 11px; color: var(--muted); }
.slash { margin: 0 10px; color: #adaeb4; }
.topbar b { color: #4f5157; font-weight: 500; }
.topbar-note { font-size: 11px; }
.page { padding: 15px 36px 25px; max-width: 1530px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .15px; color: var(--muted); margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.page-heading p:last-child { margin-bottom: 0; font-size: 12px; }
.toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 39px; padding: 10px 16px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; text-decoration: none; }
.primary { background: #26282d; color: white; box-shadow: 0 2px 4px #2021240a, inset 0 1px 0 #ffffff1a; }
.primary:hover { background: #41444b; }
.secondary { background: var(--glass); border-color: rgba(255, 255, 255, .95); color: #45474d; box-shadow: 0 0 0 1px rgba(31, 35, 42, .07), 0 2px 5px #20212404; }
.secondary:hover { background: #fff; box-shadow: 0 0 0 1px rgba(31, 35, 42, .16); }
.save-state { padding-right: 7px; font-size: 10px; color: var(--muted); }
.save-state.dirty { color: var(--amber); }
.workspace { display: grid; grid-template-columns: minmax(340px, 1.04fr) minmax(330px, 1fr); align-items: start; gap: 24px; }
.editor { background: var(--surface); border: 1px solid rgba(31, 35, 42, .075); border-radius: var(--radius); box-shadow: var(--shadow); }
.tabs { display: flex; align-items: center; gap: 4px; padding: 7px; margin: 13px 14px 0; border: 1px solid rgba(31, 35, 42, .025); border-radius: 14px; background: #f3f4f6; overflow-x: auto; }
.tabs button { flex: 1; padding: 10px 8px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); background: #ffffff65; }
.tabs button.active { color: var(--ink); font-weight: 550; background: white; border-color: #20212406; box-shadow: 0 2px 5px #20212408; }
.editor-content { padding: 25px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 23px; }
.section-head h2 { margin-bottom: 6px; }
.section-head p { font-size: 11px; margin-bottom: 0; line-height: 1.5; }
.segmented { display: flex; flex: none; gap: 2px; padding: 3px; background: #f1f2f4; border-radius: 9px; }
.segmented button { padding: 6px 9px; font-size: 11px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px #2021240f; }
.blocks { display: grid; gap: 4px; margin-bottom: 16px; }
.block { display: flex; align-items: center; gap: 9px; padding: 9px 10px; background: white; border: 1px solid transparent; border-radius: 11px; cursor: grab; }
.block:hover { background: #f7f8fa; }
.block.selected { background: #f1f4f8; border-color: #dce3eb; }
.block.disabled { opacity: .5; }
.block.dragging { opacity: .3; }
.grip { color: #a7aab0; font-size: 16px; }
.block-label { flex: 1; padding: 4px 0; border: 0; background: none; color: var(--ink); text-align: left; font-size: 12px; line-height: 1.4; }
.block .icon-button { color: #888b92; font-size: 14px; }
.block-number { color: #6f737c; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.block input[type=checkbox] { accent-color: #656c78; width: 14px; height: 14px; }
.template-add { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.template-add #remove-block { margin-left: auto; color: var(--muted); }
.text-button { border: 0; background: none; border-radius: 5px; color: #486884; padding: 5px 0; font-size: 11px; line-height: 1.5; }
.text-button:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.code-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 19px 0 9px; }
.code-label label { font-size: 12px; }
.code { background: #f7f8fa; border-color: #e3e5e9; font: 12px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; min-height: 195px; padding: 14px; tab-size: 2; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.65; margin: 10px 0; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 13px; }
.placeholder-list button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #f7f8fa; color: #62656d; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.placeholder-list button:hover { background: #edf1f5; border-color: #cad3de; }
.placeholder-details { margin-top: 18px; font-size: 12px; }
summary { cursor: pointer; font-size: 12px; color: #4f535c; }
.form-stack { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.check { flex-direction: row; align-items: center; gap: 10px; font-size: 13px; font-weight: 400; }
.checks { display: flex; flex-wrap: wrap; gap: 20px; }
.rule-option { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.rule-option:has(input:checked) { background: #f4f6f9; border-color: #cbd4df; }
.rule-option input { margin-top: 2px; }
.rule-option small { display: block; font-size: 11px; line-height: 1.6; font-weight: 400; margin-top: 5px; color: var(--muted); }
.separator { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.badge { display: inline-flex; align-items: center; border-radius: 6px; padding: 5px 7px; font-size: 10px; font-weight: 450; white-space: nowrap; }
.badge.neutral, .badge.amber, .badge.green { background: #eef0f3; color: #646871; }
.badge.green::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--green); margin-right: 5px; }
.preview-column { padding: 22px; background: rgba(255, 255, 255, .53); border: 1px solid #ffffffed; border-radius: var(--radius); box-shadow: inset 0 1px 0 white, var(--shadow); }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.preview-heading h2 { font-size: 15px; margin: 0; }
.profile-picker { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); margin-bottom: 17px; }
.profile-picker select { width: 65%; min-height: 34px; padding: 7px 9px; border-color: #20212412; background: rgba(255, 255, 255, .7); font-size: 11px; color: var(--ink); }
.mail { overflow: hidden; background: #fff; border: 1px solid #20212410; border-radius: 15px; box-shadow: 0 3px 12px #20212404; }
.mail-chrome { height: 35px; display: flex; align-items: center; gap: 5px; padding: 0 14px; background: #fafafa; border-bottom: 1px solid #f0f0f2; color: #6b6f77; font-size: 10px; }
.mail-chrome span:last-child { margin-left: auto; }
.mail-dot { width: 6px; height: 6px; border-radius: 50%; background: #d9dadf; }
.mail-meta { display: grid; grid-template-columns: 43px minmax(0, 1fr); gap: 10px; padding: 17px 22px; border-bottom: 1px solid #f0f1f3; font-size: 11px; }
.mail-meta > span:nth-child(odd) { color: #6a6e76; }
.mail-meta > span, .mail-meta strong { overflow-wrap: anywhere; }
.mail-meta strong { font-weight: 400; }
.mail-intro { padding: 22px 24px 0; color: #465057; font: 13px/1.6 Arial, sans-serif; }
.mail iframe { display: block; width: 100%; height: 440px; border: 0; background: white; }
.mail pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 24px 25px; font: 12px/1.6 ui-monospace, SFMono-Regular, monospace; }
.preview-empty { padding: 20px 24px 40px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 1px 19px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.preview-footer .text-button { flex: none; }
.simulator { padding-top: 17px; border-top: 1px solid var(--line); }
.simulator summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; font-size: 12px; font-weight: 500; }
.simulator summary::-webkit-details-marker { display: none; }
.simulator summary::after { content: "+"; font-size: 18px; font-weight: 300; color: #92969e; }
.simulator[open] summary { margin-bottom: 19px; }
.simulator[open] summary::after { content: "−"; }
.simulator label { font-size: 11px; }
.simulator select, .simulator input { min-height: 35px; padding: 8px 9px; font-size: 12px; }
.recipient-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 13px 0; }
.recipient-inputs label:last-child { grid-column: 1 / -1; }
.decision { padding: 11px 12px; margin: 17px 0 0; border: 1px solid #dfe6e1; border-radius: 9px; background: #f1f5f2; color: #47624f; font-size: 11px; }
.decision.off { background: #eff1f4; border-color: #e0e3e8; color: #636974; }
.message { padding: 13px 16px; margin-bottom: 20px; border: 1px solid #dde4eb; border-radius: 12px; background: #eef2f6; color: #4c6176; font-size: 12px; }
.message.error { border-color: #ecd9d8; background: #fcf4f3; color: #a23e37; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 27px; color: #686c74; font-size: 10px; line-height: 1.6; }
.page-footer span:last-child { text-align: right; }
.setup-list { padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.setup-list li { margin: 12px 0; }
.setup-list code { color: var(--ink); overflow-wrap: anywhere; font-size: 11px; }
.connection { display: flex; gap: 12px; align-items: center; padding: 16px; margin-bottom: 23px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfc; }
.connection-icon { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 23px; height: 23px; flex: none; }
.connection-icon i { background: #7c838e; }
.connection strong { display: block; font-size: 13px; }
.connection small { color: var(--muted); font-size: 11px; }
.connection .badge { margin-left: auto; }
.sync-info { color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.version-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: 100%; max-width: 444px; padding: 44px; border: 1px solid #fff; border-radius: 30px; background: var(--glass); box-shadow: inset 0 1px 0 white, 0 24px 90px #2021240a, 0 3px 10px #20212404; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
.login-logo { display: block; width: 175px; max-width: 100%; height: auto; margin: 0 0 32px; }
.login-card .eyebrow { font-size: 11px; margin-bottom: 10px; }
.login-card h1 { font-size: 28px; letter-spacing: -.9px; line-height: 1.2; }
.login-card p { color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 18px; margin-top: 28px; }
.microsoft-login { margin-top: 29px; }
.microsoft-login-link { display: flex; align-items: center; gap: 12px; min-height: 48px; width: 100%; padding: 13px 16px; border: 1px solid #2021241c; border-radius: 14px; background: #ffffffcc; color: var(--ink); font-size: 13px; font-weight: 550; text-decoration: none; box-shadow: 0 2px 5px #20212403; }
.microsoft-login-link:hover { background: #fff; border-color: #a4b2c2; }
.microsoft-login-link[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.microsoft-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 19px; height: 19px; flex: none; }
.microsoft-mark i { background: #737a86; }
.login-arrow { color: #91959e; font-weight: 400; margin-left: auto; }
.login-card .microsoft-login .hint { font-size: 11px; margin: 12px 0 0; }
.login-card .login-draft-note { margin: 23px 0 0; padding: 12px; border-radius: 10px; background: #f0f3f7; font-size: 12px; }
#login-error { color: #a23e37; margin: 15px 0 0; font-size: 12px; }
#login-error:empty { display: none; }
dialog { padding: 30px; max-width: 480px; width: calc(100% - 32px); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid #fff; border-radius: 24px; background: #fdfdfefa; color: var(--ink); box-shadow: 0 30px 100px #22252b29, inset 0 1px 0 white; }
dialog::backdrop { background: #3238433d; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
dialog p { font-size: 13px; }
dialog label { margin: 20px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.edit-image { margin: 14px 0; width: 100%; }
.html-image-action { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.image-dialog { max-width: 790px; padding: 28px; }
.image-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.image-dialog-heading h2 { font-size: 23px; letter-spacing: -.7px; margin: 0; }
.image-dialog-heading .eyebrow { max-width: 550px; overflow-wrap: anywhere; }
.image-dialog-heading button { margin-top: -3px; }
.image-workspace { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(260px, 1.15fr); gap: 24px; }
.image-assets { padding-right: 24px; border-right: 1px solid var(--line); }
.image-dialog label { margin: 0; }
.image-upload { position: relative; padding: 18px 12px; border: 1px dashed #c1c9d3; border-radius: 13px; background: #f2f4f7; text-align: center; gap: 7px; font-size: 12px; cursor: pointer; }
.image-upload small { color: var(--muted); font-size: 10px; font-weight: 400; }
.image-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.image-upload:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.image-library { display: grid; gap: 8px; margin-top: 16px; max-height: 340px; overflow: auto; padding: 2px; }
.image-choice { display: grid; grid-template-columns: 66px 1fr; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); text-align: left; font-size: 12px; overflow-wrap: anywhere; }
.image-choice.selected { background: #f1f4f8; border-color: #a4b7cd; box-shadow: 0 0 0 1px #a4b7cd; }
.image-choice small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.image-thumb { height: 48px; display: grid; place-items: center; background: #f4f5f7; border-radius: 7px; }
.image-thumb img { max-width: 58px; max-height: 40px; object-fit: contain; }
.image-empty { padding: 22px 5px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.image-selection-empty { min-height: 310px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f4f5f7; border-radius: 15px; color: var(--muted); text-align: center; }
.image-selection-empty > span { color: #949ca8; font-size: 35px; margin-bottom: 15px; }
.image-selection-empty p { font-size: 12px; }
.image-stage { min-height: 120px; max-height: 180px; overflow: auto; padding: 22px; margin-bottom: 18px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.image-stage img { max-width: 100%; height: auto; vertical-align: middle; }
.image-size-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 14px; }
.image-dialog .image-size-grid label, .image-dialog #image-properties > label { font-size: 12px; }
.image-dialog .optional { color: var(--muted); font-size: 10px; font-weight: 400; }
.image-availability { padding-top: 16px; margin-top: 23px !important; border-top: 1px solid var(--line); }
.image-error { color: #a23e37; }
.image-dialog .dialog-actions { margin-top: 14px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar { background: #eceef1; }
  .login-card { background: #fff; }
}
@media (min-width: 1500px) {
  .page { padding-top: 26px; }
  .workspace { gap: 30px; }
  .editor-content { padding: 28px; }
  .preview-column { padding: 25px; }
}
@media (max-width: 1250px) {
  .app { grid-template-columns: 212px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { margin-inline: 12px; }
  .page { padding-inline: 23px; }
  .topbar { padding-inline: 23px; }
  .workspace { grid-template-columns: minmax(310px, 1fr) minmax(310px, 1fr); gap: 19px; }
  .page-heading { align-items: flex-start; }
  .toolbar { max-width: 260px; }
  .save-state { width: 100%; text-align: right; }
  .editor-content { padding: 20px; }
  .preview-column { padding: 18px; }
  .tabs { margin-inline: 11px; gap: 2px; padding: 5px; }
  .tabs button { padding: 9px 6px; font-size: 11px; }
  .profile-picker { flex-direction: column; align-items: stretch; gap: 7px; }
  .profile-picker select { width: 100%; }
  #account-name { max-width: 103px; }
}
@media (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .preview-column { width: 100%; }
  .page-heading { flex-wrap: wrap; gap: 18px; }
  .toolbar { max-width: none; }
  .toolbar .save-state { width: auto; text-align: left; }
  .profile-picker { flex-direction: row; align-items: center; }
  .profile-picker select { width: 65%; }
  .page-footer span:last-child { max-width: 270px; }
}
@media (max-width: 640px) {
  .app { display: block; }
  .sidebar { position: relative; height: auto; padding: 20px 15px 14px; border-right: 0; border-bottom: 1px solid #fff; box-shadow: 0 1px 0 var(--line); }
  .brand { margin: 0 4px 18px; gap: 3px; }
  .brand-logo { width: 130px; }
  .brand small { font-size: 10px; }
  .sidebar-label { display: none; }
  .sidebar nav { display: flex; gap: 7px; }
  .customer-item { width: auto; min-width: 152px; padding: 9px; }
  .customer-item small { font-size: 9px; }
  .customer-monogram { width: 28px; height: 28px; }
  .add-customer { margin-top: 13px; padding: 9px; }
  .sidebar-bottom { padding: 14px 5px 0; }
  #account-name { max-width: 220px; }
  .topbar { height: 48px; padding: 0 20px; }
  .topbar-note { display: none; }
  .page { padding: 13px 15px 25px; }
  h1 { font-size: 29px; }
  .page-heading { margin-bottom: 22px; }
  .toolbar { width: 100%; justify-content: flex-start; gap: 9px; }
  .toolbar .save-state { width: 100%; text-align: left; }
  .toolbar button { flex: 1; }
  .workspace { gap: 19px; }
  .editor, .preview-column { border-radius: 19px; }
  .editor-content { padding: 21px 16px; }
  .section-head { flex-wrap: wrap; gap: 13px; }
  .block { padding: 9px 6px; gap: 6px; }
  .block-number { display: none; }
  .block .icon-button { min-height: 32px; min-width: 30px; }
  .block-label { min-height: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .template-add { gap: 8px 14px; }
  .template-add #remove-block { margin-left: 0; }
  .profile-picker { flex-direction: column; align-items: stretch; }
  .profile-picker select { width: 100%; }
  .recipient-inputs { grid-template-columns: 1fr; }
  .mail iframe { height: 490px; }
  .page-footer { flex-direction: column; gap: 5px; font-size: 10px; }
  .page-footer span:last-child { text-align: left; max-width: none; }
  .login { padding: 20px; }
  .login-card { padding: 32px 27px; border-radius: 25px; }
  .login-logo { width: 155px; }
  .login-card h1 { font-size: 26px; }
  .image-dialog { padding: 22px; }
  .image-workspace { grid-template-columns: 1fr; gap: 18px; }
  .image-assets { padding-right: 0; border-right: 0; }
  .image-library { max-height: 180px; grid-template-columns: 1fr 1fr; }
  .image-choice { grid-template-columns: 1fr; }
  .image-thumb img { max-width: 100px; }
  .image-selection-empty { min-height: 130px; }
  .image-dialog-heading h2 { font-size: 21px; }
  .dialog-actions button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar { background: #eceef1; }
  .login-card, .preview-column, .secondary, dialog { background: #fff; }
  .sidebar, .login-card, dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: #484b51; --line: #7e8289; }
  .sidebar, .login-card, .preview-column, .secondary, dialog { background: #fff; }
  .customer-item.active, .block.selected, .tabs button.active { border-color: #626973; }
  .badge, .hint, .block-number, .page-footer, .customer-item small { color: #484b51; }
}

/* Automatic replies have their own save cycle and use the published signature. */
.workspace.automatic-replies-workspace { grid-template-columns: minmax(0, 1fr); max-width: 920px; }
.automatic-replies-workspace .editor-content { padding: 30px; }
#automatic-replies-panel { max-width: 740px; margin-inline: auto; }
.automatic-replies-note { padding: 16px 18px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 14px; background: #f7f8fa; }
.automatic-replies-note strong { font-size: 12px; font-weight: 600; }
.automatic-replies-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.automatic-replies-toggle { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.automatic-replies-toggle strong { display: block; font-size: 13px; font-weight: 550; }
.automatic-replies-toggle small { display: block; margin-top: 5px; font-size: 11px; line-height: 1.6; color: var(--muted); font-weight: 400; }
.automatic-replies-toggle input[type=checkbox] { appearance: none; -webkit-appearance: none; position: relative; height: 27px; width: 46px; border: 1px solid #cdd1d8; border-radius: 999px; background: #dcdfe4; padding: 0; transition: background .16s ease; cursor: pointer; }
.automatic-replies-toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #20212424; transition: transform .16s ease; }
.automatic-replies-toggle input:checked { background: var(--accent); border-color: var(--accent); }
.automatic-replies-toggle input:checked::after { transform: translateX(19px); }
.automatic-replies-toggle input:focus-visible { outline: 3px solid rgba(0, 102, 204, .65); outline-offset: 4px; }
.automatic-replies-behavior { margin: -8px 2px 3px; }
.automatic-replies-scope { padding: 0; border: 0; margin: 2px 0 0; min-width: 0; display: grid; gap: 13px; }
.automatic-replies-scope legend { padding: 0; margin-bottom: 15px; font-size: 13px; font-weight: 500; }
.automatic-replies-scope .hint { margin: 0 0 0 26px; }
.automatic-replies-list-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 11px; font-size: 11px; color: var(--muted); }
.automatic-replies-users { display: grid; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
.automatic-replies-user { flex-direction: row; align-items: center; gap: 13px; padding: 13px 15px; cursor: pointer; border-bottom: 1px solid var(--line); }
.automatic-replies-user:last-child { border-bottom: 0; }
.automatic-replies-user:hover { background: #f8f9fb; }
.automatic-replies-user:has(input:checked) { background: #f4f6f9; }
.automatic-replies-user span { min-width: 0; overflow-wrap: anywhere; }
.automatic-replies-user strong { font-size: 12px; font-weight: 500; }
.automatic-replies-user small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 4px; }
.automatic-replies-save-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 25px; padding-top: 21px; border-top: 1px solid var(--line); }
.automatic-replies-check-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.automatic-replies-result { padding: 13px 15px; margin: 15px 0; border: 1px solid var(--line); border-radius: 12px; background: #f4f6f9; font-size: 12px; }
.automatic-replies-error, .automatic-replies-result.error { color: #a23e37; font-size: 12px; line-height: 1.65; }
.automatic-replies-result.error { background: #fcf4f3; border-color: #ecd9d8; }
.automatic-replies-history summary { font-weight: 500; }
.automatic-replies-states { list-style: none; margin: 17px 0 0; padding: 0; display: grid; gap: 10px; }
.automatic-replies-states li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 15px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.automatic-replies-profile { display: grid; gap: 4px; overflow-wrap: anywhere; }
.automatic-replies-profile strong { font-size: 12px; font-weight: 500; }
.automatic-replies-profile span { color: var(--muted); font-size: 11px; }
.automatic-replies-status { align-self: start; max-width: 250px; font-size: 11px; line-height: 1.5; color: var(--muted); text-align: right; }
.automatic-replies-status.error { color: #a23e37; }
.automatic-replies-states dl { display: flex; flex-wrap: wrap; gap: 10px 24px; grid-column: 1 / -1; margin: 0; }
.automatic-replies-states dl div { display: grid; gap: 4px; }
.automatic-replies-states dt { color: var(--muted); font-size: 10px; }
.automatic-replies-states dd { margin: 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.automatic-replies-states .automatic-replies-error { grid-column: 1 / -1; margin: 0; font-size: 11px; }
@media (max-width: 640px) {
  .automatic-replies-workspace .editor-content { padding: 23px 16px; }
  .automatic-replies-note, .automatic-replies-toggle { padding: 14px; }
  .automatic-replies-save-row { align-items: stretch; flex-direction: column; gap: 14px; }
  .automatic-replies-check-actions { flex-direction: column; }
  .automatic-replies-states li { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .automatic-replies-status { text-align: left; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .automatic-replies-toggle input, .automatic-replies-toggle input::after { transition: none; }
}
@media (forced-colors: active) {
  .automatic-replies-toggle input[type=checkbox] { appearance: auto; -webkit-appearance: auto; width: 24px; height: 24px; }
  .automatic-replies-toggle input::after { content: none; }
}
