:root{font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;color:#18212a;background:#f2f4f6;color-scheme:light}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}main{max-width:590px;margin:auto;min-height:100dvh;padding:env(safe-area-inset-top) max(14px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
header,.brand,#search,.channels,.line,.meta{display:flex;align-items:center;gap:9px}header{justify-content:space-between;padding:17px 0;border-bottom:1px solid #dbe0e5}.brand{font-weight:750}.brand b{border-radius:11px;background:#17252c;color:#fff;padding:10px;font-size:14px}.brand small{color:#54636e;font-size:13px}
h1{font-size:28px;letter-spacing:-.7px;margin:18px 0 12px}button,input,select{font:inherit;min-height:44px;border-radius:11px;border:1px solid #ccd4d9;background:#fff;color:inherit;padding:8px 11px}button{cursor:pointer}input{width:100%;min-width:0}#filters{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}#filters button{font-size:13px;padding:6px 8px}.primary,[aria-pressed=true]{background:#203c39;color:white;border-color:#203c39}.channels{font-size:14px;margin-bottom:12px}#rows{display:grid;gap:7px}.card{display:flex;text-align:left;width:100%;align-items:center;gap:10px;padding:10px;background:#fff;border-color:#dce3e7}.avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:50%;background:#e4ece9;color:#284e46;font-size:12px;font-weight:bold}.body{flex:1;min-width:0}.line{justify-content:space-between}.name,.preview{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.name{font-weight:720}.preview{font-size:14px;color:#42525e;margin:4px 0}.meta{flex-wrap:wrap;font-size:12px;color:#51616c}.badge{border-radius:6px;padding:3px 6px;background:#e7f0f6;color:#16496c;font-weight:bold}.badge[data-channel=Instagram]{background:#f5e7f2;color:#78316c}.badge[data-channel=Website]{background:#e1efe6;color:#27593e}.badge[data-channel=Email]{background:#f5edda;color:#6a4a14}.count{border-radius:12px;background:#203c39;color:white;padding:2px 6px;margin-left:auto}time{font-size:12px;color:#52606a;white-space:nowrap}#back,#next,#older{margin:10px 0}#messages{display:grid;gap:10px}.bubble{background:#fff;padding:10px 12px;border-radius:12px;max-width:87%;justify-self:start;white-space:pre-wrap;overflow-wrap:anywhere}.out{justify-self:end;background:#dceee6}.bubble small{display:block;color:#455a61;margin-bottom:5px}#signin form{display:grid;gap:12px;max-width:360px}#signin label{display:grid;gap:5px}#notice{padding:10px;background:#fff0d9;border-radius:8px}
input{font-size:16px}.bubble{min-width:0;max-width:min(87%,480px);word-break:break-word}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #245a51;outline-offset:2px}
header{padding:4px 0;min-height:52px}.brand b{padding:7px 9px}
h1{font-size:22px;margin:12px 0 8px}
#rows,#messages{grid-template-columns:minmax(0,1fr)}
.card{display:grid;grid-template-columns:36px minmax(0,1fr);min-width:0;max-width:100%}
.card .avatar{width:36px;height:36px}.line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
.preview{white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
#filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.45fr)}
#filters button{min-width:0;overflow-wrap:anywhere}.channels select{min-width:0;max-width:100%}
.thread-open{overflow:hidden}
.thread-open main{position:fixed;top:var(--viewport-top,0px);inset-inline:0;height:var(--viewport-height,100dvh);min-height:0;display:flex;flex-direction:column;padding-bottom:0}
#thread{min-height:0;flex:1;display:flex;flex-direction:column;min-width:0}
.thread-head{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:3px 8px;padding:4px 0}
#client{margin:0;font-size:19px;overflow-wrap:anywhere}#back{margin:0;padding-inline:7px;font-size:13px}
#details{grid-column:1/-1;font-size:13px;overflow-wrap:anywhere;padding:3px 0}
#tools,.editor-tools,.template-tabs{display:flex;gap:5px;flex-wrap:wrap}
#tools{padding-bottom:4px}#tools button,.editor-tools button,.editor-tools select,.file-picker{font-size:13px}
#history{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:7px 0 12px}
.bubble{max-width:94%;line-height:1.4}.note{background:#fff3d8;border:1px solid #e9d49e}
.message-meta{display:flex;flex-wrap:wrap;gap:3px 8px;font-size:12px;color:#52606a;margin-bottom:4px}
.translation{border-top:1px solid #ccd4d9;margin-top:6px;padding-top:5px;color:#24463f}.translation p{margin:6px 0 0}
#editor{border-top:1px solid #ccd4d9;background:#f2f4f6;padding:6px 0 max(6px,env(safe-area-inset-bottom));flex:none}
.editor-input{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;margin-top:5px}
textarea{font:inherit;font-size:16px;min-width:0;width:100%;border:1px solid #ccd4d9;border-radius:10px;padding:8px;resize:none;color:inherit;background:#fff}
.file-picker{position:relative;display:grid;place-items:center;min-height:44px;border:1px solid #ccd4d9;border-radius:11px;background:#fff;padding:6px 9px;overflow:hidden}
.file-picker input{position:absolute;inset:0;opacity:0;cursor:pointer}
.file-picker:focus-within{outline:2px solid #245a51}
#file-preview{display:flex;align-items:center;gap:6px;font-size:13px;margin-top:4px}#file-preview span,.attachment{overflow-wrap:anywhere}
#editor-status{font-size:12px;margin:4px 0}#send{line-height:1.15;font-size:13px}
.attachment img{display:block;max-width:100%;max-height:220px;object-fit:contain;margin:5px 0}.attachment a{color:#245a51}
dialog{width:min(calc(100% - 24px),550px);max-height:min(75dvh,var(--viewport-height,100dvh));border:1px solid #ccd4d9;border-radius:15px;padding:12px;color:inherit;overflow:auto;background:#fff}
dialog::backdrop{background:#18212a66}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.panel-head h2{font-size:19px;margin:0}
#panel-body,.panel-form,.templates{display:grid;gap:7px;margin-top:8px}#panel-body p,#panel-body h3{margin:4px 0}
.toggle{display:flex;align-items:center;gap:9px;min-height:38px}.toggle input{width:18px;min-height:18px;flex:none}
.templates details{border:1px solid #dce3e7;border-radius:9px;padding:8px;overflow-wrap:anywhere}
summary{cursor:pointer}dl{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:8px;font-size:14px}
dd{margin:0;overflow-wrap:anywhere}dt{color:#52606a}
