:root {
  --navy: #ffffff;
  --navy-2: #e8f8fd;
  --ink: #333333;
  --muted: #828b95;
  --line: #dfe3e6;
  --paper: #eef2f4;
  --white: #fff;
  --lime: #bbed21;
  --lime-dark: #536b00;
  --blue: #2fc6f6;
  --blue-dark: #0075a9;
  --blue-soft: #e8f8fd;
  --red: #ff5752;
  --amber: #f9a825;
  --green: #31b46d;
  --shadow: 0 8px 22px rgba(31, 45, 61, .08);
  --shadow-overlay: 0 24px 70px rgba(31, 45, 61, .22);
}

* { box-sizing: border-box; }
html { font-family: "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: var(--ink); padding: 28px 20px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 13px; align-items: center; padding: 0 8px 34px; }
.brand strong { display: block; font-size: 22px; letter-spacing: -.4px; }
.brand small { color: #8a939d; font-size: 12px; }
.brand-mark { width: 34px; height: 34px; position: relative; display: flex; gap: 3px; align-items: end; padding: 7px; border: 0; border-radius: 9px; background: var(--blue); }
.brand-mark span { width: 5px; background: white; border-radius: 4px; }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 13px; }
nav { display: grid; gap: 7px; }
.nav-item { position: relative; border: 0; background: transparent; color: #68727d; border-radius: 8px; padding: 12px 14px; text-align: left; display: flex; align-items: center; gap: 11px; font-weight: 600; }
.nav-item { font-size: 13px; }
.nav-item span { font-size: 18px; width: 20px; text-align: center; }
.nav-item:hover { background: #f4f7f8; color: #333; }
.nav-item.active { background: var(--blue-soft); color: var(--blue-dark); }
.nav-item.active::before { content: ""; position: absolute; left: -20px; width: 3px; height: 25px; background: var(--blue); border-radius: 0 3px 3px 0; }
.nav-item i { margin-left: auto; min-width: 20px; padding: 2px 6px; text-align: center; background: var(--red); color: white; border-radius: 10px; font-size: 11px; font-style: normal; }
.log-system-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 12px; color: #535c64; }
.log-system-info > div { display: flex; align-items: center; gap: 12px; }
.log-system-info p { margin: 0; color: #68727d; }
.status-dot { width: 8px; height: 8px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 5px rgba(199,238,91,.12); }

main { min-width: 0; padding: 0 42px 48px; }
.topbar { height: 104px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: #8b94a5; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; margin-bottom: 0; letter-spacing: -.55px; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.clock { text-align: right; padding-right: 17px; border-right: 1px solid var(--line); }
.clock span, .clock b { display: block; }
.clock span { color: #9aa2b1; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.clock b { font-size: 18px; margin-top: 2px; }
.primary, .secondary, .ghost { min-height: 40px; border-radius: 4px; padding: 10px 18px; border: 0; font-weight: 700; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.primary { background: var(--lime); color: #3f4d0c; box-shadow: none; }
.primary:hover { background: #d2f95f; }
.primary:disabled { opacity: .55; cursor: wait; }
.primary span { font-size: 17px; margin-right: 5px; }
.secondary { color: #485158; background: #eef1f2; }
.ghost { color: #535c64; background: white; border: 1px solid #c6cdd1; }
.ghost:hover { background: #f5f7f8; border-color: #aeb7bc; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid rgba(47, 198, 246, .45); outline-offset: 2px; }

.view { display: none; }
.view.active { display: block; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.summary-card { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 20px 21px; min-height: 142px; box-shadow: 0 1px 2px rgba(31,45,61,.03); }
.summary-card.accent { background: white; color: var(--ink); border-color: #a9e5f8; box-shadow: inset 0 3px 0 var(--blue); }
.summary-card > div { display: flex; align-items: center; gap: 10px; }
.summary-card small { color: #969faf; font-weight: 800; letter-spacing: 1.2px; font-size: 9px; }
.summary-card strong { display: block; font-size: 35px; margin: 14px 0 3px; letter-spacing: -1px; }
.summary-card p { margin-bottom: 0; color: #8992a3; font-size: 13px; }
.summary-card.accent p { color: #8992a3; }
.icon-box { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue-dark); }
.icon-box.success { background: #eaf7f1; color: var(--green); }
.icon-box.danger { background: #fff0ef; color: var(--red); }

.panel { background: white; border: 1px solid var(--line); border-radius: 10px; min-height: 340px; overflow: hidden; box-shadow: 0 1px 2px rgba(31,45,61,.03); }
.panel-head { min-height: 65px; padding: 0 19px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.tabs { align-self: stretch; display: flex; gap: 24px; }
.tab { position: relative; border: 0; background: none; color: #7f899a; font-size: 12px; font-weight: 700; }
.tab span { margin-left: 5px; padding: 2px 6px; border-radius: 9px; background: #f0f2f5; font-size: 10px; }
.tab.active { color: var(--ink); }
.tab.active::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--blue); }
.icon-button, .close-button { border: 1px solid var(--line); background: white; border-radius: 8px; color: #788295; }
.icon-button { width: 33px; height: 33px; }
.message-list { display: grid; }
.message-card { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: "date copy status" "date actions actions"; column-gap: 18px; row-gap: 12px; align-items: start; padding: 19px 21px; border-bottom: 1px solid #edf0f3; transition: background-color .16s ease; }
.message-card:hover { background: #fbfcfa; }
.message-card:last-child { border-bottom: 0; }
.date-block { grid-area: date; padding-top: 2px; }
.date-block b, .date-block span { display: block; }
.date-block b { font-size: 13px; }
.date-block span { color: #8a94a4; font-size: 11px; margin-top: 4px; }
.message-copy { grid-area: copy; min-width: 0; }
.message-copy h3 { font-size: 14px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-copy p { color: #6f7982; font-size: 12px; margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-author { margin: -3px 0 9px; color: #8c95a5; font-size: 9px; }
.message-author b { color: #5c687c; font-weight: 750; }
.recipient-line { min-width: 0; display: flex; align-items: center; gap: 9px; }
.recipient-icon { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; background: #eff4e4; color: #607525; border-radius: 8px; font-size: 10px; font-weight: 850; }
.recipient-copy { min-width: 0; display: grid; gap: 1px; }
.recipient-copy small { color: #929baa; font-size: 8px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.recipient-copy b { color: #485158; font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 14px; padding: 6px 9px; font-weight: 800; font-size: 9px; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
.message-card > .status-pill { grid-area: status; justify-self: end; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .72; }
.status-pill.scheduled { background: #eff5df; color: #627a20; }
.status-pill.sent { background: #e8f6f0; color: #257c5b; }
.status-pill.failed { background: #fff0ef; color: #b84242; }
.status-pill.sending { background: #edf1f8; color: #49607f; }
.status-pill.canceled { background: #f0f1f3; color: #747c88; }
.row-actions { grid-area: actions; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; min-width: 0; }
.row-actions button { min-height: 34px; border: 1px solid #cbd1d5; background: white; color: #535c64; border-radius: 4px; font-size: 11px; font-weight: 650; padding: 7px 11px; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.row-actions button:hover { border-color: #c8ced8; background: #f7f8fa; color: #2f3a4e; }
.row-actions button:focus-visible { outline: 3px solid rgba(167, 198, 77, .28); outline-offset: 1px; }
.row-actions button[data-action="send-now"] { border-color: #dbe9b2; background: #f3f8e6; color: #526a17; }
.row-actions button.danger { color: #b54b4b; }
.empty { min-height: 275px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #8790a1; }
.empty h3 { color: #394255; margin: 14px 0 7px; font-size: 15px; }
.empty p { font-size: 12px; }
.empty-illustration { width: 66px; height: 52px; border: 1px solid #dfe3e9; border-radius: 10px; display: flex; align-items: end; justify-content: center; gap: 4px; padding: 12px; transform: rotate(-2deg); }
.empty-illustration span { width: 8px; border-radius: 4px; background: #dfe7c7; }
.empty-illustration span:nth-child(1) { height: 12px; }
.empty-illustration span:nth-child(2) { height: 26px; background: var(--lime); }
.empty-illustration span:nth-child(3) { height: 19px; }

.log-panel { min-height: 560px; }
.log-head { min-height: 86px; }
.log-head h2 { margin: 0 0 5px; font-size: 17px; }
.log-head p { margin: 0; color: #8b94a4; font-size: 11px; }
.log-tools { display: flex; gap: 9px; }
.search { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: white; }
.search span { color: #9aa2b1; }
.search input { border: 0; outline: 0; height: 36px; min-width: 190px; font-size: 11px; }
.log-tools select { border: 1px solid var(--line); border-radius: 8px; background: white; color: #596477; padding: 0 10px; font-size: 11px; }
.log-table-wrap { overflow-x: auto; }
.log-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: #535c64; font-size: 12px; }
.log-pagination label, .log-pagination nav { display: flex; align-items: center; gap: 8px; }
.log-pagination nav { margin-left: auto; flex-wrap: wrap; }
.log-pagination select { min-height: 36px; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; color: var(--ink); background: white; font: inherit; }
.log-pagination .ghost { min-height: 36px; padding: 7px 12px; }
.log-pagination .ghost:disabled { opacity: .45; cursor: not-allowed; background: #f5f7f8; }
.log-pagination-bottom { justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 0; }
.log-pagination :focus-visible, #logRefresh:focus-visible, #logRetry:focus-visible { outline: 2px solid var(--blue-dark); outline-offset: 2px; }
.log-load-state { padding-inline: 20px; color: #535c64; font-size: 13px; }
.log-load-state button { margin-bottom: 16px; }
@media (max-width: 600px) { .log-pagination { padding: 12px; gap: 10px; } .log-pagination nav { margin-left: 0; width: 100%; justify-content: space-between; } .log-pagination .ghost, .log-pagination select { min-height: 40px; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: #8c95a5; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; padding: 13px 18px; background: #fafbfc; }
td { padding: 15px 18px; border-top: 1px solid #edf0f3; font-size: 11px; color: #5e6879; vertical-align: top; }
td:nth-child(3) { color: #293347; font-weight: 650; }
.log-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; }
.log-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8792a4; }
.log-status.success::before { background: var(--green); }
.log-status.error::before { background: var(--red); }
.log-audience { min-width: 126px; color: #3f4b60; font-weight: 700; }
.log-detail { max-width: 340px; }
.log-code { color: #9ba3b0; font-size: 9px; margin-top: 4px; }
.empty.compact { min-height: 320px; }

.access-panel { min-height: 600px; overflow: visible; }
.access-head { padding: 28px 30px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line); }
.access-head h2 { margin: 0 0 8px; font-size: 22px; }
.access-head > div:first-child > p:last-child { max-width: 680px; margin: 0; color: #7d8798; font-size: 12px; line-height: 1.55; }
.access-summary { flex: 0 0 auto; min-width: 145px; padding: 13px 16px; border-radius: 11px; background: #f2f7e5; color: #526818; }
.access-summary b, .access-summary span { display: block; }
.access-summary b { font-size: 24px; line-height: 1; }
.access-summary span { margin-top: 5px; font-size: 9px; font-weight: 750; }
.access-tools { padding: 18px 30px; display: flex; gap: 10px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.access-search { flex: 1; }
.access-search input { width: 100%; min-width: 0; }
.access-list { padding: 12px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 480px; overflow-y: auto; }
.access-user { min-width: 0; min-height: 64px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid #e6e9ee; border-radius: 10px; background: white; cursor: pointer; transition: .15s ease; }
.access-user:hover { border-color: #ccd6b3; background: #fbfdf6; }
.access-user.selected { border-color: #b8d066; background: #f8fbeF; }
.access-user input { position: absolute; opacity: 0; pointer-events: none; }
.access-avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #e9eef6; color: #5c6d88; font-size: 10px; font-weight: 850; }
.access-user-copy { min-width: 0; display: grid; gap: 3px; }
.access-user-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #354054; font-size: 11px; }
.access-user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #929baa; font-size: 9px; }
.access-check { margin-left: auto; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #dce1e8; border-radius: 7px; color: transparent; font-size: 11px; font-weight: 900; }
.access-user.selected .access-check { border-color: #91ad3a; background: #a7c64d; color: white; }
.access-empty { grid-column: 1 / -1; padding: 55px 20px; text-align: center; color: #929baa; font-size: 12px; }
.access-footer { padding: 17px 30px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; border-top: 1px solid var(--line); }
.access-footer span { color: #8d96a6; font-size: 10px; }
.access-denied { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.access-denied[hidden] { display: none; }
.access-denied-card { width: min(480px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); text-align: center; }
.access-denied-card > span { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 16px; background: #f1f5e5; font-size: 25px; }
.access-denied-card h1 { margin-bottom: 10px; font-size: 24px; }
.access-denied-card p { margin: 0; color: #7d8798; font-size: 13px; line-height: 1.6; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(18, 27, 44, .38); backdrop-filter: blur(2px); }
.composer { position: fixed; z-index: 11; top: 0; right: 0; width: min(510px, 100vw); height: 100vh; background: white; box-shadow: -20px 0 50px rgba(20,30,50,.16); transform: translateX(104%); transition: transform .25s ease; display: flex; flex-direction: column; }
.composer.open { transform: translateX(0); }
.composer-head { height: 92px; padding: 22px 27px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.composer-head h2 { margin: 0; font-size: 21px; }
.close-button { width: 35px; height: 35px; font-size: 22px; }
#postForm { padding: 24px 27px 28px; overflow-y: auto; display: grid; gap: 20px; }
.field { display: grid; gap: 8px; position: relative; }
.field > span, .field > label { font-size: 11px; font-weight: 800; color: #465166; }
.field > span small { font-weight: 500; color: #a0a7b3; }
.field input, .field textarea { width: 100%; border: 1px solid #dfe3e9; border-radius: 9px; outline: none; padding: 11px 12px; font-size: 12px; color: var(--ink); background: white; }
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,198,246,.16); }
.field textarea { resize: vertical; line-height: 1.55; }
.message-field { gap: 0; }
.message-field > label:first-child { margin-bottom: 8px; }
.format-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 7px; border: 1px solid #dfe3e9; border-bottom: 0; border-radius: 9px 9px 0 0; background: #f8f9fa; }
.format-toolbar button { width: 29px; height: 27px; border: 0; border-radius: 6px; background: transparent; color: #586377; font-size: 11px; }
.format-toolbar button:hover { background: #e9edf2; color: #263248; }
.format-toolbar button.applied { color: #425710; background: #e8f3c9; box-shadow: 0 0 0 2px rgba(167, 198, 77, .18); }
.format-toolbar > span { width: 1px; height: 18px; margin: 0 3px; background: #dfe3e9; }
.message-field textarea { border-radius: 0 0 9px 9px; }
.format-info { min-height: 23px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin-top: 5px; }
.format-hint { color: #929baa; font-size: 9px; }
.format-feedback { color: #5d7720; font-size: 9px; font-weight: 800; opacity: 0; transform: translateY(2px); transition: .18s ease; white-space: nowrap; }
.format-feedback.show { opacity: 1; transform: translateY(0); }
.live-preview { display: block; margin-top: 6px; border: 1px solid #dde2e8; border-radius: 10px; overflow: hidden; background: white; }
.live-preview-head { min-height: 38px; padding: 8px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f5f7f3; border-bottom: 1px solid #e4e8e0; color: #47536a; font-size: 9px; font-weight: 800; letter-spacing: .15px; }
.live-preview-head > span { display: flex; align-items: center; gap: 6px; }
.live-preview-head i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(167, 198, 77, .14); }
.live-preview-head small { color: #929baa; font-size: 8px; font-weight: 600; }
.message-field > .live-preview > .composer-preview { min-height: 88px; border: 0; border-radius: 0; padding: 13px 14px; color: #303a4d; font-size: 11px; font-weight: 400; line-height: 1.55; }
.message-field > .live-preview > .composer-preview strong,
.message-field > .live-preview > .composer-preview b { font-weight: 750; }
.preview-placeholder { color: #a0a8b5; font-style: italic; }
.counter { color: #a0a7b3; font-size: 9px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eff3e6; color: #4b5d22; border-radius: 14px; padding: 5px 7px 5px 10px; font-size: 10px; font-weight: 700; }
.chip button { border: 0; background: none; color: #859365; padding: 0; width: 15px; height: 15px; }
.recipient-open { border: 1px dashed #cfd5df; border-radius: 9px; background: #fafbfc; color: #526078; text-align: left; padding: 11px 12px; font-size: 11px; font-weight: 650; }
.recipient-picker { border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: var(--shadow); }
.recipient-picker .search input { width: 100%; min-width: 0; }
.picker-tabs { display: flex; gap: 5px; margin: 9px 0; padding: 3px; background: #f1f3f6; border-radius: 8px; }
.picker-tabs button { flex: 1; border: 0; border-radius: 6px; background: transparent; color: #758094; padding: 7px; font-size: 10px; font-weight: 700; }
.picker-tabs button.active { background: white; color: #2e384b; box-shadow: 0 1px 4px rgba(20,30,50,.08); }
.recipient-results { max-height: 205px; overflow-y: auto; }
.recipient-option, .author-option { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 7px; background: white; padding: 8px; text-align: left; }
.recipient-option:hover, .author-option:hover { background: #f6f8f2; }
.recipient-option .avatar, .author-option .avatar { flex: 0 0 auto; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #edf1e1; color: #667838; font-size: 10px; font-weight: 800; }
.recipient-option .avatar.user, .author-option .avatar.user { border-radius: 50%; background: #e9eef6; color: #5e6d87; }
.recipient-option b, .recipient-option small, .author-option b, .author-option small { display: block; }
.recipient-option b, .author-option b { font-size: 10px; color: #354054; }
.recipient-option small, .author-option small { color: #9aa2b1; font-size: 9px; margin-top: 2px; }
.recipient-option i, .author-option i { margin-left: auto; color: #71852e; font-style: normal; font-weight: 850; }
.attachment-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.attachment-field > span small { font-weight: 550; text-align: right; }
.attachment-drop { min-height: 64px; border: 1px dashed #cfd6df; border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 11px; background: #fafbfc; cursor: pointer; transition: .16s ease; }
.attachment-drop:hover { border-color: #aac554; background: #f8faef; }
.attachment-drop:focus-within { outline: 3px solid rgba(167, 198, 77, .22); }
.attachment-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.attachment-drop-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #edf4d9; color: #637d1c; font-size: 20px; font-weight: 700; }
.attachment-drop > span:last-child { display: grid; gap: 3px; }
.attachment-drop b { color: #3b4659; font-size: 11px; }
.attachment-drop small { color: #9099a8; font-size: 9px; font-weight: 500; }
.attachment-list { display: grid; gap: 7px; margin-top: 8px; }
.attachment-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) 28px; align-items: center; gap: 10px; min-height: 60px; padding: 6px 7px; border: 1px solid #e3e7ec; border-radius: 9px; background: white; }
.attachment-item img, .attachment-file-icon { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; }
.attachment-file-icon { display: grid; place-items: center; background: #eef1f5; color: #6f798b; font-size: 8px; font-weight: 850; }
.attachment-info { min-width: 0; display: grid; justify-items: start; gap: 3px; }
.attachment-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #465166; font-size: 10px; }
.attachment-item small, .attachment-summary { color: #929baa; font-size: 9px; }
.attachment-item .attachment-remove { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: #9aa2ae; font-size: 17px; }
.attachment-item .attachment-remove:hover { background: #fff0ef; color: #b54b4b; }
.attachment-summary { display: block; margin-top: 6px; text-align: right; }
.author-field > small { color: #8f98a7; font-size: 9px; line-height: 1.4; }
.author-open { width: 100%; min-height: 52px; padding: 7px 10px; display: flex; align-items: center; gap: 10px; border: 1px solid #d9dee6; border-radius: 10px; background: white; text-align: left; transition: .16s ease; }
.author-open:hover, .author-open[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,198,246,.14); }
.author-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #edf4d9; color: #607723; font-size: 10px; font-weight: 850; }
.author-avatar.user { border-radius: 50%; background: #e9eef6; color: #5e6d87; }
.author-copy { min-width: 0; display: grid; gap: 2px; }
.author-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #354054; font-size: 11px; }
.author-copy small { color: #929baa; font-size: 9px; }
.author-chevron { margin-left: auto; color: #7e889a; font-size: 17px; transition: transform .16s ease; }
.author-open[aria-expanded="true"] .author-chevron { transform: rotate(180deg); }
.author-picker { padding: 9px; }
.author-picker .search { margin-bottom: 8px; }
.author-picker .search input { width: 100%; min-width: 0; }
.author-results { max-height: 230px; }
.author-option > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.author-hint { margin: 10px 8px 6px; color: #6a737f; font-size: 12px; }
.author-copy b { white-space: normal; overflow-wrap: anywhere; }
.author-open[aria-invalid="true"] { border-color: #d83c3c; }
.author-field > #authorError { color: #b52c2c; font-size: 12px; }
.author-open:focus-visible, .author-option:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.message-file-count { display: inline-flex; align-items: center; margin: -2px 0 9px; padding: 3px 7px; border-radius: 9px; background: #f1f3f6; color: #707b8d; font-size: 9px; font-weight: 700; }
.detail-attachments { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-attachments span { min-width: 130px; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid #e0e5eb; border-radius: 9px; background: #fafbfc; }
.detail-attachments b { color: #435067; font-size: 10px; overflow-wrap: anywhere; }
.detail-attachments small { color: #939cab; font-size: 9px; }
.send-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.send-mode label { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.send-mode label:has(input:checked) { border-color: #a8c74d; background: #f9fceb; }
.send-mode input { width: auto; margin: 2px 0 0; accent-color: #718d1f; }
.send-mode b, .send-mode small { display: block; }
.send-mode b { font-size: 10px; }
.send-mode small { color: #929bab; font-size: 8px; margin-top: 3px; }
.datetime-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.datetime-row label > span { display: block; color: #8a93a4; font-size: 9px; margin-bottom: 5px; }
.composer-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.form-error { color: #ad3c3c; background: #fff1f0; border-radius: 8px; padding: 9px 11px; font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: #3b434a; color: white; box-shadow: var(--shadow); border-radius: 6px; padding: 12px 16px; font-size: 12px; transition: .22s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: #a93f3f; }

.modal-backdrop { position: fixed; inset: 0; z-index: 12; background: rgba(18, 27, 44, .44); backdrop-filter: blur(3px); }
.detail-modal { position: fixed; z-index: 13; inset: 50% auto auto 50%; width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 44px); transform: translate(-50%, -50%); background: white; border-radius: 12px; box-shadow: var(--shadow-overlay); overflow: hidden; }
.detail-head { min-height: 88px; padding: 21px 25px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 0; font-size: 20px; }
.detail-body { padding: 22px 25px 26px; overflow-y: auto; max-height: calc(100vh - 132px); }
.detail-meta { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr .7fr; gap: 12px; padding: 15px; border-radius: 11px; background: #f6f7f4; }
.detail-meta small, .detail-section > small { display: block; color: #8b94a3; font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 7px; }
.detail-meta b { color: #354055; font-size: 11px; }
.detail-section { margin-top: 21px; }
.detail-recipients { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-recipients span { padding: 6px 9px; border-radius: 14px; background: #eff3e6; color: #52632d; font-size: 10px; font-weight: 700; }
.post-preview { border: 1px solid var(--line); border-radius: 11px; padding: 17px 18px; color: #303a4d; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.post-preview blockquote { margin: 8px 0; padding: 9px 13px; border-left: 3px solid #a7c64d; background: #f7faef; color: #5a6577; }
.post-preview ul { margin: 8px 0; padding-left: 21px; }
.post-preview a { color: #5274a8; }
.detail-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fff1f0; color: #a84242; font-size: 11px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 78px 1fr; }
  .sidebar { padding: 25px 12px; }
  .brand > div:last-child, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item span { font-size: 19px; }
  main { padding-inline: 24px; }
  .message-card { grid-template-columns: 76px minmax(0, 1fr) auto; column-gap: 14px; }
}

@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 5; top: auto; bottom: 0; width: 100%; height: 62px; padding: 8px 16px; flex-direction: row; }
  .brand { display: none; }
  .sidebar nav { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .nav-item { font-size: 11px; justify-content: center; }
  .nav-item.active::before { left: 25%; right: 25%; top: -8px; width: auto; height: 2px; border-radius: 2px; }
  main { padding: 0 14px 82px; }
  .topbar { height: 92px; margin-bottom: 17px; }
  h1 { font-size: 24px; }
  .clock { display: none; }
  .top-actions .primary { width: 42px; height: 42px; padding: 0; font-size: 0; }
  .top-actions .primary span { margin: 0; font-size: 22px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:first-child { grid-column: 1 / -1; }
  .summary-card { min-height: 118px; padding: 16px; }
  .summary-card strong { font-size: 29px; margin-top: 10px; }
  .tabs { gap: 10px; overflow-x: auto; }
  .tab { white-space: nowrap; font-size: 10px; }
  .message-card { grid-template-columns: 1fr auto; grid-template-areas: "date status" "copy copy" "actions actions"; gap: 11px; }
  .row-actions { justify-content: flex-start; }
  .recipient-line { align-items: flex-start; flex-wrap: wrap; }
  .recipient-copy { flex: 1 1 180px; }
  .log-head { align-items: flex-start; padding-block: 16px; display: grid; gap: 12px; }
  .log-tools { width: 100%; display: grid; }
  .search input { min-width: 0; width: 100%; }
  .send-mode { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .access-head { padding: 22px; display: grid; }
  .access-summary { width: 100%; }
  .access-tools { padding: 14px 18px; }
  .access-list { grid-template-columns: 1fr; padding: 10px; }
  .access-footer { padding: 14px 18px; flex-direction: column; align-items: stretch; }
}
