:root {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #253047;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --border: #e8ecf2;
  --muted: #8c96a9;
  --subtle: #667188;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 360px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible { outline: 3px solid #b9cdfc; outline-offset: 3px; }
input:focus, select:focus, textarea:focus, [contenteditable]:focus { outline: none; }
input[type='checkbox'] { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }
input[type='file'] { font-size: 12px; color: var(--subtle); max-width: 100%; }
input[type='file']::file-selector-button { border: 1px solid #dce3ee; border-radius: 7px; background: #fff; color: #46536b; padding: 8px 12px; margin-right: 10px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #a2aabb; }
textarea { resize: vertical; }
a { color: var(--blue); text-decoration: none; }
svg { flex-shrink: 0; vertical-align: middle; }
button svg { width: 17px; height: 17px; }
h1, h2, h3, h4, p { margin-top: 0; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 224px; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 25; padding: 29px 16px 20px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 9px 33px; }
.brand-icon { width: 36px; height: 36px; background: var(--blue); border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 9px #2563eb24; flex-shrink: 0; }
.brand-icon svg { width: 21px; height: 21px; }
.brand-title { font-size: 14px; font-weight: 700; letter-spacing: -.3px; color: #1f2b42; white-space: nowrap; }
.brand-subtitle { font-size: 10px; margin-top: 3px; color: #99a2b3; letter-spacing: .9px; text-transform: uppercase; }
.nav-list { display: flex; flex-direction: column; gap: 7px; }
.nav-item { width: 100%; height: 46px; border: 0; border-radius: 8px; background: transparent; color: #6c778b; display: flex; align-items: center; gap: 11px; padding: 0 14px; font-size: 13px; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: #f4f7fb; color: #33415a; }
.nav-item.active, .nav-item[aria-current='page'] { background: #edf3ff; color: var(--blue); }
.nav-icon { width: 19px; height: 19px; display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 500; background: #f0f3f8; padding: 1px 7px; border-radius: 5px; color: #9099aa; }
.nav-item.active .nav-count { background: #dfeaff; color: var(--blue); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 20px 9px 0; display: flex; align-items: center; gap: 10px; }
.user-avatar { height: 34px; width: 34px; border-radius: 50%; background: #eff3fa; color: #687793; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.user-info { font-size: 12px; color: #354157; line-height: 1.7; }
.user-info small, .user-info p { display: block; color: #9ba3b1; font-size: 10px; margin: 0; }
.main-shell { margin-left: 224px; flex: 1; min-width: 0; }
.topbar { height: 72px; border-bottom: 1px solid #e8ecf2; background: #ffffffd9; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; }
.breadcrumb { color: #8d96a7; font-size: 12px; display: flex; align-items: center; gap: 10px; }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb strong, .breadcrumb .current { color: #44516a; font-weight: 500; }
.topbar-actions { display: flex; gap: 15px; align-items: center; }
.prototype-badge { font-size: 11px; color: #76839b; padding: 5px 10px; border: 1px solid #e5eaf2; border-radius: 6px; background: #f9fafc; display: inline-flex; gap: 6px; align-items: center; }
.prototype-badge::before { content: ''; width: 5px; height: 5px; background: #a2b0c9; border-radius: 50%; }
.workspace { max-width: 1560px; margin: 0 auto; padding: 33px 36px 40px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-title { font-size: 27px; font-weight: 600; letter-spacing: -.7px; color: #202b40; margin: 0 0 8px; line-height: 1.45; }
.page-description { margin: 0; color: #939cad; font-size: 12px; line-height: 1.8; }
.page-actions { display: flex; gap: 9px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 8px 15px; border: 1px solid #dfe5ee; border-radius: 7px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; background: #fff; color: #526078; transition: background .15s, border-color .15s, box-shadow .15s; }
.button:hover { background: #f8faff; border-color: #cbd5e5; }
.button.primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 3px #2563eb1a; }
.button.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.button.secondary { background: #fff; }
.button.ghost { border-color: transparent; background: transparent; color: #7a869b; }
.button.ghost:hover { background: #f3f6fb; color: #3c4f6e; }
.button.danger { color: #d74d54; border-color: #f4d7da; background: #fff; }
.button.danger:hover { background: #fff2f3; border-color: #ebbec3; }
.button.small { min-height: 29px; padding: 5px 10px; font-size: 11px; }
.icon-button { border: 0; background: transparent; color: #8993a6; width: 30px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.icon-button:hover { color: #45628c; background: #eff3fa; }
.icon-button.danger:hover { background: #fff0f1; color: #d74d54; }
.icon-button svg { width: 16px; height: 16px; }
.text-link { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.text-link:hover { color: var(--blue-hover); }
.text-link svg { width: 14px; height: 14px; }

.compose-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 23px; }
.compose-card, .card { background: #fff; border: 1px solid #e4e9f1; border-radius: 11px; box-shadow: 0 2px 4px #26345603; overflow: hidden; }
.compose-row { padding: 18px 24px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid #eef1f5; min-height: 68px; }
.field-label { flex-shrink: 0; width: 52px; color: #929bac; font-size: 12px; }
.sender-field { flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0; }
.select { padding: 9px 32px 9px 12px; border: 1px solid #e1e7f0; border-radius: 6px; color: #40506b; background: #fff; min-width: 190px; font-size: 12px; }
.select:focus { border-color: #a5bdfa; box-shadow: 0 0 0 3px #2563eb0d; }
.credential-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; white-space: nowrap; padding: 4px 8px; border-radius: 4px; }
.credential-badge svg { width: 12px; height: 12px; }
.credential-badge.saved { background: #edf8f3; color: #36a577; }
.credential-badge.missing { background: #fff6e8; color: #c6923c; }
.recipient-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.recipient-chip { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; background: #f0f4fc; color: #627694; border: 1px solid #e5ecf8; padding: 5px 8px; border-radius: 5px; line-height: 1.5; }
.recipient-chip button { border: 0; background: transparent; padding: 0; color: #9cabc2; display: inline-flex; }
.recipient-chip button:hover { color: #44668f; }
.recipient-chip button svg { width: 12px; height: 12px; }
.recipients-note { margin: 0; font-size: 10px; color: #a0a9b9; line-height: 1.8; }
.compose-row:has(.recipient-chips) { align-items: flex-start; }
.compose-row:has(.recipient-chips) > .field-label { padding-top: 6px; }
.subject-input { width: 100%; flex: 1; border: 0; background: transparent; color: #35435d; padding: 3px 0; min-width: 0; font-size: 13px; }
.compose-template-bar { min-height: 57px; padding: 12px 24px; display: flex; align-items: center; gap: 12px; background: #fcfdff; border-bottom: 1px solid #e9edf4; }
.template-label { color: #8995aa; font-size: 11px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.template-label svg { height: 15px; width: 15px; }
.compose-template-bar .select { font-size: 11px; padding-top: 6px; padding-bottom: 6px; min-width: 150px; }
.compose-template-bar .text-link { margin-left: auto; font-size: 11px; }
.rich-editor { background: #fff; }
.editor-toolbar { min-height: 47px; border-bottom: 1px solid #eef1f5; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 21px; }
.toolbar-group { display: flex; align-items: center; gap: 2px; }
.toolbar-divider { width: 1px; height: 17px; background: #e6eaf0; margin: 0 5px; }
.toolbar-button { border: 0; color: #8390a4; border-radius: 4px; background: transparent; min-width: 27px; height: 28px; display: flex; align-items: center; justify-content: center; padding: 3px 6px; font-size: 12px; }
.toolbar-button:hover { color: #406595; background: #f0f4fb; }
.toolbar-button.active { color: var(--blue); background: #edf3ff; }
.toolbar-button svg { height: 15px; width: 15px; }
.editor-toolbar select { border: 0; background: transparent; color: #788599; font-size: 11px; padding: 4px; max-width: 100px; }
.editor-content { padding: 27px 28px 22px; min-height: 340px; color: #566278; font-size: 12px; line-height: 2.15; word-break: break-word; }
.editor-content p { margin: 0 0 19px; }
.editor-content p:last-child { margin-bottom: 0; }
.editor-content h2 { font-size: 18px; }
.editor-content h3 { font-size: 15px; }
.editor-content [data-variable], .variable-chip { display: inline-block; background: #edf3ff; border: 1px solid #dbe7ff; color: #5580d7; line-height: 1.7; padding: 0 6px; border-radius: 4px; font-size: 11px; }
.editor-content:empty::before { content: attr(data-placeholder); color: #a5aebd; }
.editor-footer { min-height: 31px; border-top: 1px solid #f0f2f7; display: flex; align-items: center; justify-content: space-between; padding: 8px 24px; color: #a5adbd; font-size: 10px; }
.compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 23px; background: #fff; border-top: 1px solid #e9edf4; }
.compose-footer > div { display: flex; align-items: center; gap: 8px; }
.compose-footer .button.primary { padding-left: 19px; padding-right: 19px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 18px; }
.attachments:empty { display: none; }
.attachment-chip { background: #f6f8fc; border: 1px solid #e7edf6; font-size: 11px; color: #738299; padding: 6px 9px; border-radius: 5px; display: inline-flex; gap: 6px; align-items: center; }
.send-summary { background: #fff; border: 1px solid #e4e9f1; border-radius: 11px; padding: 21px 20px 18px; }
.summary-title { color: #49556e; font-size: 12px; font-weight: 600; margin: 0 0 20px; display: flex; align-items: center; gap: 7px; }
.summary-title svg { color: #8a98ad; width: 15px; height: 15px; }
.summary-count { color: #283750; font-size: 30px; font-weight: 600; line-height: 1.35; letter-spacing: -1px; }
.summary-count small { font-size: 12px; color: #a1aabb; font-weight: 400; letter-spacing: 0; margin-left: 7px; }
.summary-list { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
.summary-person { display: flex; gap: 9px; align-items: center; color: #465671; font-size: 11px; min-width: 0; }
.summary-person > div:last-child { min-width: 0; }
.summary-person p { font-size: 10px; color: #98a4b8; margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-avatar, .avatar { height: 31px; width: 31px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #edf3fd; color: #6686ba; font-size: 11px; flex-shrink: 0; }
.summary-person:nth-child(3n + 2) .summary-avatar, .avatar.purple { color: #9480b8; background: #f2eef8; }
.summary-person:nth-child(3n) .summary-avatar, .avatar.teal { color: #60a097; background: #edf6f4; }
.summary-divider { height: 1px; background: #edf0f5; margin: 22px 0 17px; border: 0; }
.summary-note { color: #939fb2; font-size: 10px; line-height: 1.95; margin: 0; }
.summary-note svg { width: 13px; height: 13px; margin-right: 3px; color: #829ac6; }
.info-box { display: flex; gap: 9px; padding: 13px 15px; border: 1px solid #e3ecfc; background: #f0f5ff; border-radius: 8px; font-size: 11px; line-height: 1.85; color: #7285a7; }
.info-box svg { height: 16px; width: 16px; color: #7598e8; margin-top: 2px; }
.info-box p { margin: 0; }
.info-box strong { font-weight: 500; color: #526e9f; }
.compose-layout > aside > .info-box { margin-top: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 23px; }
.stat-card { padding: 21px 23px; background: #fff; border: 1px solid #e5eaf2; border-radius: 10px; }
.stat-value { font-weight: 600; font-size: 28px; color: #2b3952; line-height: 1.5; letter-spacing: -.7px; }
.stat-label { color: #96a0b1; font-size: 11px; margin-top: 3px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 19px 23px; gap: 15px; border-bottom: 1px solid var(--border); }
.search-field { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid #e1e7f0; padding: 9px 12px; border-radius: 7px; min-width: 230px; }
.search-field:focus-within { border-color: #aabff2; box-shadow: 0 0 0 3px #2563eb09; }
.search-field svg { height: 15px; width: 15px; color: #a3aec1; }
.search-field input { border: 0; padding: 0; font-size: 11px; width: 100%; min-width: 0; background: transparent; color: #475870; }
.filter-tabs { display: flex; align-items: center; gap: 3px; }
.filter-tab { padding: 7px 12px; border: 0; background: transparent; color: #8e9bae; border-radius: 6px; font-size: 11px; }
.filter-tab.active { background: #edf3ff; color: var(--blue); font-weight: 500; }
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; white-space: nowrap; }
.data-table thead { background: #fafbfd; }
.data-table th { font-weight: 400; font-size: 11px; color: #98a2b4; height: 46px; border-bottom: 1px solid #ebeff5; }
.data-table th, .data-table td { padding: 15px 21px; }
.data-table td { border-bottom: 1px solid #eef1f6; color: #637089; height: 73px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfdff; }
.data-table th:first-child, .data-table td:first-child { padding-right: 5px; width: 42px; }
.data-table th:last-child, .data-table td:last-child { text-align: right; }
.contact-name { display: flex; align-items: center; gap: 10px; color: #44536c; font-size: 12px; font-weight: 500; }
.contact-name small { display: block; margin-top: 4px; font-size: 10px; color: #9ba4b4; font-weight: 400; }
.text-muted { color: #9ca5b5 !important; font-size: 11px; }
.badge { border-radius: 5px; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; padding: 4px 8px; line-height: 1.4; font-weight: 400; }
.badge.blue { background: #edf3ff; color: #6486ce; }
.badge.green { background: #edf8f2; color: #64a583; }
.badge.amber { background: #fff7e9; color: #c99d57; }
.badge.gray { background: #f1f3f7; color: #8e9bad; }
.row-actions { display: inline-flex; align-items: center; gap: 5px; }
.selection-bar { padding: 12px 22px; color: #5776a9; font-size: 11px; background: #f0f5ff; border-bottom: 1px solid #e3ebfa; display: flex; align-items: center; gap: 14px; }
.selection-bar .button { margin-left: auto; }
.empty-state { padding: 64px 20px; text-align: center; color: #9ba6b8; font-size: 12px; line-height: 1.9; }
.empty-state svg { width: 38px; height: 38px; margin-bottom: 13px; color: #b7c7df; }
.empty-state h3 { font-size: 15px; font-weight: 500; color: #62728a; margin-bottom: 6px; }
.empty-state p { margin-bottom: 18px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 21px; }
.template-card { border: 1px solid #e4eaf3; border-radius: 10px; background: #fff; overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.template-card:hover { border-color: #cddbf4; box-shadow: 0 4px 20px #395b9310; }
.template-card-preview { min-height: 205px; padding: 24px; background: linear-gradient(145deg, #f9fbff, #f1f5fd); border-bottom: 1px solid #e9eef6; color: #8190a8; font-size: 10px; line-height: 2; }
.template-card-preview h3 { font-size: 14px; font-weight: 500; color: #586e90; margin: 0 0 16px; }
.template-card-preview p { margin: 0 0 12px; }
.template-card-footer { padding: 18px 19px; }
.template-card-footer h3 { color: #45556e; font-size: 13px; font-weight: 500; margin: 0 0 5px; }
.template-card-footer p { color: #9aa4b5; font-size: 10px; margin: 0; }
.template-card-footer .row-actions { margin-top: 14px; display: flex; justify-content: space-between; }

.modal-overlay { position: fixed; inset: 0; z-index: 100; background: #1f2c4859; backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 28px; animation: overlay-in .16s ease-out; }
.modal { width: 580px; max-width: 100%; max-height: calc(100dvh - 56px); background: #fff; border-radius: 13px; box-shadow: 0 24px 90px #152a5140; display: flex; flex-direction: column; overflow: hidden; animation: modal-in .2s ease-out; }
.modal.small { width: 440px; }
.modal.wide { width: 850px; }
.modal-header { padding: 22px 25px; border-bottom: 1px solid #eaf0f6; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.modal-header h2 { font-size: 17px; font-weight: 600; color: #35435b; margin: 0; }
.modal-header p { font-size: 11px; color: #98a4b5; margin: 6px 0 0; }
.modal-body { padding: 25px; overflow-y: auto; }
.modal-body > p { color: #8997ac; font-size: 12px; line-height: 1.9; }
.modal-body > .info-box { margin-bottom: 20px; }
.modal-footer { padding: 17px 25px; border-top: 1px solid #eaf0f6; display: flex; justify-content: flex-end; align-items: center; gap: 9px; background: #fcfdff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.form-field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.form-grid .form-field { margin-bottom: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12px; color: #68788f; font-weight: 500; }
.form-field label .required, .required { color: #d88a8e; margin-left: 3px; }
.form-input, .form-textarea { width: 100%; padding: 11px 12px; border: 1px solid #dee6f0; border-radius: 7px; background: #fff; color: #475973; font-size: 12px; min-width: 0; }
.form-input:focus, .form-textarea:focus { border-color: #a8c0f7; box-shadow: 0 0 0 3px #2563eb0b; }
.form-input:disabled { background: #f6f8fb; color: #8e9eb6; }
.form-textarea { min-height: 115px; line-height: 1.8; }
.form-hint { color: #99a5b7; font-size: 10px; line-height: 1.8; margin: 0; }
.form-error { font-size: 11px; color: #cd6570; margin: 0; padding: 9px 12px; background: #fff3f4; border: 1px solid #fae1e4; border-radius: 6px; }
.form-error:empty { display: none; }
.password-field { position: relative; }
.password-field .form-input { padding-right: 43px; }
.password-field .icon-button { position: absolute; right: 5px; top: 6px; }
.dropzone { border: 1px dashed #b8c8e2; border-radius: 9px; background: #f8faff; text-align: center; padding: 28px 20px; font-size: 12px; color: #8192ac; line-height: 1.9; }
.dropzone svg { width: 30px; height: 30px; color: #89a6d4; margin-bottom: 10px; }
.dropzone strong { display: block; font-size: 13px; color: #607ea7; font-weight: 500; }
.dropzone p { font-size: 10px; color: #9aabc2; margin: 5px 0 14px; }
.dropzone:hover { border-color: #7d9fd7; background: #f3f7ff; }
.import-stats { display: flex; gap: 18px; font-size: 11px; color: #8a9ab0; margin: 19px 0 13px; }
.import-stats strong { color: #5d84c0; font-weight: 500; }
.import-preview { max-height: 230px; overflow: auto; border: 1px solid #e6edf7; border-radius: 7px; }
.import-preview .data-table th, .import-preview .data-table td { padding: 12px 14px; height: auto; font-size: 10px; }
.picker-list { max-height: 380px; overflow-y: auto; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.picker-item { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; transition: background .15s; }
.picker-item:hover { background: #f7f9fd; }
.picker-item.selected { background: #f1f6ff; border-color: #dde8fd; }
.picker-details { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #536581; min-width: 0; }
.picker-details small { font-size: 10px; color: #95a4ba; overflow: hidden; text-overflow: ellipsis; }
.picker-item .badge { margin-left: auto; }
.preview-layout { display: grid; grid-template-columns: 175px minmax(0, 1fr); min-height: 340px; border: 1px solid #e8eef6; border-radius: 8px; overflow: hidden; }
.preview-sidebar { background: #f8faff; padding: 12px 9px; border-right: 1px solid #e7edf6; }
.preview-sidebar > p { font-size: 10px; color: #9da9bd; margin: 4px 8px 12px; }
.preview-person { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 9px; background: transparent; border: 0; border-radius: 6px; text-align: left; font-size: 11px; color: #8292ac; margin-bottom: 5px; }
.preview-person.active { background: #e9f1ff; color: #4d76bd; }
.preview-person .avatar { width: 26px; height: 26px; font-size: 10px; }
.email-preview { min-width: 0; background: #fff; }
.email-header { padding: 21px 23px; border-bottom: 1px solid #edf1f7; font-size: 11px; line-height: 2; color: #8a9ab2; word-break: break-word; }
.email-header h3 { font-size: 15px; font-weight: 500; color: #4a5f7e; margin: 0 0 12px; line-height: 1.6; }
.email-header strong { color: #687f9f; font-weight: 400; }
.email-body { padding: 23px; color: #627691; font-size: 12px; line-height: 2; word-break: break-word; }
.email-body p { margin-bottom: 18px; }
.email-body p:last-child { margin-bottom: 0; }
.send-progress { padding: 20px; border: 1px solid #e6edf7; border-radius: 9px; background: #f8faff; }
.send-progress h3 { font-size: 14px; font-weight: 500; color: #58749e; margin: 0 0 12px; }
.send-progress p { font-size: 11px; color: #90a1ba; margin: 0 0 17px; }
.progress-bar { height: 7px; border-radius: 4px; background: #e4edf9; overflow: hidden; }
.progress-bar > div, .progress-bar > span { display: block; height: 100%; background: var(--blue); border-radius: 4px; transition: width .35s; }
.job-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.job-stats > div { padding: 13px; background: #f7f9fc; border-radius: 7px; text-align: center; font-size: 10px; color: #91a1b9; }
.job-stats strong { display: block; font-size: 22px; color: #6884b0; font-weight: 500; margin-bottom: 4px; }
.job-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf1f7; font-size: 11px; color: #8093ae; }
.job-row:last-child { border-bottom: 0; }
.toast-container { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 9px; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 13px 19px; border: 1px solid #e7edf5; background: #fff; color: #59718f; border-radius: 9px; box-shadow: 0 8px 32px #243c6824; font-size: 12px; display: flex; align-items: center; gap: 9px; animation: modal-in .2s ease-out; }
.toast svg { color: #52a77f; width: 17px; height: 17px; }
.segmentation { padding: 3px; border: 1px solid #e3e9f2; background: #f7f9fc; border-radius: 7px; display: inline-flex; }
.segmentation button { padding: 7px 12px; background: transparent; border: 0; color: #8da0bb; font-size: 11px; border-radius: 5px; }
.segmentation button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 4px #344f8011; }
.mobile-menu { display: none; }

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

@media (min-width: 1700px) {
  .workspace { padding-top: 40px; }
  .compose-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .editor-content { min-height: 440px; }
}
@media (max-width: 1250px) {
  .sidebar { width: 204px; padding-left: 12px; padding-right: 12px; }
  .main-shell { margin-left: 204px; }
  .brand { padding-left: 7px; gap: 8px; }
  .brand-title { font-size: 12px; }
  .topbar { padding: 0 25px; }
  .workspace { padding: 28px 25px 35px; }
  .compose-layout { grid-template-columns: minmax(0, 1fr) 245px; gap: 17px; }
  .compose-row { padding-left: 19px; padding-right: 19px; gap: 10px; }
  .sender-field { flex-wrap: wrap; gap: 6px; }
  .select { min-width: 170px; }
  .compose-template-bar { padding-left: 19px; padding-right: 19px; gap: 9px; }
  .send-summary { padding: 20px 17px; }
  .data-table th, .data-table td { padding-left: 15px; padding-right: 15px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .compose-layout { grid-template-columns: minmax(0, 1fr); }
  .compose-layout > aside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
  .compose-layout > aside > .info-box { margin: 0; align-self: start; }
  .summary-list { display: none; }
  .summary-title { margin-bottom: 10px; }
  .summary-divider { margin-top: 13px; }
  .editor-content { min-height: 300px; }
  .stat-grid { gap: 12px; }
  .stat-card { padding: 17px; }
  .stat-value { font-size: 24px; }
  .table-toolbar { flex-wrap: wrap; }
  .search-field { flex: 1; }
}
@media (max-width: 800px) {
  .sidebar { width: 74px; padding-left: 10px; padding-right: 10px; }
  .brand { padding: 0 9px 30px; }
  .brand-icon { width: 34px; height: 34px; }
  .brand > div:not(.brand-icon), .brand-title, .brand-subtitle { display: none; }
  .nav-item { justify-content: center; padding: 0; font-size: 0; height: 44px; gap: 0; }
  .nav-item .nav-icon { font-size: 14px; }
  .nav-count { display: none; }
  .sidebar-footer { padding-left: 10px; padding-right: 10px; }
  .sidebar-footer .user-info { display: none; }
  .main-shell { margin-left: 74px; }
  .topbar { height: 62px; padding: 0 22px; }
  .workspace { padding: 25px 22px; }
  .page-title { font-size: 24px; }
  .page-header { align-items: flex-start; gap: 13px; }
  .page-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .page-actions .button { font-size: 11px; padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 600px) {
  body { min-width: 360px; }
  .sidebar { width: 58px; padding: 22px 7px 16px; }
  .brand { padding: 0 5px 26px; }
  .brand-icon { width: 32px; height: 32px; border-radius: 9px; }
  .brand-icon svg { width: 18px; height: 18px; }
  .nav-item { height: 43px; }
  .sidebar-footer { padding: 15px 5px 0; }
  .user-avatar { width: 31px; height: 31px; }
  .main-shell { margin-left: 58px; }
  .topbar { height: 57px; padding: 0 15px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-button { display: none; }
  .prototype-badge { padding: 4px 6px; font-size: 9px; }
  .breadcrumb { font-size: 10px; gap: 5px; }
  .workspace { padding: 20px 13px 25px; }
  .page-header { flex-direction: column; gap: 15px; margin-bottom: 19px; }
  .page-title { font-size: 22px; margin-bottom: 5px; }
  .page-description { font-size: 10px; }
  .page-actions { justify-content: flex-start; width: 100%; }
  .button { font-size: 11px; min-height: 34px; padding: 7px 11px; }
  .compose-row { padding: 14px 13px; gap: 9px; }
  .field-label { width: 40px; font-size: 11px; }
  .sender-field .select { min-width: 0; width: 100%; }
  .recipient-chip { font-size: 10px; padding: 4px 6px; }
  .compose-template-bar { padding: 11px 13px; flex-wrap: wrap; gap: 8px; }
  .compose-template-bar .select { min-width: 0; flex: 1; }
  .compose-template-bar .text-link { font-size: 10px; }
  .template-label { font-size: 10px; }
  .editor-toolbar { padding-left: 9px; padding-right: 9px; gap: 3px; }
  .toolbar-divider { margin-left: 1px; margin-right: 1px; }
  .editor-content { padding: 22px 16px; min-height: 310px; font-size: 11px; }
  .editor-footer { padding-left: 13px; padding-right: 13px; font-size: 9px; }
  .compose-footer { padding: 13px; flex-wrap: wrap; }
  .compose-footer > div { gap: 4px; }
  .compose-footer .button { padding-left: 8px; padding-right: 8px; }
  .compose-footer .button.primary { padding-left: 12px; padding-right: 12px; }
  .compose-layout > aside { grid-template-columns: 1fr; }
  .send-summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px; }
  .summary-title { margin: 5px 0 0; }
  .summary-count { font-size: 24px; }
  .summary-divider { display: none; }
  .summary-note { grid-column: 1 / -1; }
  .stat-grid { gap: 7px; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 9px; }
  .table-toolbar { padding: 13px; gap: 10px; }
  .search-field { min-width: 170px; width: 100%; padding: 8px; }
  .filter-tabs { width: 100%; }
  .filter-tab { font-size: 10px; padding: 6px 9px; }
  .template-grid { grid-template-columns: 1fr; gap: 14px; }
  .template-card-preview { min-height: 170px; }
  .selection-bar { padding: 10px; gap: 8px; font-size: 10px; }
  .modal-overlay { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); border-radius: 10px; }
  .modal-header { padding: 17px; }
  .modal-header h2 { font-size: 15px; }
  .modal-body { padding: 17px; }
  .modal-footer { padding: 14px 17px; }
  .form-grid { grid-template-columns: 1fr; gap: 17px; }
  .preview-layout { grid-template-columns: 1fr; }
  .preview-sidebar { display: flex; align-items: center; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #e7edf6; padding: 8px; }
  .preview-sidebar > p { display: none; }
  .preview-person { flex-shrink: 0; width: auto; margin: 0; }
  .preview-person .avatar { display: none; }
  .email-header, .email-body { padding: 18px; }
  .job-stats { gap: 7px; }
  .job-stats > div { padding: 11px 6px; }
  .toast { font-size: 11px; padding: 11px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Static prototype details, keeping the Pencil visual system. */
:root { --blue:#2563eb; --blue-hover:#1d4ed8; }
body { font-size:14px; }
.sidebar-tip { margin-top:34px; padding:18px 13px; border-radius:9px; background:#f8faff; }
.sidebar-tip p { margin:10px 0 0; font-size:11px; color:#929db0; }
.recipient-field { flex:1; min-width:0; }
.recipient-field .recipients-note { margin-top:9px; }
.template-selection { display:flex; align-items:center; justify-content:space-between; gap:30px; border:1px solid #dfe6f2; background:white; border-radius:6px; padding:7px 11px; font-size:12px; color:#46546b; }
.template-selection svg { width:13px; height:13px; color:#9ba9bc; }
.sidebar .nav-item { font-size:14px; }
.page-description { font-size:13px; }
.editor-content { font-size:14px; line-height:2; min-height:350px; }
.editor-content [data-variable] { font-size:13px; }
.email-body { font-size:14px; line-height:2; }
.email-body p { margin:0 0 19px; }
.email-body [data-variable] { background:none; color:inherit; padding:0; border:0; }
.variable-control { gap:5px; font-size:11px; }
.field-label { width:62px; }
.subject-input { font-size:14px; }
.sender-field .select { max-width:100%; min-width:0; width:300px; }
.summary-person { font-size:13px; }
.summary-person p { font-size:11px; }
.summary-note { font-size:11px; }
.summary-title { font-size:14px; }
.data-table { font-size:13px; }
.data-table strong { font-weight:500; }
.data-table td { padding-top:20px; padding-bottom:20px; }
.data-table th:first-child:has(input) { width:48px; }
.contact-name strong { font-size:13px; }
.contact-name small { display:block; margin-top:5px; color:#96a1b3; font-size:11px; }
.table-caption { padding:16px 24px; font-size:11px; border-top:1px solid #edf0f6; color:#99a4b6; }
.record-subtitle { display:block; margin-top:5px; font-size:11px; font-weight:400; color:#98a3b5; }
.section-title { font-size:14px; font-weight:600; margin:0; color:#46546a; }
.employee-info { margin-bottom:20px; }
.template-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.template-symbol { width:37px; height:37px; border-radius:9px; background:#eef4ff; color:#6c93dc; display:inline-flex; align-items:center; justify-content:center; }
.template-card h2 { font-size:17px; margin:0 0 10px; font-weight:600; }
.template-card h3 { font-size:16px; font-weight:600; margin:0 0 10px; }
.template-subject,.selectable-template>p { color:#8b98ac; font-size:12px; line-height:1.7; min-height:42px; margin-bottom:14px; }
.template-card-preview { color:#9ca7b8; font-size:12px; line-height:1.9; height:112px; overflow:hidden; padding:15px 16px; background:#f8fafe; border:1px solid #edf1f8; border-radius:6px; }
.template-card-footer { margin-top:22px; }
.modal-template-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.selectable-template { text-align:left; color:inherit; width:100%; transition:border-color .15s,transform .15s; }
.selectable-template:hover { border-color:#9cb8f6; transform:translateY(-2px); }
.selectable-template>.text-link { margin-top:18px; }
.modal { max-height:90vh; display:flex; flex-direction:column; }
.modal-header,.modal-footer { flex-shrink:0; }
.modal-body { overflow-y:auto; }
.modal-header p { font-size:12px; }
.modal-footer { gap:10px; }
.modal-footer-note { display:flex; align-items:center; gap:6px; margin-right:auto; font-size:11px; color:#96a1b3; }
.modal-footer-note svg { width:14px; height:14px; }
.modal-footer-note strong { color:#49668e; }
.form-field.full { grid-column:1/-1; }
.form-field label { font-size:13px; }
.form-input { width:100%; font-size:13px; }
.form-field input[readonly] { background:#f8fafe; }
.required { color:#e08d8d; }
.form-hint { line-height:1.7; }
.password-field { display:flex; align-items:center; position:relative; }
.password-field input { padding-right:42px; }
.password-field .icon-button { position:absolute; right:6px; top:6px; }
.password-demo-info { margin-top:20px; }
.sender-identity { display:flex; align-items:center; gap:12px; padding:15px 17px; border:1px solid #e8edf5; background:#f8faff; border-radius:8px; margin-bottom:24px; }
.sender-identity strong { font-size:14px; font-weight:500; }
.sender-identity p { font-size:12px; color:#8f9caf; margin:5px 0 0; }
.picker-toolbar { display:flex; gap:12px; }
.picker-toolbar .search-field { flex:1; }
.picker-toolbar input,.search-field input { min-width:0; width:100%; border:0; background:transparent; color:#52647f; font-size:12px; outline:0; }
.picker-toolbar .select { min-width:130px; }
.picker-select-all { display:flex; gap:10px; align-items:center; color:#8592a8; font-size:12px; padding:18px 12px; border-bottom:1px solid #eef1f7; }
.picker-select-all span { margin-left:auto; color:#a5afbf; }
.picker-list { max-height:400px; overflow:auto; }
.picker-item { cursor:pointer; }
.picker-details { flex:1; min-width:0; }
.picker-details strong { font-size:13px; font-weight:500; }
.picker-details strong span { margin-left:9px; font-size:11px; color:#9fa9ba; font-weight:400; }
.picker-salutation { font-size:12px; color:#8c9ab0; }
.import-intro { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; font-size:12px; color:#8c99ad; }
.import-intro p { margin:0; }
.import-intro strong { font-weight:500; color:#5f718f; }
.dropzone { cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:12px; min-height:145px; justify-content:center; background:#f8faff; }
.dropzone:hover { border-color:#8eafea; background:#f2f6ff; }
.dropzone svg { width:28px; height:28px; color:#7397df; }
.dropzone strong { color:#607493; font-size:13px; font-weight:500; }
.dropzone span { font-size:11px; color:#a0acbf; }
.import-demo-row { display:flex; align-items:center; gap:12px; margin:16px 0; }
.import-demo-row>span { font-size:11px; color:#a0aabd; }
.import-stats { display:flex; gap:10px; margin:20px 0 12px; }
.import-preview { max-height:260px; overflow:auto; border:1px solid #e8edf6; border-radius:8px; }
.import-preview .data-table td { padding:11px 14px; font-size:12px; }
.import-preview .data-table th { padding:10px 14px; font-size:11px; }
.loading-note { color:#7693c5; font-size:12px; }
.template-editor-wrap { margin-top:22px; border:1px solid #e4eaf4; border-radius:8px; overflow:hidden; }
.template-editor-wrap .editor-content { min-height:220px; max-height:340px; overflow:auto; }
.preview-layout { gap:0; padding:0; display:grid; grid-template-columns:200px minmax(0,1fr); }
.preview-sidebar { border-right:1px solid #e8edf5; background:#fafbfe; padding:20px 13px; max-height:580px; overflow:auto; }
.preview-sidebar-title { font-size:12px; color:#8e9ab0; margin:0 10px 17px; }
.preview-sidebar-title span { margin-left:7px; }
.preview-person { display:flex; align-items:center; gap:9px; width:100%; padding:12px 10px; text-align:left; border:0; background:transparent; border-radius:7px; color:#6a7b97; margin-bottom:5px; }
.preview-person.active { background:#eaf1ff; color:#3867b9; }
.preview-person strong { font-size:12px; font-weight:500; display:block; }
.preview-person small { display:block; font-size:10px; color:#8f9fb8; margin-top:4px; }
.preview-person>svg { margin-left:auto; width:13px; height:13px; }
.email-preview { min-width:0; background:white; }
.email-header { padding:24px 28px 18px; border-bottom:1px solid #edf1f7; }
.email-header h3 { font-size:16px; line-height:1.7; margin-bottom:18px; color:#3f506d; }
.email-header p { display:flex; gap:10px; font-size:11px; line-height:1.8; margin:7px 0; word-break:break-all; color:#76869f; }
.email-header p>span:first-child { color:#a1aec1; flex-shrink:0; min-width:42px; }
.email-header p>strong { font-weight:500; }
.email-header .preview-single-note { color:#7395c8; font-size:10px; margin-top:14px; }
.preview-single-note svg { width:14px; height:14px; }
.email-body { padding:26px 28px 20px; max-height:420px; overflow:auto; color:#586c88; }
.preview-attachments { padding:0 28px 22px; display:flex; flex-wrap:wrap; gap:8px; }
.job-identity { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.job-identity>div>span { display:block; color:#a2adbf; font-size:11px; margin-bottom:7px; }
.job-identity strong { font-size:13px; font-weight:500; color:#657897; }
.send-progress { margin:26px 0 20px; }
.progress-caption { display:flex; justify-content:space-between; font-size:12px; color:#8d9bb1; margin-bottom:12px; }
.progress-caption strong { font-weight:500; color:#526b90; }
.progress-bar { width:100%; height:7px; background:#edf2fb; border-radius:10px; overflow:hidden; }
.progress-bar>span { display:block; height:100%; background:var(--blue); border-radius:10px; transition:width .3s; }
.job-details-table { margin-top:20px; max-height:350px; overflow:auto; }
.job-details-table .data-table td { padding:15px 14px; font-size:12px; }
.confirm-message { color:#6e7f99; font-size:13px; line-height:1.9; margin:4px 0; }
.toast { font-size:12px; max-width:calc(100vw - 36px); }
.toast svg { color:#7ad5ac; }
.toast-success { border-color:#bce2cd; }
.toast-error { border-color:#f1b9c0; }
.toast-warning { border-color:#ecd3a4; }
.toast-error svg { color:#c64b5a; }
.toast-warning svg { color:#a97722; }
.toast-info svg { color:#3e70ce; }
.toast>svg { flex-shrink:0; }
.toast>span { min-width:0; overflow-wrap:anywhere; line-height:1.6; }
.toast .button { flex-shrink:0; }
.editor-footer svg { height:12px; width:12px; margin-right:4px; }
@media (min-width:1600px) { .workspace { max-width:1420px; } }
@media (max-width:1250px) { .compose-layout { grid-template-columns:minmax(0,1fr) 240px; gap:16px; } .compose-row { padding:17px 19px; } .workspace { padding:28px 24px; } .sender-field { flex-wrap:wrap; } .filter-tabs { flex-wrap:wrap; } .page-actions { flex-wrap:wrap; } }
@media (max-width:1050px) { .compose-layout { grid-template-columns:minmax(0,1fr); } .compose-layout>aside { display:grid; grid-template-columns:1fr 1fr; gap:16px; } .compose-layout>aside>.info-box { margin:0; align-self:start; } .summary-list { display:none; } .summary-divider { margin:12px 0; } .summary-title { margin-bottom:10px; } .template-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .table-toolbar { flex-wrap:wrap; } .sidebar { width:200px; } .main-shell { margin-left:200px; } }
@media (max-width:760px) { .sidebar { transform:translateX(-100%); width:224px; transition:transform .2s; } .menu-open .sidebar { transform:translateX(0); box-shadow:15px 0 40px #243a6130; } .main-shell { margin-left:0; } .mobile-menu { display:inline-flex!important; } .topbar { padding:0 18px; height:62px; } .prototype-badge { font-size:9px; padding:5px 7px; } .topbar-actions { gap:5px; } .breadcrumb { gap:6px; font-size:10px; } .workspace { padding:25px 16px; } .page-header { align-items:flex-start; flex-direction:column; gap:14px; } .page-title { font-size:24px; } .page-description { font-size:12px; } .page-actions { width:100%; } .compose-row { gap:10px; padding:16px 15px; } .field-label { font-size:11px; width:52px; } .sender-field .select { font-size:11px; width:100%; } .compose-row:has(.recipient-field) { flex-wrap:wrap; } .recipient-field { min-width:calc(100% - 72px); } .compose-row:has(.recipient-field)>.button { margin-left:62px; } .compose-template-bar { padding:12px 15px; flex-wrap:wrap; } .compose-template-bar .text-link { margin-left:0; } .editor-content { padding:22px 18px; min-height:310px; font-size:13px; } .editor-footer { padding:9px 15px; font-size:9px; gap:8px; } .compose-footer { padding:14px 12px; flex-wrap:wrap; } .compose-footer>div { flex-wrap:wrap; } .compose-footer .button { font-size:11px; padding:8px 10px; } .compose-layout>aside { grid-template-columns:1fr; } .compose-layout>aside>.info-box { display:none; } .stat-grid { gap:9px; } .stat-card { padding:15px 12px; } .stat-value { font-size:24px; } .stat-label { font-size:10px; } .template-grid { grid-template-columns:1fr; } .modal-overlay { padding:12px; } .modal { max-height:95vh; width:100%; } .modal-body { padding:20px 18px; } .modal-header { padding:19px 18px; } .modal-header h2 { font-size:17px; } .modal-header p { font-size:11px; line-height:1.8; } .modal-footer { padding:15px 18px; flex-wrap:wrap; } .modal-footer-note { width:100%; } .modal-template-grid { grid-template-columns:1fr; } .preview-layout { padding:0; display:block; } .preview-sidebar { border-right:0; border-bottom:1px solid #e8edf5; display:flex; padding:10px; overflow:auto; max-height:90px; gap:6px; } .preview-sidebar-title { display:none; } .preview-person { flex-shrink:0; width:auto; min-width:118px; padding:8px; margin:0; } .preview-person>svg { display:none; } .email-header,.email-body { padding:20px; } .email-body { max-height:300px; } .picker-toolbar { flex-wrap:wrap; } .picker-toolbar .select { width:100%; } .picker-item { padding:12px 5px; } .picker-details strong span { display:none; } .picker-details small { font-size:10px; } .picker-salutation { font-size:10px; } .import-intro { align-items:flex-start; flex-direction:column; } .import-demo-row { flex-direction:column; align-items:flex-start; } .form-grid { grid-template-columns:1fr; } .job-identity { align-items:flex-start; } .job-identity strong { font-size:11px; } .toast-container { bottom:18px; } }

.login-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:#f4f7fb; }
.login-card { width:min(440px,100%); padding:32px; }
.login-card h1 { font-size:22px; }
.login-card > p { margin:20px 0; color:#64748b; }
.login-card .form-field { margin-bottom:18px; }
.login-card [type=submit] { width:100%; margin-top:16px; }
#save-status { font-size:13px; color:#64748b; }
#draft-conflict .info-box { display:flex; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.button:disabled { opacity:.6; cursor:wait; }
