/* Aturan bersama; dimuat terakhir agar ukuran layar konsisten antarhalaman. */
html{width:100%;min-height:100%;overflow-x:clip}
.contact-page-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.new-contact-card{margin-bottom:12px}
.new-contact-card h2{font-size:14px;margin:0 0 12px}
.new-contact-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
.new-contact-form label{display:grid;gap:5px;min-width:0;font-size:12px;font-weight:600}
.new-contact-address{grid-column:1/-1}.new-contact-form .help{margin:0}
@media(max-width:600px){.new-contact-form{grid-template-columns:1fr}.contacts-page .page-heading{flex-wrap:wrap;gap:10px}.contact-page-actions .btn{min-height:36px}}
.chat-forward-link{display:inline-block;margin:0 0 5px 14px;color:#008069;font-size:12px;text-decoration:none;padding:3px 5px;border-radius:4px}
.chat-forward-link:hover,.chat-forward-link:focus-visible{background:#e7f8f4;text-decoration:underline}
.forward-dialog{width:min(400px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;border:0;border-radius:14px;color:#111b21;background:#fff;box-shadow:0 8px 40px #0004;font:14px Arial,sans-serif}
.forward-dialog::backdrop{background:#0005}
.forward-header{display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid #e9edef}
.forward-header h2{font-size:14px;font-weight:400;margin:0}
.forward-close{border:0;background:transparent;font-size:25px;color:#54656f;cursor:pointer;width:28px;height:28px}
.forward-modal-form{display:flex;flex-direction:column;max-height:calc(100dvh - 110px);padding:0 16px 14px}
.forward-search{width:100%;font:inherit;margin:12px 0;border:1px solid #00a884;border-radius:24px;padding:10px 14px;box-sizing:border-box}
.forward-caption{margin:6px 0 12px;color:#667781;font-size:12px}
.forward-leaders{overflow-y:auto;min-height:90px;max-height:46dvh}
.forward-leader{display:flex;align-items:center;gap:14px;padding:12px 4px;cursor:pointer;min-height:66px}
.forward-leader[hidden]{display:none}
.forward-leader:hover{background:#f5f6f6}
.forward-leader input{accent-color:#00a884;width:17px;height:17px;flex-shrink:0}
.forward-avatar{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#d8f3ed;color:#008069;flex-shrink:0;font-size:18px}
.forward-leader strong,.forward-leader small{display:block;overflow-wrap:anywhere}
.forward-leader strong{font-weight:400}.forward-leader small{margin-top:4px;color:#667781;font-size:12px}
.forward-preview{padding:10px 0;border-top:1px solid #e9edef;color:#54656f;font-size:12px}
.forward-preview p{white-space:pre-wrap;overflow-wrap:anywhere;max-height:100px;overflow-y:auto;background:#f0f2f5;padding:8px;border-radius:6px}
.forward-status{font-size:12px;line-height:1.4;overflow-wrap:anywhere;margin:6px 0}
.forward-modal-form footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.forward-selected{font-size:12px;color:#54656f;overflow-wrap:anywhere}
body{min-width:0;overflow-y:auto;overflow-x:clip}
img,video{max-width:100%;height:auto}
.shell,.card,.card-body,.field,.gateway-form label,.contact-edit-form label{min-width:0}
.input,.select,.textarea{min-width:0;max-width:100%}
.notice,.page-alert,.help,.wa-preview{overflow-wrap:anywhere}
.contacts-page,.wa-page{width:100%}
.portal-shell .chat-sender-label{font-weight:800!important;font-size:12px!important;line-height:16px!important;color:#263c46!important;margin-bottom:4px!important}
.contact-status-summary a.contact-status-chip{text-decoration:none;cursor:pointer;border:1px solid transparent}
.contact-status-summary a.contact-status-chip:hover{border-color:#0d9488}
.contact-status-summary a.contact-status-active{border-color:#0d9488;box-shadow:0 0 0 1px #0d9488}
.contact-status-summary a.contact-status-chip:focus-visible{outline:2px solid #0d9488;outline-offset:3px}
.contact-db-search{flex-wrap:wrap;align-items:end;max-width:none}
.contact-sort-label{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px}
.contact-sort-label .select{width:145px}
.contact-edit-form{grid-template-columns:repeat(3,minmax(0,1fr))}
.contact-edit-actions{flex-wrap:wrap}
.contact-type-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;margin:0 0 16px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.contact-type-form label{display:grid;gap:5px;flex:1 1 180px;max-width:320px;font-size:12px;font-weight:600}
.contact-type-form .help{flex:1 1 100%;margin:0}
.contact-type-form .btn{min-height:40px}
/* Dua baris isian desktop: identitas di atas, jenis dan nomor pendek di bawah. */
@media(min-width:901px){
 .contacts-page .contact-edit-card .card-body{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:6px 8px;align-items:end;padding:10px 12px}
 .contacts-page .contact-edit-card h2{grid-column:1/-1;grid-row:1;margin:0}
 .contacts-page .contact-type-form,.contacts-page .contact-edit-form{display:contents}
 .contacts-page .contact-edit-form>label:nth-of-type(1){grid-column:1/3;grid-row:2}
 .contacts-page .contact-edit-form>label:nth-of-type(2){grid-column:3/6;grid-row:2}
 .contacts-page .contact-edit-form>label:nth-of-type(3){grid-column:6/-1;grid-row:2}
 .contacts-page .contact-edit-form>label:nth-of-type(6){grid-column:1/3;grid-row:3}
 .contacts-page .contact-type-form>.btn{grid-column:3/5;grid-row:3;justify-self:start;min-height:34px;height:34px;padding:6px 10px;font-size:12px}
 .contacts-page .contact-type-form>.help{display:none}
 .contacts-page .contact-type-form .select{height:34px;min-height:34px;padding:6px 8px;font-size:12px}
 .contacts-page .contact-edit-form>label:nth-of-type(4){grid-column:3/7;grid-row:3}
 .contacts-page .contact-edit-form>label:nth-of-type(5){grid-column:7/8;grid-row:3}
 .contacts-page .contact-edit-actions{grid-column:8/-1;grid-row:3;justify-content:flex-end;align-self:end}
 .contacts-page .contact-save-rule{grid-column:1/-1;grid-row:4;margin:0;font-size:10px;line-height:1.3}
 .contacts-page .contact-edit-form>label{display:flex;flex-wrap:wrap;align-items:baseline;align-self:end;gap:3px 4px;line-height:1.2}
 .contacts-page .contact-edit-form>label>.input,.contacts-page .contact-edit-form>label>.textarea,.contacts-page .contact-edit-form>label>.select{flex:0 0 100%;width:100%;height:34px;min-height:34px;margin:0;padding:6px 8px;font-size:12px}
 .contacts-page .contact-edit-form textarea[name="address"]{width:100%;min-height:34px;height:34px;resize:vertical}
}
.contact-table-wrap{max-width:100%;overflow-x:auto}
.contact-nosa-lookup{display:flex;gap:6px;align-items:center;flex:0 0 100%;width:100%;min-width:0}
.contact-nosa-lookup .input{flex:1;min-width:0;width:0;height:34px;margin:0;padding:6px 8px;font-size:12px}
.contact-nosa-lookup .btn{flex:none;white-space:nowrap;height:34px;min-height:34px;margin:0;padding:6px 10px;font-size:12px}
.contact-lookup-status{grid-column:1/-1;grid-row:5;margin:0;color:#087f72}
.contact-lookup-status:empty{display:none}
.contacts-page .contact-table th:nth-child(9),.contacts-page .contact-table td:nth-child(9){width:155px}
.contacts-page .contact-actions{white-space:nowrap}
.contact-delete-form{display:inline-block;margin:0 0 0 4px;vertical-align:top}
.contacts-page .contact-table{min-width:1080px}
.contacts-page .contact-table td:nth-child(5),.contacts-page .contact-table td:nth-child(6){max-width:none;white-space:normal;overflow:visible;overflow-wrap:anywhere}
.topbar{flex-shrink:0}
body:has(>.portal-shell){display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden!important}
body:has(>.portal-shell)>.topbar{flex:0 0 auto}
body:has(>.portal-shell)>.portal-shell{flex:1 1 0;height:auto!important;min-height:0!important;overflow:hidden!important}
.portal-shell .connection-strip{flex-wrap:wrap}
.portal-shell .connection-login{max-width:100%;min-width:0;grid-template-columns:repeat(2,minmax(0,1fr)) auto}
.portal-shell .inbox-titlebar{flex-wrap:wrap;gap:8px}
.portal-shell .inbox-metrics{max-width:100%;min-width:0}
.portal-shell .chat-bubble{flex-shrink:0;overflow-wrap:anywhere}
.portal-shell .conversation-row.is-contact-saved,.portal-shell .conversation-row.is-contact-unsaved{background:#fff!important;border-left:0!important}
.portal-shell .conversation-row.is-contact-saved:hover,.portal-shell .conversation-row.is-contact-unsaved:hover{background:#f5f6f6!important}
.portal-shell .conversation-row.is-contact-saved.active,.portal-shell .conversation-row.is-contact-unsaved.active{background:#dce2e6!important}
.portal-shell .conversation-row.is-contact-saved .conversation-name,.portal-shell .conversation-row.is-contact-unsaved .conversation-name{color:#17212b!important}
.portal-shell .conversation-list .conversation-row.is-contact-saved .conversation-name{font-weight:700!important}
.portal-shell .conversation-row.is-contact-saved .badge-contact-saved{background:#e8f5e9!important;color:#18713a!important}
.portal-shell .conversation-row.is-contact-unsaved .badge-contact-unsaved{background:#fff3e0!important;color:#a65300!important}
.portal-shell .conversation-row .badge-internal{background:#eef1f4!important;color:#52616b!important}
.portal-shell .conversation-row .conversation{padding-top:11px!important;padding-bottom:11px!important}
.portal-shell .conversation-badges{gap:6px;margin-top:6px!important}
.portal-shell .conversation-top+.ticket-message{margin-top:5px!important}
.conversation-pin{display:inline-flex;align-self:center;flex:0 0 auto;color:#667781}
.portal-shell .conversation-row{flex-wrap:wrap}
.portal-shell .conversation-row .conversation{flex-basis:100%;box-sizing:border-box}
.conversation-pin-form{margin:-5px 10px 7px 74px;position:relative;z-index:1}
.conversation-pin-button{border:0;background:transparent;color:#52616b;font:inherit;font-size:12px;padding:4px 6px;min-height:28px;cursor:pointer;border-radius:4px}
.conversation-pin-button:hover,.conversation-pin-button:focus-visible{background:#e8f5f1;color:#007f70;outline:2px solid #9bd8cb;outline-offset:1px}
.portal-shell .editor .field label,.portal-shell .editor .siap-explainer p{font-size:12px!important}
.portal-shell .summary-field{grid-column:1/-1!important;min-width:0}
.nosa-lookup-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.nosa-lookup-row .input{flex:1 1 160px;min-width:0;width:auto}
.nosa-lookup-row .btn{flex:0 0 auto;white-space:nowrap}
.nosa-lookup-result{margin-top:7px;padding:9px 11px;background:#f0faf7;border:1px solid #c8e5dc;border-radius:7px;font-size:12px;overflow-wrap:anywhere}
.nosa-lookup-result p{margin:4px 0;font-size:12px}
.nosa-lookup-result small{font-size:11px;color:var(--muted)}
.portal-shell .summary-field .message-picker{margin-bottom:6px;width:100%;max-width:100%}
.portal-shell .editor .summary-field textarea[name="summary"]{height:150px;min-height:150px;resize:vertical}
.panel-complaint .editor-heading .eyebrow,.panel-complaint .editor-heading .editor-title{font-size:12px!important}
.panel-complaint .editor-heading .editor-title{font-weight:700!important}
.customer-header .customer-heading .customer-address{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;white-space:normal;margin-top:3px!important;font-size:12px!important;line-height:1.35;color:var(--wa-muted)!important}
.customer-title-row{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 10px;min-width:0}
.customer-title-row h1{min-width:0;max-width:100%}
.customer-header .customer-heading .customer-phone{margin:0!important;white-space:normal;overflow-wrap:anywhere;font-size:12px!important}
.portal-shell .chat-reply-form{padding-bottom:max(8px,env(safe-area-inset-bottom))!important}
@media(max-width:1100px) and (min-width:901px){
 .portal-shell>.grid{grid-template-columns:minmax(300px,34%) minmax(0,1fr)!important}
 .portal-shell .connection-counters{order:3;width:100%;margin-left:0!important}
}
@media(max-width:900px){
 .topbar{height:auto!important;min-height:52px!important;display:flex;flex-wrap:wrap;gap:7px!important;padding:8px 10px!important}
 .topbar .brand{flex:0 0 auto}
 .topbar .top-actions{display:flex!important;flex:1 1 100%!important;width:100%!important;max-width:100%!important;min-width:0;margin:0!important;overflow-x:auto!important;flex-wrap:nowrap;gap:6px!important;padding-bottom:2px}
 .topbar .top-actions .btn{display:inline-flex!important;flex:0 0 auto;min-height:36px!important;padding:7px 9px!important;font-size:12px!important;white-space:nowrap}
 .topbar .top-actions .user-name{display:none}
 .portal-shell{padding:0!important}
 .portal-shell>.grid{grid-template-columns:minmax(0,1fr)!important;border-radius:0!important}
 .no-selection .portal-shell .detail-card,.has-selection .portal-shell .inbox-card{display:none!important}
 .has-selection .portal-shell .connection-strip{display:none!important}
 .portal-shell .connection-title{width:auto;flex:1 1 150px}
 .portal-shell .connection-login{display:grid!important;flex:1 1 320px;width:100%!important;gap:6px!important}
 .portal-shell .connection-login label{width:auto!important;min-width:0!important}
 .portal-shell .connection-login .btn{grid-column:auto!important;width:auto!important}
 .portal-shell .connection-login .input{width:100%;font-size:16px!important}
 .portal-shell .connection-counters{display:none!important}
 .portal-shell .inbox-titlebar{min-height:0!important;padding:10px!important}
 .portal-shell .inbox-metrics{display:flex!important;flex:1 1 100%;overflow-x:auto}
 .portal-shell .inbox-metrics span{display:inline-flex!important;flex:0 0 auto;min-width:0;font-size:10px!important}
 .portal-shell .inbox-metrics span:after{content:none!important}
 .portal-shell .inbox-toolbar .filters{position:static}
 .portal-shell .detail-back{display:inline-flex!important;flex:0 0 34px;align-items:center;justify-content:center;width:34px;height:34px;font-size:0!important;color:transparent!important}
 .portal-shell .detail-back:before{content:'‹';color:var(--wa-ink);font-size:28px;line-height:1}
 .portal-shell .customer-status{max-width:30%;white-space:normal;text-align:right}
 .portal-shell .chat-messages-inline{padding:12px 10px!important}
 .portal-shell .chat-bubble{max-width:88%!important}
 .portal-shell .editor{max-width:none!important;width:100%;padding:14px!important}
 .portal-shell #complaint-editor{grid-template-columns:minmax(0,1fr)!important}
 .portal-shell #complaint-editor>.field,.portal-shell #complaint-editor>.form-actions{grid-column:1/-1!important}
}
@media(max-width:700px){
 .shell{padding:10px}
 .input,.textarea,.select{font-size:16px}
 .contacts-page .contact-edit-form{grid-template-columns:minmax(0,1fr)}
 .contacts-page .contact-edit-form .input,.contacts-page .contact-edit-form .textarea{height:auto;min-height:42px;font-size:16px}
 .contacts-page .contact-db-search .input,.contacts-page .contact-db-search .select{height:42px;min-height:42px;font-size:16px}
 .contacts-page .contact-db-search .btn{min-height:42px;height:auto}
 .contact-table-wrap{overflow:visible}
 .contacts-page .contact-table,.contacts-page .contact-table tbody{display:block;width:100%!important;min-width:0;max-width:100%}
 .contacts-page .contact-table thead{display:none}
 .contacts-page .contact-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px 12px;margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fff}
 .contacts-page .contact-table .contact-internal-row{background:#fffdf3}
 .contacts-page .contact-table td{display:block;width:auto!important;min-width:0!important;max-width:none;white-space:normal!important;padding:0!important;border:0;overflow-wrap:anywhere;font-size:14px}
 .contacts-page .contact-table td:before{display:block;margin-bottom:3px;font-size:11px;font-weight:600;color:var(--muted)}
 .contacts-page .contact-table td:nth-child(1):before{content:'No'}
 .contacts-page .contact-table td:nth-child(2):before{content:'Kontak'}
 .contacts-page .contact-table td:nth-child(3):before{content:'Status simpan'}
 .contacts-page .contact-table td:nth-child(4):before{content:'No. HP'}
 .contacts-page .contact-table td:nth-child(5):before{content:'Nama'}
 .contacts-page .contact-table td:nth-child(6):before{content:'Alamat'}
 .contacts-page .contact-table td:nth-child(7):before{content:'NOSA / NOKO'}
 .contacts-page .contact-table td:nth-child(8):before{content:'Aduan'}
 .contacts-page .contact-table td:nth-child(5),.contacts-page .contact-table td:nth-child(6),.contacts-page .contact-table td:nth-child(9),.contacts-page .contact-table td[colspan]{grid-column:1/-1}
 .contacts-page .contact-actions{display:flex!important;gap:8px}
 .contacts-page .contact-actions .btn{flex:1;min-height:40px;font-size:12px;margin:0!important}
 .contacts-page .contact-delete-form{display:flex;flex:1;min-width:0;margin:0}
 .contact-status{flex-wrap:wrap;white-space:normal}
 .contact-edit-actions .btn{flex:1;min-height:40px}
 .contact-type-form label{max-width:none}
 .contact-type-form .select{min-height:42px}
 .wa-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .wa-stat:last-child{grid-column:1/-1}
 .wa-stat strong{overflow-wrap:anywhere}
 .wa-section{padding:14px}
 .qr-head{flex-wrap:wrap}
 .qr-head .btn{width:100%}
}
@media(max-width:380px){
 .portal-shell .connection-login{grid-template-columns:repeat(2,minmax(0,1fr))}
 .portal-shell .connection-login .btn{grid-column:1/-1!important}
 .portal-shell .dashboard-empty{padding:18px!important}
 .portal-shell .dashboard-empty h2{font-size:20px!important}
 .portal-shell .detail-tabs a{min-width:0!important;flex:1;font-size:11px!important}
}

/* Daftar desktop mengikuti skala WhatsApp Web; baris tumbuh bila ada alamat/label. */
@media(min-width:761px){
 .portal-shell .conversation-list .conversation-row{min-height:66px!important;height:auto!important}
 .portal-shell .conversation-list .conversation-row .conversation{gap:12px!important;padding:8px 12px!important;min-height:66px}
 .portal-shell .conversation-list .conversation-avatar{width:42px!important;height:42px!important;flex-basis:42px!important;font-size:16px!important}
 .portal-shell .conversation-list .conversation-name{font-size:14px!important;line-height:20px!important}
 .portal-shell .conversation-list .ticket-message{font-size:13px!important;line-height:18px!important}
 .portal-shell .conversation-list .conversation-preview{font-size:13px!important;line-height:18px!important;margin-top:2px}
 .portal-shell .conversation-list .conversation-time{font-size:11px!important;line-height:16px!important}
 .portal-shell .conversation-list .conversation-pin-form{margin-left:64px}
}

/* Menu sematan tidak mengambil baris tambahan, termasuk pada layar sentuh. */
.conversation-menu{position:absolute;right:8px;top:23px;z-index:2}
.conversation-menu summary{list-style:none;cursor:pointer;width:26px;height:26px;display:grid;place-items:center;border-radius:50%;color:#667781;font-size:20px}
.conversation-menu summary::-webkit-details-marker{display:none}
.conversation-menu summary:hover,.conversation-menu summary:focus-visible{background:#e9edef;outline:2px solid #9bd8cb}
.conversation-menu .conversation-pin-form{position:absolute;right:0;top:27px;margin:0!important;background:#fff;box-shadow:0 2px 12px #111b2133;border:1px solid #e9edef;border-radius:6px;padding:5px;white-space:nowrap}
.portal-shell .conversation-row:has(.conversation-menu[open]){overflow:visible!important;z-index:5}
.portal-shell .conversation-row:has(.conversation-menu) .ticket-message{padding-right:25px!important}
.conversation-badges .conversation-preview{min-width:0;flex:1;margin:0!important}
@media(min-width:761px){
 .portal-shell{padding-top:6px!important;padding-bottom:6px!important}
 .portal-shell .connection-strip{min-height:36px!important;margin-bottom:6px!important;padding:3px 10px!important}
 .portal-shell .connection-title small{font-size:10px!important}
 .portal-shell .inbox-titlebar{min-height:46px!important;padding:8px 16px!important;background:#fff!important}
 .portal-shell .inbox-titlebar h1{font-size:20px!important;color:#128c5e}
 .portal-shell .inbox-titlebar p,.portal-shell .inbox-metrics{display:none!important}
 .portal-shell .inbox-toolbar{padding:4px 12px 8px!important;gap:8px!important}
 .portal-shell .inbox-toolbar .contact-search .input{height:36px!important;border-radius:20px!important;font-size:13px!important}
 .portal-shell .inbox-toolbar .filters .btn{min-height:28px!important;padding:4px 10px!important;font-size:12px!important}
 .portal-shell .conversation-list .conversation-row{height:66px!important;min-height:66px!important;flex-wrap:nowrap}
 .portal-shell .conversation-list .conversation-row .conversation{min-height:66px;height:66px;padding:6px 12px!important}
 .portal-shell .conversation-list .conversation-name{font-weight:400!important;line-height:18px!important}
 .portal-shell .conversation-list .is-unread .conversation-name{font-weight:700!important}
 .portal-shell .conversation-list .ticket-message{margin-top:1px!important;line-height:18px!important;font-weight:400!important}
 .portal-shell .conversation-list .conversation-badges{height:15px;gap:4px;margin-top:1px!important;min-width:0}
 .portal-shell .conversation-list .conversation-badges .badge{font-size:9px!important;line-height:13px!important;padding:0 4px!important;flex-shrink:0;white-space:nowrap}
 .portal-shell .conversation-list .conversation-badges .conversation-preview{font-size:11px!important;line-height:15px!important}
 .portal-shell .conversation-list .unread-count{height:16px;min-width:16px;font-size:10px;flex-shrink:0}
}
