/* EAPS Mail — focused, accessible workspace. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', Arial, sans-serif;
  font-size: 14px;
  color: #202938;
  background: #f7f8fb;
  --sidebar: 232px;
  --text: #202938;
  --muted: #616d80;
  --subtle: #616d80;
  --line: #e2e6ed;
  --surface: #ffffff;
  --canvas: #f7f8fb;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eeedff;
  --amber: #8a5708;
  --radius: 12px;
  --shadow: 0 1px 3px #18233605, 0 4px 14px #18233603;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 360px; line-height: 1.5; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid #dce1e9; border-radius: 8px; background: #fff; color: #344155; font-weight: 600; cursor: pointer; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
button:hover { background: #f3f5f9; border-color: #cbd2df; }
button:active { background: #e9edf4; }
button:disabled { opacity: .48; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px #3730a320; }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.primary:active { background: #3730a3; }
input, textarea, select { width: 100%; min-height: 42px; padding: 10px 12px; margin-top: 7px; border: 1px solid #d9dfe8; border-radius: 8px; background: #fff; color: var(--text); transition: border-color .12s ease, box-shadow .12s ease; }
input:hover, textarea:hover, select:hover { border-color: #bfc8d8; }
input:disabled, textarea:disabled, select:disabled { background: #f5f6f9; color: #657286; }
input::placeholder, textarea::placeholder { color: #616d80; opacity: 1; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: #756bed; box-shadow: 0 0 0 3px #4f46e515; }
button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #9189f6; outline-offset: 3px; }
input[type=checkbox] { appearance: auto; accent-color: var(--accent); width: 17px; height: 17px; min-height: 0; margin: 0 8px 0 0; vertical-align: -3px; flex: 0 0 auto; cursor: pointer; }
input[type=file] { padding: 9px; }
input[type=date], input[type=datetime-local] { color: #344155; }
textarea { min-height: 155px; line-height: 1.7; resize: vertical; }
label { display: block; margin: 14px 0; font-size: 14px; font-weight: 600; color: #485369; }
label:has(input[type=checkbox]) { font-weight: 500; }
svg { flex: 0 0 auto; }
button svg { width: 18px; height: 18px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.8px; font-weight: 750; margin-bottom: 0; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 700; margin-bottom: 16px; letter-spacing: -.25px; }
h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
p { color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
small { font-size: 12px; color: var(--muted); }
.muted { font-size: 13px; font-weight: 400; color: var(--muted); }
.quiet-delete { color: #a04646; background: transparent; border-color: #e7dede; font-size: 12px; }
.quiet-delete:hover { color: #8c3030; background: #fff4f4; border-color: #e8c6c6; }
/* Navigation */
aside { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30; display: flex; flex-direction: column; padding: 26px 16px 20px; background: #f6f7fa; border-right: 1px solid var(--line); overflow-y: auto; }
.app-logo { display: flex; align-items: center; gap: 11px; padding: 0 10px 27px; }
.app-logo .logo-mark, .app-logo > svg, .app-logo > span:first-child { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: var(--accent); color: white; font-size: 20px; font-weight: 800; }
.app-logo .logo-name, .app-logo strong { display: block; font-size: 18px; line-height: 1.2; font-weight: 750; letter-spacing: -.4px; color: #242d40; }
.app-logo small, .app-logo > div > span { display: block; font-size: 11px; color: #616d80; margin-top: 4px; letter-spacing: .2px; }
aside > h2 { padding: 0 10px; font-size: 20px; }
aside > p { padding: 0 10px; font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 5px; }
.nav-section-label { font-size: 11px; font-weight: 700; color: #616d80; letter-spacing: .6px; padding: 21px 12px 8px; }
.nav-section-label:first-child { padding-top: 0; }
nav button { display: flex; justify-content: flex-start; gap: 11px; width: 100%; min-height: 43px; padding: 11px 12px; border: 0; background: transparent; text-align: left; font-size: 14px; font-weight: 550; color: #596579; border-radius: 8px; }
nav button:hover { background: #e9ecf2; color: #28364b; }
nav button.active { background: #e8e7fc; color: #4338ca; font-weight: 700; }
.nav-icon, .nav-icon svg { display: inline-flex; width: 19px; height: 19px; }
.nav-label { line-height: 1.4; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 21px; margin-left: auto; padding: 0 5px; border-radius: 5px; background: #e3e5ed; color: #536078; font-size: 11px; font-weight: 700; }
.active .nav-count { background: #d8d4fb; color: #4338ca; }
.asidefoot { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 26px 4px 0; color: var(--muted); font-size: 12px; }
.asidefoot > div:nth-child(2) { min-width: 0; flex: 1; }
.asidefoot small { display: block; margin-top: 3px; font-size: 10px; letter-spacing: .3px; }
.user-avatar { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid #e1e3eb; border-radius: 50%; color: #626b80; background: #fff; font-size: 12px; font-weight: 700; }
.asidefoot > span, #identity { display: block; color: #344155; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.asidefoot button { justify-content: center; flex: 0 0 30px; width: 30px; background: transparent; border: 0; min-height: 32px; padding: 5px; color: var(--muted); }
.asidefoot button:hover { color: #4338ca; }
/* Page shell */
main { width: calc(100% - var(--sidebar)); margin-left: var(--sidebar); padding: 0 36px 36px; }
main > header, #workspace, #notice { max-width: 1480px; margin-left: auto; margin-right: auto; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); margin: 0 -36px 28px; padding: 0 36px; color: #616d80; background: #fff; font-size: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; }
.breadcrumb strong { font-weight: 600; color: #4a566a; }
.topbar-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #6b778b; }
.connection-dot { width: 6px; height: 6px; border-radius: 50%; background: #8b95a7; }
.connection-dot.is-connected { background: #169773; }
header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-eyebrow, header > div > small { display: block; font-size: 11px; font-weight: 650; color: #616d80; letter-spacing: 1.5px; margin-bottom: 8px; }
#pageDescription:empty { display: none; }
#pageDescription { margin: 9px 0 0; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 6px 10px; color: #6b5a32; background: #fff9eb; border: 1px solid #ece0bd; border-radius: 6px; white-space: nowrap; }
#mode { color: #667187; background: #f5f6f9; border-color: #e1e5ed; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.section-heading h2, .section-heading h3 { margin-bottom: 0; }
.button-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-chip { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid #e2e5ed; border-radius: 5px; background: #f5f6fa; color: #616d80; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status-chip.is-missing { background: #fff7e8; border-color: #eeddb5; color: #865309; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.row h2, .row h3 { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid > * { min-width: 0; }
.columns { display: grid; grid-template-columns: 272px minmax(0, 1fr); align-items: start; gap: 22px; }
.empty { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 220px; text-align: center; padding: 42px 22px; color: #616d80; }
.empty h2, .empty h3, .empty p { margin: 0; }
.empty svg { width: 38px; height: 38px; color: #a1aabd; }
.warning { margin: 12px 0; padding: 11px 14px; color: #83520a; background: #fff8e9; border: 1px solid #f1dfb3; border-radius: 7px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
#notice:not(:empty) { margin-bottom: 20px; padding: 11px 15px; background: #f0f2ff; border: 1px solid #dedffa; color: #514c87; border-radius: 8px; white-space: pre-wrap; font-size: 13px; line-height: 1.6; }
#login { max-width: 430px; margin: 64px auto; }
#loginForm .primary { width: 100%; margin-top: 10px; }
details { margin: 16px 0; }
summary { color: #59667c; font-size: 13px; font-weight: 600; cursor: pointer; padding: 5px 0; }
summary::marker { color: #8b94a8; }
summary:hover { color: var(--accent); }
.backlink { min-height: 34px; margin-bottom: 17px; padding: 5px 0; border: 0; background: transparent; color: #646d82; }
.backlink:hover { color: var(--accent); background: transparent; }
/* Three-step work path */
.workflow-strip { display: flex; align-items: center; gap: 0; margin: 0 0 24px; padding: 15px 20px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.workflow-step { position: relative; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 34px; padding: 0 10px; color: #616d80; font-size: 13px; font-weight: 600; border: 0; background: transparent; box-shadow: none; }
.workflow-step:first-child { padding-left: 0; }
.workflow-step:last-child { padding-right: 0; }
.workflow-step:hover { color: #4338ca; background: #f7f6ff; }
.step-line { flex: 1; height: 1px; background: #e5e8ee; margin: 0 22px; }
.step-number { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 27px; width: 27px; height: 27px; border: 1px solid #e0e4ec; border-radius: 50%; background: #f7f8fb; font-size: 12px; color: #616d80; }
.workflow-step.is-current { color: #4338ca; }
.workflow-step.is-current .step-number { color: #fff; background: var(--accent); border-color: var(--accent); }
.workflow-step.is-complete { color: #525d73; }
.workflow-step.is-complete .step-number { color: #4f46e5; background: #eeedff; border-color: #dbd8fd; }
/* File input */
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 284px; gap: 24px; align-items: start; }
.upload-main { padding: 28px; }
.upload-main h2 { font-size: 18px; }
.file-format, .session-tag { color: #616d80; font-size: 11px; font-weight: 500; white-space: nowrap; }
.file-format { letter-spacing: .4px; }
.file-picker-label { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; margin-top: 21px; padding: 7px 15px; border: 1px solid #dddfee; border-radius: 7px; background: #fff; color: #5146bd; font-size: 13px; font-weight: 600; box-shadow: 0 1px 2px #18233605; }
.upload-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 260px; margin: 0; padding: 34px 20px; border: 1.5px dashed #cfd5e4; border-radius: 10px; background: #fbfcff; text-align: center; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.upload-dropzone:hover, .upload-dropzone.is-dragover, .upload-dropzone:focus-within { border-color: #8e85ed; background: #f6f5ff; }
.upload-dropzone[aria-disabled=true] { opacity: .6; cursor: not-allowed; border-color: #d7dce8; background: #f6f7fa; }
.upload-dropzone[aria-disabled=true] .file-picker-label { color: #616d80; background: #f3f4f8; }
.upload-icon { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-bottom: 18px; background: #eeedff; color: #645be4; border-radius: 14px; }
.upload-icon svg { width: 26px; height: 26px; }
.upload-title { font-size: 17px; font-weight: 650; color: #343c52; line-height: 1.5; }
.upload-hint { display: block; margin-top: 8px; font-size: 13px; font-weight: 400; color: #616d80; }
#uploadFilename { display: block; margin: 0; max-width: 100%; color: #343c52; overflow-wrap: anywhere; }
.upload-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 24px; }
.upload-controls label { flex: 1; max-width: 260px; margin: 0; font-size: 13px; }
.upload-controls .primary { min-width: 165px; min-height: 44px; }
.upload-summary { padding: 24px; }
.upload-summary h2 { font-size: 15px; }
.upload-summary .section-heading { margin-bottom: 24px; }
.summary-number { display: block; font-size: 42px; font-weight: 750; line-height: 1.2; letter-spacing: -1.5px; color: #28334a; }
.summary-label { display: block; margin-top: 6px; font-size: 13px; color: #616d80; }
.summary-list { display: grid; gap: 14px; padding: 20px 0; margin: 22px 0 20px; border-top: 1px solid #e8ebf1; border-bottom: 1px solid #e8ebf1; list-style: none; }
.summary-list > * { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #616d80; font-size: 13px; }
.summary-list strong, .summary-list dd { margin: 0; font-size: 14px; font-weight: 650; color: #405069; }
.upload-summary button { width: 100%; }
.upload { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.upload > div:first-child { flex: 1; }
.upload > div:last-child { min-width: 240px; }
/* Mail review */
.review-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.stats { color: #6b7589; font-size: 13px; margin: 15px 0; }
.review-toolbar .stats { margin: 7px 0; }
.list { align-self: start; min-width: 0; padding: 16px 12px; }
.list h2 { margin: 0; font-size: 14px; }
.list .section-heading { padding: 2px 7px; margin-bottom: 14px; }
.count-badge { padding: 1px 6px; border-radius: 5px; background: #f0f2f7; color: #616d80; font-size: 11px; font-weight: 650; }
.list-filters { display: grid; gap: 8px; padding: 0 5px; margin-bottom: 15px; }
.list-filters input, .list-filters select { min-height: 36px; margin: 0; padding: 8px 9px; font-size: 12px; }
.list-filters select { background: #fbfcfe; }
.select-all { display: flex; align-items: center; margin: 0 4px 13px; padding: 0 3px 13px; border-bottom: 1px solid #e9ecf2; font-size: 12px; color: #616d80; }
#review .list { position: sticky; top: 18px; max-height: calc(100vh - 80px); overflow-y: auto; }
.draft-choice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 7px; margin: 0 0 6px; border: 1px solid transparent; border-radius: 8px; background: #fff; }
.draft-choice:hover { background: #f8f9fc; }
.draft-choice.selected { background: #f2f1ff; border-color: #d9d5fb; }
.draft-choice > label { margin: 4px 0 0; padding: 2px; }
.draft-choice input[type=checkbox] { margin-right: 0; width: 16px; height: 16px; }
.item { display: block; width: 100%; padding: 11px 12px; text-align: left; line-height: 1.65; margin-bottom: 8px; }
.draft-choice .item { display: block; flex: 1; min-width: 0; padding: 1px 0; margin: 0; min-height: 0; border: 0; background: transparent; text-align: left; color: #27344b; font-size: 13px; font-weight: 400; }
.draft-choice .item strong { font-size: 14px; font-weight: 700; }
.draft-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.kind-chip { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 4px; color: #5b53ab; background: #e8e6fc; font-size: 10px; line-height: 1.5; font-weight: 650; }
.kind-chip.order { color: #36677b; background: #e8f1f5; }
.draft-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: #616d80; font-size: 12px; margin: 4px 0; overflow-wrap: anywhere; }
.recipient-status { display: block; font-size: 11px; line-height: 1.6; color: #616d80; overflow-wrap: anywhere; }
.recipient-status.is-missing { color: #946719; }
.draft-count { white-space: nowrap; font-size: 11px; color: #616d80; }
#editor { min-width: 0; padding: 26px; }
.review-identity { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 19px; margin-bottom: 20px; border-bottom: 1px solid #ebedf3; }
.review-identity h2 { font-size: 23px; margin: 7px 0 4px; letter-spacing: -.5px; }
.review-identity .kind-chip { padding: 4px 8px; font-size: 11px; }
.review-identity p { margin: 0; font-size: 13px; }
.review-warnings { padding: 0 0 14px; margin: -4px 0 18px; border-bottom: 1px solid #edf0f5; }
.review-warnings > summary { color: #895b14; }
.table-editor { border-top: 1px solid #edf0f5; padding-top: 12px; margin: 22px 0; }
.table-editor > .muted { margin: 10px 0; }
.table-editor .tablewrap { max-height: 340px; }
.preview-heading { align-items: flex-end; gap: 14px; margin: 24px 0 13px; }
.preview-heading p { margin: 7px 0 0; font-size: 11px; }
.preview-heading button { padding: 7px 10px; min-height: 34px; font-size: 12px; white-space: nowrap; }
.preview-shell { padding: 14px; border: 1px solid #e6e9f0; border-radius: 8px; background: #f8f9fc; overflow: auto; }
.preview-shell .preview { margin: 0 auto; }
.individual-send { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid #e9ecf2; }
.individual-send .footer { border: 0; margin-top: 8px; padding-top: 0; }
.mail-fields label { margin-top: 0; }
.mail-content { margin-top: 6px; }
.mail-content textarea { min-height: 200px; }
#editor > .row { margin: 24px 0 10px; }
#editor > .row h2 { font-size: 15px; }
#editor > .row > div { display: flex; gap: 6px; }
#editor > .row button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.preview { display: block; max-width: 100%; height: auto; border: 1px solid #e0e4ec; background: white; }
.footer { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.footer label { font-size: 13px; }
.footer > .grid { align-items: end; margin-top: 12px; }
.footer .grid label { margin-bottom: 0; }
.footer #zone { margin-bottom: 8px; font-size: 11px; }
.footer > .muted:last-child { margin-top: 12px; }
.batchbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; bottom: 16px; z-index: 12; padding: 18px 22px; background: #fff; box-shadow: 0 8px 35px #27345212, 0 1px 5px #27345208; border-color: #dce1eb; margin-top: 20px; }
.batchbar h2 { font-size: 15px; margin: 0; }
.batchbar p { margin: 3px 0 0; font-size: 12px; }
.batchbar label { margin: 7px 0 0; font-size: 13px; }
.batch-info { min-width: 0; }
.batch-info > strong { font-size: 14px; color: #354159; }
.batch-info #batchStatus:empty { display: none; }
.batchbar #batchStatus { margin-top: 7px; color: #6a7488; font-size: 12px; }
.batchbar .grid { align-items: end; }
.batchbar .grid > div:last-child { padding-bottom: 1px; }
.selection-tools { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.selection-tools label { margin: 0; font-size: 13px; }
#batchSend { min-width: 190px; }
.test-tools { margin: 0; max-width: 520px; }
.test-tools summary { padding: 7px 0; font-size: 12px; font-weight: 500; text-align: right; }
.test-tools[open] { flex: 0 1 520px; }
.test-tools .grid { align-items: end; gap: 12px; margin-top: 8px; padding: 15px; border: 1px solid #e1e5ee; border-radius: 8px; background: #fff; }
.test-tools label { margin: 0; font-size: 12px; }
.test-tools input { min-height: 38px; margin-top: 5px; font-size: 13px; }
.test-tools .grid > div { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.test-tools small { font-size: 11px; }
.test-tools button { min-height: 38px; padding: 8px 10px; font-size: 12px; }
/* Image columns */
.image-options { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; margin: 25px 0; }
.image-option { display: flex; align-items: center; gap: 11px; border: 1px solid #e0e5ee; border-radius: 9px; padding: 16px 14px; margin: 0; background: #fcfcfe; cursor: pointer; }
.image-option:hover { border-color: #c6c2f4; background: #faf9ff; }
.image-option.is-on { border-color: #bcb5f8; background: #f4f2ff; }
.image-option input { margin: 0; }
.image-option span { flex: 1; min-width: 0; }
.image-option strong { display: block; font-size: 13px; font-weight: 700; color: #3b435a; }
.image-option small { display: block; font-size: 11px; color: #616d80; margin-top: 6px; }
.image-option em { font-style: normal; font-size: 10px; color: #616d80; }
#imageSettingsStatus { color: #6a748a; font-size: 13px; }
#imageSettingsPreview { width: auto; }
/* Brand workspace */
.management-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; margin-bottom: 18px; position: sticky; top: 0; z-index: 13; padding: 10px 0; background: var(--canvas); }
.management-toolbar > div { display: flex; gap: 8px; }
#managementStatus { font-size: 13px; color: #6e778b; }
.management-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 22px; align-items: start; }
.managed-sidebar { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; padding: 18px 12px; }
.managed-sidebar > .row { padding: 0 6px; gap: 8px; }
.managed-sidebar h2 { margin: 0; font-size: 14px; }
.managed-sidebar h2 small { display: inline-block; margin-left: 5px; padding: 1px 6px; color: #6d768c; background: #f0f2f7; border-radius: 4px; font-size: 11px; }
.managed-sidebar .primary { padding: 6px 10px; min-height: 32px; font-size: 12px; background: #f1f0ff; border-color: #dedbf9; color: #574dc9; box-shadow: none; }
.managed-sidebar .primary:hover { background: #e7e3ff; }
#managedBrandSearch { min-height: 38px; margin: 16px 0 14px; padding: 9px 11px; font-size: 13px; background: #fafbfe; }
.managed-brand { display: block; text-align: left; width: 100%; padding: 13px 11px; min-height: 64px; margin-bottom: 5px; background: transparent; border: 1px solid transparent; border-radius: 8px; }
.managed-brand:hover { background: #f6f7fb; border-color: transparent; }
.managed-brand.selected { background: #eeedff; border-color: #dbd7fb; }
.managed-brand strong { display: block; font-size: 14px; color: #2f3950; font-weight: 700; overflow-wrap: anywhere; }
.managed-brand.selected strong { color: #4d42b9; }
.managed-brand span { display: block; margin-top: 5px; font-size: 11px; color: #616d80; font-weight: 400; }
.managed-head { padding: 22px 24px; }
.parent-name { margin: 0; flex: 1; max-width: 440px; color: #616d80; font-size: 12px; font-weight: 500; }
.parent-name input { font-size: 22px; font-weight: 750; letter-spacing: -.4px; border-color: transparent; padding: 5px 0; min-height: 39px; margin-top: 4px; background: transparent; }
.parent-name input:hover { border-color: #e2e5ee; padding-left: 8px; }
.parent-name input:focus { border-color: #8880eb; padding-left: 8px; background: #fff; }
.subbrand-title { margin-top: 20px; margin-bottom: 12px; padding-top: 18px; border-top: 1px solid #edf0f5; }
.subbrand-title h3 { margin: 0; font-size: 13px; color: #59667c; }
.subbrand-title button { border: 0; background: #f3f4f9; font-size: 12px; min-height: 30px; padding: 5px 10px; }
.child-brand-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.child-brand-field { display: flex; align-items: center; width: 190px; min-height: 38px; overflow: hidden; border: 1px solid #dfe3ee; border-radius: 7px; background: #fbfcff; }
.child-brand-field:focus-within { border-color: #8278e9; box-shadow: 0 0 0 3px #4f46e510; }
.child-brand-field input { min-width: 0; width: 100%; min-height: 36px; padding: 8px 10px; margin: 0; border: 0; border-radius: 0; background: transparent; font-size: 13px; box-shadow: none; }
.child-brand-field button { min-height: 32px; padding: 3px 9px; border: 0; border-radius: 0; color: #616d80; background: transparent; font-size: 19px; font-weight: 400; }
.child-brand-field button:hover { color: #a54c4c; background: #f9eeee; }
#parentBrandWarnings .warning { margin-bottom: 0; }
.country-contact { padding: 24px; }
.country-contact > .row h3 { margin: 0; font-size: 14px; }
.country-switch { display: inline-flex; gap: 3px; padding: 3px; background: #f1f3f7; border: 1px solid #e6e8ef; border-radius: 8px; }
.country-switch button { padding: 6px 12px; min-height: 32px; background: transparent; border: 1px solid transparent; font-size: 12px; color: #6e778b; border-radius: 5px; }
.country-switch button[data-has-contact=true]::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #72848a; }
.country-switch button.active[data-has-contact=true]::after { background: #6a60cf; }
.country-switch button.active { background: #fff; color: #473fa9; border-color: #e1dfef; box-shadow: 0 1px 3px #1b254d0a; }
.managed-identity { display: flex; align-items: center; gap: 10px; margin: 22px 0 18px; }
.managed-identity strong { font-size: 21px; font-weight: 750; letter-spacing: -.4px; color: #303a50; }
.managed-identity span { color: #6b639f; background: #f0edf9; border: 1px solid #e5e0f1; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 650; }
.compact-contact { gap: 9px 18px; }
.compact-contact label { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
.compact-contact input { margin-top: 6px; }
.extra-contacts { margin: 10px 0 20px; padding-bottom: 2px; }
.extra-contacts summary { font-size: 12px; font-weight: 500; }
.extra-contacts[open] .grid { margin-top: 13px; }
.mail-panels { gap: 18px; margin-top: 23px; padding-top: 22px; border-top: 1px solid #edf0f4; }
.mail-panel { border: 1px solid #e1e5ee; background: #fff; border-radius: 9px; overflow: hidden; padding: 0 16px 16px; }
.mail-panel-title { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; margin: 0 -16px 16px; background: #f5f4fc; border-bottom: 1px solid #e8e5f2; }
.mail-panel-title h2 { font-size: 14px; font-weight: 700; margin: 0; color: #564e91; }
.mail-panel.order .mail-panel-title { background: #f1f6f9; border-color: #e1eaf0; }
.mail-panel.order .mail-panel-title h2 { color: #49677f; }
.mail-panel label { font-size: 14px; margin: 12px 0 0; }
.mail-panel input { font-size: 14px; }
.mail-panel textarea { min-height: 210px; font-size: 14px; line-height: 1.7; }
.country-contact > .row:last-child { margin-top: 18px; flex-wrap: wrap; }
.country-contact > .row small { font-size: 11px; }
.template-preview { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fafbfe; }
.template-body { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Tables and contact drawer */
.tablewrap { overflow: auto; width: 100%; border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid #e7eaf1; }
th { color: #68758a; background: #f6f7fb; font-size: 12px; font-weight: 650; }
td { color: #465269; }
tbody tr:hover { background: #fafbff; }
td input { min-width: 90px; min-height: 34px; margin: 0; padding: 7px 9px; font-size: 12px; }
.internal { color: #98733b; background: #fffaf0; }
#jobs td:nth-child(3) { white-space: normal; min-width: 250px; line-height: 1.8; }
#jobs td:last-child button { min-height: 30px; font-size: 12px; padding: 5px 10px; }
.contact-drawer { margin-top: 4px; padding: 18px 22px; }
.contact-drawer > summary { font-size: 14px; padding: 2px 0; }
.contact-drawer > .card { margin: 0; padding: 24px 0 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
.contact-drawer > .card > details { padding: 13px 16px; border: 1px solid #e4e7ef; border-radius: 8px; background: #fafbfe; }
.contact-drawer > .card > .row:last-child { margin-top: 16px; }
.booktools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 22px 0 14px; }
.booktools label { margin: 0; min-width: 120px; flex: 1 1 120px; font-size: 12px; }
.booktools label:first-child { flex: 2 1 220px; }
.booktools input, .booktools select { margin-top: 6px; min-height: 38px; padding: 8px 10px; font-size: 13px; }
.booktools button { min-height: 38px; font-size: 12px; padding: 8px 12px; }
.booktools > span { font-size: 12px; color: #616d80; align-self: center; }
#exportBook { background: #f2f0ff; border-color: #dcd8f5; color: #574da9; }
#bookTable { max-height: 480px; min-height: 210px; position: relative; border: 1px solid #dde2eb; border-radius: 8px; overflow: auto; }
.contactgrid { table-layout: fixed; width: 2610px; border-collapse: separate; border-spacing: 0; }
.contactgrid col { width: 140px; }
.contactgrid .col-country { width: 70px; }
.contactgrid .col-brand { width: 140px; }
.contactgrid .col-company { width: 180px; }
.contactgrid .col-to, .contactgrid .col-cc, .contactgrid .col-backupEmail1, .contactgrid .col-backupEmail2, .contactgrid .col-backupEmail3 { width: 275px; }
.contactgrid th { position: sticky; top: 0; z-index: 3; height: 40px; padding: 9px 10px; color: #566277; background: #f0f2f7; border-right: 1px solid #e3e6ed; border-bottom: 1px solid #d9dfe9; font-size: 12px; }
.contactgrid td { height: 39px; padding: 3px 5px; background: #fff; border-right: 1px solid #e9ecf2; border-bottom: 1px solid #e9ecf2; }
.contactgrid tr:nth-child(even) td { background: #fafbfe; }
.contactgrid input { min-width: 0; width: 100%; height: 32px; min-height: 32px; padding: 4px; margin: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: 12px; }
.contactgrid input:hover { border-color: #cdd3e0; }
.contactgrid input:focus { border-color: #8278e9; background: #fff; box-shadow: 0 0 0 2px #4f46e512; }
.contactgrid button { font-size: 11px; min-height: 28px; padding: 4px 8px; }
.contactgrid [data-template] { background: #eeecff; border-color: #dedaf7; color: #6156b4; }
.contactgrid [data-delete] { color: #a36565; border-color: transparent; background: transparent; }
.contactgrid .cell-country, .contactgrid .cell-brand, .contactgrid .cell-company, .contactgrid .cell-actions { position: sticky; z-index: 2; }
.contactgrid .cell-country { left: 0; }
.contactgrid .cell-brand { left: 70px; }
.contactgrid .cell-company { left: 210px; }
.contactgrid .cell-actions { left: 390px; border-right: 1px solid #cbd3e1; box-shadow: 5px 0 7px #28365308; }
.contactgrid th.cell-country, .contactgrid th.cell-brand, .contactgrid th.cell-company, .contactgrid th.cell-actions { z-index: 4; }
.contactgrid th.cell-to { background: #eeedf9; }
.contactgrid th.cell-cc { background: #eef2f8; }
.contactgrid th[class*=backup] { background: #f3f2f7; }
#bookStatus { font-size: 12px; color: #616d80; }
/* Responsive workspaces */
@media (min-width: 1700px) {
  main { padding-left: 48px; padding-right: 48px; }
  .topbar { margin-left: -48px; margin-right: -48px; padding-left: 48px; padding-right: 48px; }
  .management-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .columns { grid-template-columns: 292px minmax(0, 1fr); }
}
@media (max-width: 1279px) {
  :root { --sidebar: 212px; }
  main { padding-left: 24px; padding-right: 24px; }
  .topbar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .management-layout { grid-template-columns: 205px minmax(0, 1fr); gap: 18px; }
  .columns { grid-template-columns: 242px minmax(0, 1fr); gap: 18px; }
  .unified-mail-panels { grid-template-columns: 1fr; }
  .upload-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; }
  .upload-main { padding: 22px; }
  .upload-controls { gap: 12px; }
  .upload-controls .primary { min-width: 135px; }
  .image-options { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 1000px) {
  :root { --sidebar: 190px; }
  aside { padding-left: 10px; padding-right: 10px; }
  .app-logo { gap: 9px; padding-left: 9px; }
  .app-logo .logo-name, .app-logo strong { font-size: 16px; }
  nav button { gap: 9px; padding-left: 10px; padding-right: 8px; font-size: 13px; }
  main { padding-left: 20px; padding-right: 20px; }
  .topbar { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
  .upload-layout { grid-template-columns: 1fr; }
  .upload-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
  .upload-summary .section-heading { margin-bottom: 8px; }
  .upload-summary .session-tag { display: none; }
  .upload-summary .summary-list { grid-column: 2; grid-row: 1 / 5; margin: 0; padding: 0; border: 0; align-content: center; }
  .upload-summary button { justify-self: start; width: auto; margin-top: 8px; }
  .columns { grid-template-columns: 210px minmax(0, 1fr); gap: 14px; }
  #editor { padding: 20px; }
  .management-layout { grid-template-columns: 185px minmax(0, 1fr); gap: 16px; }
  .managed-sidebar { padding: 16px 8px; }
  .managed-head, .country-contact { padding: 20px; }
  .country-contact > .row { flex-wrap: wrap; }
  .compact-contact { grid-template-columns: 1fr; gap: 5px; }
  .workflow-strip { padding: 13px 16px; }
  .workflow-step { padding: 0 8px; gap: 7px; font-size: 12px; }
  .step-line { margin: 0 10px; }
  .mail-fields.grid { grid-template-columns: 1fr; gap: 0; }
  .preview-heading { flex-wrap: wrap; }
  .review-toolbar { flex-wrap: wrap; }
  .test-tools[open] { flex-basis: 100%; max-width: 100%; }
  .batchbar { flex-wrap: wrap; gap: 14px; }
  .batchbar .row { flex-wrap: wrap; }
  .batchbar .grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 720px) {
  body { min-width: 360px; }
  aside { position: relative; width: 100%; height: auto; padding: 16px 16px 10px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .app-logo { padding: 0 0 14px; }
  .app-logo .logo-mark, .app-logo > svg, .app-logo > span:first-child { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; font-size: 17px; }
  .app-logo small, .app-logo > div > span { display: none; }
  aside > h2 { font-size: 18px; margin: 0 0 12px; }
  aside > p, .asidefoot, .nav-section-label { display: none; }
  nav { flex-direction: row; gap: 5px; overflow-x: auto; padding-bottom: 3px; }
  nav button { width: auto; min-width: max-content; min-height: 38px; font-size: 12px; padding: 9px 10px; gap: 6px; }
  .nav-icon, .nav-icon svg { width: 16px; height: 16px; }
  main { width: 100%; margin: 0; padding: 0 16px 24px; }
  .topbar { height: 48px; margin: 0 -16px 22px; padding: 0 16px; }
  .topbar-meta { font-size: 11px; }
  header { margin-bottom: 22px; gap: 12px; align-items: flex-start; }
  h1 { font-size: 24px; }
  .page-eyebrow, header > div > small { font-size: 10px; letter-spacing: 1px; margin-bottom: 5px; }
  .badge { font-size: 10px; padding: 5px 7px; white-space: normal; max-width: 125px; }
  .card { padding: 19px; border-radius: 10px; margin-bottom: 16px; }
  .row { flex-wrap: wrap; gap: 12px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .workflow-strip { padding: 12px; gap: 5px; margin-bottom: 18px; }
  .workflow-step { padding: 0 4px; gap: 6px; font-size: 11px; }
  .step-line { min-width: 8px; margin: 0 2px; }
  .step-number { width: 23px; height: 23px; flex-basis: 23px; font-size: 10px; }
  .upload-dropzone { min-height: 220px; padding: 25px 18px; }
  .upload-title { font-size: 16px; }
  .upload-controls { align-items: stretch; flex-direction: column; gap: 17px; }
  .upload-controls label { max-width: none; }
  .upload-controls .primary { width: 100%; }
  .upload-summary { display: block; }
  .upload-summary .summary-list { border-top: 1px solid #e8ebf1; margin-top: 18px; padding-top: 16px; }
  .upload-summary button { width: 100%; margin-top: 18px; }
  .upload { flex-direction: column; align-items: stretch; }
  .upload > div:last-child { min-width: 0; }
  .columns { grid-template-columns: 1fr; gap: 0; }
  #review .list { position: static; max-height: 300px; }
  .draft-choice { margin-bottom: 4px; }
  #editor { padding: 19px; }
  .review-identity h2 { font-size: 21px; }
  .review-toolbar { flex-wrap: wrap; gap: 8px; }
  .test-tools { margin-left: auto; }
  .test-tools[open] { width: 100%; margin-left: 0; }
  .test-tools summary { text-align: left; }
  .preview-shell { padding: 8px; }
  .preview-heading .button-group { gap: 6px; }
  .batchbar { position: static; padding: 18px; margin-top: 0; box-shadow: var(--shadow); }
  .selection-tools { gap: 10px; }
  #batchSend { width: 100%; }
  .batchbar .row { align-items: stretch; }
  #editor > .row > div { flex-wrap: wrap; }
  .image-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .image-option { padding: 13px 10px; gap: 8px; }
  .image-option strong { font-size: 11px; }
  .image-option em { display: none; }
  .management-toolbar { min-height: 45px; top: 0; padding: 9px 0; gap: 8px; margin-bottom: 12px; }
  .management-toolbar button { min-height: 35px; padding: 7px 10px; font-size: 12px; }
  #managementStatus { font-size: 11px; }
  .management-layout { grid-template-columns: 1fr; gap: 0; }
  .managed-sidebar { position: static; max-height: 275px; padding: 16px; }
  #managedBrandList { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .managed-brand { margin: 0; min-height: 62px; padding: 10px; }
  .managed-brand strong { font-size: 13px; }
  .managed-brand span { font-size: 10px; }
  .managed-head, .country-contact { padding: 19px; }
  .parent-name { min-width: 170px; }
  .parent-name input { font-size: 21px; }
  .child-brand-field { width: calc(50% - 4px); }
  .child-brand-field input { font-size: 12px; }
  .country-switch { flex-wrap: wrap; }
  .country-switch button { padding: 6px 11px; }
  .country-contact > .row small { line-height: 1.7; }
  .mail-panel textarea { min-height: 190px; }
  .contact-drawer { padding: 16px; }
  .contact-drawer > .card { padding-top: 18px; }
  .booktools label:first-child { flex-basis: 100%; }
  .booktools label { min-width: 110px; }
  #bookTable { max-height: 60vh; }
  .contactgrid .cell-brand, .contactgrid .cell-company, .contactgrid .cell-actions { position: static; }
  .contactgrid th.cell-brand, .contactgrid th.cell-company, .contactgrid th.cell-actions { position: sticky; left: auto; }
  .contactgrid .cell-actions { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Gmail accounts and per-mail sender choice. */
.sender-settings { max-width: 1000px; }
.sender-account { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line, #e5e9f0); }
.sender-account-info { flex: 1; min-width: 0; display: grid; gap: 5px; }
.sender-account-info strong { color: #24324a; font-size: 15px; }
.sender-account-info span { overflow-wrap: anywhere; color: #657189; font-size: 13px; }
.sender-state { flex-shrink: 0; font-size: 12px; background: #f1f3f7; color: #758096; padding: 5px 9px; border-radius: 6px; }
.sender-state.is-connected { background: #e9f7f1; color: #167454; }
.sender-account-actions { display: flex; align-items: center; gap: 7px; }
.sender-account-actions button { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.sender-empty { padding: 30px 16px; text-align: center; background: #f7f9fc; border-radius: 10px; color: #7c8698; font-size: 13px; }
.sender-add-form { border-top: 1px solid var(--line, #e5e9f0); padding-top: 20px; margin-top: 12px; }
.sender-add-form h3 { margin: 0 0 12px; font-size: 14px; }
.sender-add-fields { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(200px, 1.3fr) auto; align-items: end; gap: 12px; }
.sender-add-fields label { margin: 0; }
.sender-add-fields button { margin-bottom: 0; min-height: 42px; }
.review-sender { display: flex; align-items: end; gap: 16px; border: 1px solid #e0e5ef; background: #f7f9fd; border-radius: 10px; padding: 13px 15px; margin: 18px 0; }
.review-sender label { flex: 1; min-width: 0; margin: 0; font-size: 12px; font-weight: 650; color: #46526a; }
.review-sender select { margin-top: 6px; width: 100%; }
#draftSenderStatus { font-size: 12px; color: #657189; max-width: 42%; overflow-wrap: anywhere; padding-bottom: 10px; }
#draftSenderStatus.is-missing { color: #a36120; }
.draft-sender-line { display: block; overflow-wrap: anywhere; font-size: 10px; line-height: 1.5; color: #798499; margin-top: 4px; }
.batch-sender-control { display: flex; gap: 8px; margin-top: 11px; align-items: center; }
.batch-sender-control select { max-width: 330px; min-width: 170px; width: 100%; font-size: 12px; min-height: 35px; padding: 7px 10px; }
.batch-sender-control button { white-space: nowrap; font-size: 12px; min-height: 35px; padding: 7px 11px; }
@media(max-width: 760px) {
 .sender-account { flex-wrap: wrap; gap: 10px; }
 .sender-account-actions { width: 100%; }
 .sender-add-fields { grid-template-columns: 1fr; }
 .review-sender { align-items: stretch; flex-direction: column; gap: 7px; }
 #draftSenderStatus { max-width: none; padding-bottom: 0; }
 .batch-sender-control { flex-wrap: wrap; }
 .batch-sender-control select { max-width: none; }
}
