@font-face { font-family: Inter; src: url('/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  font: 14px/1.45 Inter, system-ui, sans-serif;
  color: #202e29;
  background: #f7f9f6;
  --ink: #202e29;
  --muted: #5e6d64;
  --quiet: #6c796f;
  --rule: #e5ebe5;
  --green: #215e47;
  --green-dark: #184b37;
  --green-soft: #e7f1e9;
  --white: #fff;
  --sidebar-width: 213px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, select, input, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid #399371; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
svg.icon { display: inline-block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
#app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 25px 15px 15px; background: #f1f5ef; border-right: 1px solid #e1e8df; }
.brand { display: inline-flex; align-items: center; align-self: flex-start; gap: 10px; margin: 0 0 28px 9px; color: #1c3e31; font-size: 27px; font-weight: 790; letter-spacing: -.085em; line-height: 1; }
.brand-logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #215e47; color: #fff; }
.brand-dot { color: #539778; }
.workspace, .member { display: flex; align-items: center; gap: 9px; min-width: 0; }
.workspace { min-height: 57px; padding: 8px; border: 1px solid #dce5db; background: #f8faf7; border-radius: 10px; }
.workspace-avatar, .member-avatar { flex: none; display: grid; place-items: center; width: 31px; height: 31px; background: #e0eade; color: #3b5d49; font-weight: 720; border-radius: 8px; }
.member-avatar { border-radius: 50%; background: #dcece4; font-size: 10px; }
.workspace strong, .member strong, .workspace small, .member small { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.workspace strong, .member strong { font-size: 12px; font-weight: 690; }
.workspace small, .member small { color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.navigation { display: grid; gap: 4px; margin-top: 25px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #56675c; text-align: left; font-weight: 580; font-size: 13px; }
.nav-item:hover { background: #e8eee6; }
.nav-item.current { background: #dcece2; color: #24533e; font-weight: 690; }
.nav-item b { margin-left: auto; padding: 2px 7px; background: #f8fbf7; border-radius: 6px; color: #32644f; font-weight: 690; font-size: 10px; }
.sidebar-end { margin-top: auto; }
.member { margin-top: 13px; padding: 12px 8px 2px; border-top: 1px solid #dfe7de; }
.main-shell { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0 30px; height: 65px; background: #fbfcfa; border-bottom: 1px solid var(--rule); }
.crumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 500; }
.crumb strong { color: var(--ink); font-weight: 650; }
.demo-label { display: flex; align-items: center; gap: 7px; color: #3b5c48; border: 1px solid #deeadf; background: #f0f6ee; padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 630; white-space: nowrap; }
.demo-label i { width: 6px; height: 6px; border-radius: 50%; background: #589870; }
.inbox-wrap, .secondary-page { padding: 23px 29px 27px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
h1 { font-size: 32px; font-weight: 745; letter-spacing: -.057em; line-height: 1.2; }
.page-heading p { color: var(--muted); margin-top: 5px; font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.button.primary { color: white; background: var(--green); border-color: var(--green); }
.button.primary:hover:enabled { background: var(--green-dark); }
.button.outline { background: white; border-color: #dce5dc; color: #3b5245; }
.button.outline:hover { background: #f2f7f2; }
.simulate { min-height: 39px; padding: 0 13px; }
.inbox-grid { display: grid; grid-template-columns: minmax(238px,.92fr) minmax(330px,1.8fr) minmax(224px,.79fr); height: calc(100dvh - 199px); min-height: 510px; background: white; border: 1px solid #e0e7e0; border-radius: 13px; overflow: hidden; box-shadow: 0 2px 7px #26483408; }
.inbox-grid.no-details { grid-template-columns: minmax(238px,.9fr) minmax(330px,2.6fr); }
.threads, .chat, .details { min-width: 0; min-height: 0; }
.threads { display: flex; flex-direction: column; border-right: 1px solid var(--rule); }
.threads-tools { display: flex; align-items: center; gap: 8px; padding: 15px 13px 8px; }
.search { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; padding: 0 9px; height: 34px; border: 1px solid #e3e9e3; border-radius: 8px; background: #f8faf7; color: var(--muted); }
.search:focus-within { border-color: #639a80; }
.search input { border: 0; outline: none; min-width: 0; width: 100%; padding: 0; background: transparent; font-size: 11.5px; }
.search input::placeholder { color: #68776d; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 7px; color: #5d7063; background: transparent; flex: none; }
.icon-button:hover { background: #f0f5ef; color: var(--green); }
.icon-button.filter { height: 34px; border-color: #e3e9e3; }
.icon-button.on { color: #1e6347; background: #e6f2e9; }
.thread-tabs { display: flex; gap: 12px; min-height: 40px; padding: 0 13px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.thread-tabs button { position: relative; padding: 0 1px; border: 0; background: transparent; color: var(--muted); font-weight: 570; font-size: 11px; }
.thread-tabs button.current { color: var(--green); font-weight: 720; }
.thread-tabs button.current::after { content: ''; position: absolute; bottom: -1px; inset-inline: 0; height: 2px; border-radius: 2px; background: #317254; }
.thread-tabs small { padding: 2px 4px; border-radius: 4px; background: #edf2ed; color: #4b6555; font-size: 9px; }
.thread-list, .message-list, .details { overflow: auto; scrollbar-width: thin; scrollbar-color: #d9e4db transparent; }
.conversation-row { width: 100%; display: flex; gap: 10px; text-align: left; padding: 14px 12px 12px 11px; border: 0; border-bottom: 1px solid #edf1ed; border-left: 3px solid transparent; background: white; min-height: 86px; }
.conversation-row:hover { background: #f6f9f5; }
.conversation-row.selected { border-left-color: #37775a; background: #edf5ef; }
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; color: var(--avatar-fg); background: var(--avatar-bg); font-size: 11px; font-weight: 720; }
.channel-mark { display: inline-grid; place-items: center; flex: none; color: var(--channel); }
.channel-mark.channel-badge { position: absolute; bottom: -2px; right: -3px; width: 17px; height: 17px; color: var(--channel); background: var(--channel-tint); border: 2px solid white; border-radius: 50%; }
.row-copy { min-width: 0; flex: 1; }
.row-top, .row-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.row-top strong { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-weight: 690; font-size: 12px; }
.row-top time { color: var(--quiet); font-size: 10px; white-space: nowrap; }
.row-preview { display: block; margin: 2px 0 7px; color: #5a6a60; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot, .pill > span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.unread-dot { width: 6px; height: 6px; background: #408366; margin-right: 2px; }
.pill { display: inline-flex; align-items: center; gap: 4px; width: max-content; border-radius: 20px; background: #e5f1e7; color: #346248; font-weight: 600; font-size: 9px; padding: 1px 6px; white-space: nowrap; }
.pill.pending { background: #f8efdb; color: #7d5c23; }
.pill.resolved { background: #edf0ed; color: #58655c; }
.chat { display: flex; flex-direction: column; }
.chat-header { display: flex; align-items: center; gap: 9px; padding: 0 14px; min-height: 68px; border-bottom: 1px solid var(--rule); }
.chat-title { flex: 1; display: grid; min-width: 0; }
.chat-title strong { font-size: 13px; font-weight: 710; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title span:not(.channel-mark) { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.chat-avatar { width: 34px; height: 34px; font-size: 10px; }
.mobile-back { display: none; }
.message-list { flex: 1; padding: 16px 21px 15px; min-height: 0; background: #fcfdfb; }
.date-divider { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 10px; font-weight: 600; color: #69796d; }
.date-divider::before, .date-divider::after { content: ''; height: 1px; flex: 1; background: #e9eee8; }
.message { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 14px; }
.message.outgoing { justify-content: flex-end; }
.message-content { max-width: min(86%, 405px); min-width: 0; }
.message-avatar { width: 25px; height: 25px; font-size: 8px; margin-bottom: 1px; }
.message-meta { display: flex; align-items: center; gap: 6px; color: #617269; font-size: 10px; margin: 0 1px 4px; }
.message-meta strong { color: #435b4e; font-size: 10.5px; font-weight: 670; }
.message-meta .icon { color: #4a8669; }
.outgoing .message-meta { justify-content: flex-end; }
.bubble { padding: 10px 12px; border-radius: 11px 11px 11px 3px; background: #f0f3ef; color: #283b31; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.outgoing .bubble { border-radius: 11px 11px 3px 11px; background: #e2f0e6; }
.outgoing .bubble.failed { background: #fae8e6; }
.send-error { display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: #932e23; font-size: 11px; }
.send-error button { border: 0; padding: 4px; color: #932e23; background: transparent; text-decoration: underline; }
.event-line { display: flex; align-items: center; justify-content: center; gap: 6px; color: #446e58; font-size: 11px; margin: 0 0 15px; }
.internal-message { display: flex; gap: 9px; background: #fbf5e9; color: #725733; padding: 9px 10px; border-radius: 8px; margin-bottom: 14px; font-size: 11px; }
.internal-message p { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer-area { border-top: 1px solid #edf0ec; padding: 13px 15px 10px; background: #fff; }
.composer { border: 1px solid #dde7df; border-radius: 10px; overflow: hidden; }
.composer:focus-within { border-color: #83a891; }
.composer.note-mode { background: #fffaf0; border-color: #e7ddc3; }
.composer-modes { display: flex; gap: 3px; padding: 6px 7px 2px; }
.composer-modes button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 0; border-radius: 5px; background: transparent; color: #5f7064; font-size: 11px; font-weight: 620; }
.composer-modes button.current { background: #edf5ee; color: #335c47; }
.note-mode .composer-modes button.current { background: #f5e9ce; color: #705831; }
.composer textarea { display: block; width: 100%; padding: 5px 10px; resize: vertical; min-height: 45px; max-height: 120px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.composer textarea::placeholder { color: #6c7a70; }
.composer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 6px 6px 10px; }
.composer-bottom .button { min-height: 30px; }
.composer-channel, .window-label { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: 10px; }
.window-label { margin: 6px 2px 0; }
.window-label.expired { color: #8f4b2c; }
.details { border-left: 1px solid var(--rule); display: flex; flex-direction: column; }
.details-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 14px; min-height: 47px; }
.details-header h2 { font-size: 12px; font-weight: 720; }
.profile { display: grid; justify-items: center; gap: 4px; padding: 9px 10px 14px; }
.profile-avatar { width: 51px; height: 51px; font-size: 15px; margin-bottom: 2px; }
.profile h3 { font-size: 14px; font-weight: 730; }
.profile > span:last-child { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.detail-section { border-top: 1px solid var(--rule); padding: 12px 14px; }
.field-heading, .section-head h3, .automation-state h3 { display: block; color: #354940; font-size: 11px; font-weight: 690; }
.inline-select { display: flex; align-items: center; position: relative; height: 31px; padding: 0 8px; margin-top: 5px; color: #687a70; border: 1px solid #e1e8e2; border-radius: 7px; }
.inline-select + .field-heading { margin-top: 9px; }
.inline-select select { position: absolute; inset: 0; height: 100%; width: 100%; border: 0; background: transparent; appearance: none; padding: 0 26px 0 29px; font-size: 11px; color: #34483e; cursor: pointer; }
.inline-select .icon:last-child { margin-left: auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: -3px -5px 4px 0; }
.section-head .icon-button { width: 25px; height: 25px; }
.section-head .icon-button .icon { width: 14px; height: 14px; }
.tags { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 5px; }
.tag { max-width: 100%; overflow-wrap: anywhere; background: #eef3ec; color: #47634f; padding: 2px 6px; border: 1px solid #e1e9df; border-radius: 5px; font-size: 10px; font-weight: 570; }
.tag:hover:is(button) { background: #e3efe5; }
.muted, .details dl { color: var(--muted); font-size: 10px; }
.details dl > div { display: flex; justify-content: space-between; gap: 9px; margin-bottom: 5px; }
.details dl > div:last-child { margin-bottom: 0; }
.details dd { text-align: right; color: #394e43; overflow-wrap: anywhere; }
.automation-state { display: flex; gap: 8px; align-items: flex-start; background: #f7faf6; flex: 1 0 auto; }
.automation-state p { font-size: 10px; color: var(--muted); margin: 2px 0 4px; }
.automation-icon { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #e4efe6; color: #3a7358; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 690; text-align: left; }
.text-button:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 20px; font-size: 12px; }
.secondary-page { max-width: 1320px; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.tile { padding: 17px; border: 1px solid #e1e8e0; border-radius: 12px; background: white; box-shadow: 0 2px 6px #26483408; min-width: 0; }
.tile h2 { font-size: 16px; font-weight: 720; letter-spacing: -.025em; overflow-wrap: anywhere; }
.tile p { color: var(--muted); font-size: 12px; margin: 7px 0 13px; overflow-wrap: anywhere; }
.tile-top, .tile-actions { display: flex; align-items: center; gap: 8px; }
.tile-top { justify-content: space-between; margin-bottom: 10px; }
.tile-top .channel-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--channel-tint); }
.tile-actions { flex-wrap: wrap; }
.tile .tags { margin-top: 6px; }
.rule-status { padding: 3px 7px; border-radius: 5px; background: #f0f2ef; color: #56645b; font-size: 10px; font-weight: 650; }
.rule-status.live { background: #e4f1e7; color: #3b684c; }
.activity, .settings-card + .settings-card { margin-top: 13px; }
.activity ul { margin: 8px 0 0; padding: 0; list-style: none; }
.activity li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 11px; }
.activity li small { display: block; color: var(--muted); }
.channel-state { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.contact-table { padding: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 12px; }
td, th { padding: 10px 13px; border-bottom: 1px solid var(--rule); }
th { color: var(--muted); font-size: 11px; font-weight: 650; background: #f9fbf8; }
tbody tr:last-child td { border-bottom: 0; }
.contact-link { display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; }
.contact-link:hover strong { color: var(--green); text-decoration: underline; }
.contact-channel { display: inline-flex; align-items: center; gap: 5px; }
.settings-card { max-width: 640px; }
.settings-card .modal-field { width: min(280px,100%); }
dialog { width: min(465px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 19px; border: 1px solid #dce7de; background: #fff; border-radius: 14px; color: var(--ink); box-shadow: 0 14px 45px #223c2d31; }
dialog::backdrop { background: #162d2363; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-head h2 { font-size: 19px; font-weight: 740; letter-spacing: -.025em; overflow-wrap: anywhere; }
dialog p { color: var(--muted); font-size: 12px; margin: 3px 0 14px; }
.modal-body { display: grid; gap: 10px; }
.modal-field { display: grid; gap: 5px; color: #40584a; font-size: 12px; font-weight: 640; }
.modal-field input, .modal-field select, .modal-field textarea { width: 100%; padding: 8px; border: 1px solid #dce6df; border-radius: 7px; background: #fcfdfb; color: var(--ink); font-weight: 460; }
.modal-field textarea { resize: vertical; }
.modal-footer { display: flex; gap: 7px; justify-content: flex-end; margin-top: 15px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: flex; align-items: center; gap: 5px; color: #40584a; font-size: 12px; }
.check input { accent-color: var(--green); }
#rule-result { white-space: pre-wrap; font-size: 12px; color: var(--green); }
#toast { position: fixed; z-index: 4; right: 20px; bottom: 20px; max-width: min(355px, calc(100% - 40px)); padding: 9px 13px; border-radius: 8px; background: #254d3c; color: white; font-size: 12px; opacity: 0; pointer-events: none; }
#toast.visible { opacity: 1; }
@media (max-width: 1210px) {
  :root { --sidebar-width: 184px; }
  .inbox-wrap, .secondary-page { padding-left: 20px; padding-right: 20px; }
  .topbar { padding: 0 21px; }
  .inbox-grid { grid-template-columns: minmax(215px,.92fr) minmax(285px,1.66fr) minmax(185px,.76fr); }
  .thread-tabs { gap: 9px; }
  .detail-section { padding-left: 11px; padding-right: 11px; }
}
@media (max-width: 1020px) {
  :root { --sidebar-width: 62px; }
  .sidebar { padding: 20px 9px 12px; }
  .brand { margin-left: 4px; margin-bottom: 9px; }
  .brand > span:last-child, .workspace, .nav-item > span, .member > div { display: none; }
  .nav-item { justify-content: center; position: relative; }
  .nav-item b { position: absolute; right: 1px; top: 1px; padding: 0 4px; font-size: 8px; }
  .member { justify-content: center; padding-inline: 0; }
}
@media (max-width: 830px) {
  .inbox-grid, .inbox-grid.no-details { grid-template-columns: minmax(0,1fr); min-height: 423px; height: calc(100dvh - 166px); }
  .inbox-grid[data-mobile-view="list"] > :not(.threads), .inbox-grid[data-mobile-view="chat"] > :not(.chat), .inbox-grid[data-mobile-view="details"] > :not(.details) { display: none; }
  .inbox-grid .details, .inbox-grid .threads { border: 0; }
  .mobile-back { display: inline-grid; }
  .topbar { height: 51px; }
  .inbox-wrap, .secondary-page { padding: 16px 12px; }
  .page-heading { margin-bottom: 14px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p { font-size: 11px; }
  .rule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  :root { --sidebar-width: 49px; }
  .sidebar { padding: 15px 5px 10px; }
  .brand { margin-left: 2px; }
  .brand-logo { width: 34px; height: 34px; }
  .topbar { padding: 0 12px; }
  .simulate { min-height: 35px; padding-inline: 7px; font-size: 10px; gap: 4px; }
  .simulate .icon { width: 13px; }
  .page-heading { gap: 6px; }
  .chat-header { padding-inline: 6px; gap: 5px; }
  .chat-header .resolve { padding-inline: 5px; font-size: 10px; }
  .message-list { padding-inline: 10px; }
  .composer-area { padding-inline: 8px; }
}
.messenger-test-message { border-left: 2px solid #79a78e; background: #f5f8f4; padding: 8px 12px; margin-bottom: 10px; font-size: 11px; }
.messenger-test-message p { margin: 3px 0 0; white-space: pre-wrap; }
#messenger-reply { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0 0 10px; }
#messenger-reply label { flex: 1 0 190px; }
