/* Scoped UI additions: shared panel variables keep light and dark themes. */
.iyes-whatsapp-direct-r1,.iyes-gateway-slim-r1,.iyes-contacts-book-r1{min-width:0;max-width:100%;padding-bottom:20px}
.iyes-whatsapp-direct-r1 .iyes-v341-inline{margin-top:16px;background:var(--panel);border-color:var(--line);box-shadow:none}
.iyes-whatsapp-direct-r1 .iyes-v341-inline-head{padding:18px 20px;gap:12px;border-color:var(--line)}
.iyes-whatsapp-direct-r1 .iyes-v341-inline-head h2,.iyes-whatsapp-direct-r1 .iyes-v340-card h3{color:var(--text)}
.iyes-whatsapp-direct-r1 .iyes-v341-inline-head p,.iyes-whatsapp-direct-r1 .iyes-v340-role{color:var(--muted)}
.iyes-whatsapp-direct-r1 .iyes-v341-summary{padding:14px 20px 0}
.iyes-whatsapp-direct-r1 .iyes-v341-summary>div,.iyes-whatsapp-direct-r1 .iyes-v340-phone{background:var(--panel2);color:var(--muted);border-color:var(--line)}
.iyes-whatsapp-direct-r1 .iyes-v341-summary strong{color:var(--text)}
.iyes-whatsapp-direct-r1 .iyes-v340-grid{padding:16px 20px;gap:12px}
.iyes-whatsapp-direct-r1 .iyes-v340-card{background:var(--panel);border-color:var(--line);padding:16px;box-shadow:none}
.iyes-whatsapp-direct-r1 .iyes-v341-routing-note{margin:0 20px 18px;padding:12px;background:var(--panel2);border-color:var(--line);color:var(--text)}
.iyes-whatsapp-direct-r1 .iyes-v341-routing-note p{color:var(--muted)}
.iyes-gateway-slim-r1 .top,.iyes-contacts-book-r1 .top{gap:16px;margin-bottom:16px;align-items:center}
.iyes-gateway-slim-r1 h1,.iyes-contacts-book-r1 h1{font-size:24px;line-height:1.25;margin-bottom:6px}
.iyes-gateway-slim-r1 .top p,.iyes-contacts-book-r1 .top p{font-size:13px;margin:0;color:var(--muted)}
.iyes-gateway-slim-r1 .btn,.iyes-contacts-book-r1 .btn,.book-editor .btn{width:auto!important;min-height:36px;padding:8px 12px;border-radius:9px;font-size:13px;line-height:18px;font-weight:650;box-shadow:none}
.iyes-gateway-slim-r1 .top-actions,.iyes-contacts-book-r1 .top-actions{display:flex;flex-wrap:wrap;gap:8px}
.iyes-gateway-slim-r1 .card{background:var(--panel);border-radius:12px;box-shadow:none;padding:16px}
.iyes-gateway-slim-r1 .section{margin-top:14px}
.iyes-gateway-slim-r1 h2{font-size:17px;line-height:1.4;margin:0 0 5px}
.iyes-gateway-slim-r1 p.muted{font-size:12px;line-height:1.5;margin:4px 0 12px}
.iyes-gateway-slim-r1 .mgw-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}
.iyes-gateway-slim-r1 .mgw-grid .kpi{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;min-height:68px}
.iyes-gateway-slim-r1 .kpi span{color:var(--muted);font-weight:600;line-height:1.35;font-size:11px}
.iyes-gateway-slim-r1 .kpi strong{font-size:22px;margin:0;flex:none}
.iyes-gateway-slim-r1 .gw-protection{margin:0 0 14px;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:12px;color:var(--muted)}
.iyes-gateway-slim-r1 .gw-protection summary{color:var(--text);font-weight:650;line-height:20px}
.iyes-gateway-slim-r1 .gw-protection p{line-height:1.6;margin:8px 0 0}
.gw-tabs,.book-tabs{display:flex;align-items:center;gap:4px;overflow-x:auto;border-bottom:1px solid var(--line);margin-bottom:14px;padding-bottom:8px}
.gw-tabs button,.book-tabs button{border:0;border-radius:8px;padding:9px 13px;min-height:36px;line-height:18px;background:transparent;color:var(--muted);font-size:13px;font-weight:650;white-space:nowrap;cursor:pointer}
.gw-tabs button.active,.book-tabs button.active{background:var(--panel2);color:var(--blue)}
.iyes-gateway-slim-r1 [hidden]{display:none!important}
.iyes-gateway-slim-r1 [data-gw-panel]>.section:first-child{margin-top:0}
.iyes-gateway-slim-r1 .table-wrap{max-width:100%;overflow:auto}
.iyes-gateway-slim-r1 th,.iyes-gateway-slim-r1 td{padding:10px 12px;font-size:12px}
.iyes-gateway-slim-r1 .mgw-filter{grid-template-columns:1fr 1fr 1fr minmax(160px,1.4fr);gap:10px;padding:10px 0}
.iyes-gateway-slim-r1 .field{margin-bottom:4px;min-width:0}
.iyes-gateway-slim-r1 .field label{font-size:11px}
.iyes-gateway-slim-r1 input,.iyes-gateway-slim-r1 select{min-height:36px;padding:7px 10px;font-size:12px}
.iyes-gateway-slim-r1 .actions{gap:5px;margin:0;justify-content:flex-start}
.iyes-gateway-slim-r1 .mgw-r4-grid:empty{display:none}
.iyes-gateway-slim-r1 #iyes-meta-r4-summary .mgw-r4-grid{min-height:0;margin-top:8px}
.iyes-gateway-slim-r1 .r51-shell{margin:0;box-shadow:none}
.iyes-contacts-book-r1 .book-filters{display:flex;gap:10px;align-items:end;flex-wrap:wrap;background:var(--panel);padding:14px;border-radius:12px;box-shadow:none}
.iyes-contacts-book-r1 label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted);min-width:0}
.iyes-contacts-book-r1 .book-search{flex:1 1 240px}
.iyes-contacts-book-r1 .book-filters label:not(.book-search){flex:0 1 165px}
.iyes-contacts-book-r1 .book-filters label:has([data-book-size]){flex-basis:76px}
.iyes-contacts-book-r1 input:not([type=checkbox]),.iyes-contacts-book-r1 select{min-height:36px;padding:8px 10px;font-size:13px}
.iyes-contacts-book-r1 input[type=checkbox]{width:17px;height:17px;accent-color:var(--blue);cursor:pointer}
.book-selection,.book-pages{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 0;font-size:12px;color:var(--muted)}
.book-pages{justify-content:flex-end}
.book-note{font-size:12px;line-height:1.55;color:var(--muted);margin:10px 0 14px}
.iyes-contacts-book-r1 td{padding:12px;font-size:12px;max-width:320px;white-space:normal;overflow-wrap:anywhere}
.iyes-contacts-book-r1 td:first-child{width:38px}.iyes-contacts-book-r1 th{padding:11px 12px}
.iyes-contacts-book-r1 td:nth-child(2){min-width:170px}.book-address{font-variant-numeric:tabular-nums;min-width:140px}
.book-row-actions{display:flex;gap:6px;white-space:nowrap}
.book-chip{display:inline-flex;padding:4px 8px;background:var(--panel2);border-radius:999px;color:var(--muted);font-weight:650;font-size:11px;white-space:nowrap}
.book-chip.saved{color:var(--green);background:color-mix(in srgb,var(--green) 10%,var(--panel))}
[data-book-error]:not(:empty),.book-editor-error:not(:empty){padding:10px 12px;margin-bottom:12px;border:1px solid var(--red);border-radius:8px;color:var(--red);font-size:13px}
.iyes-interface-loading{padding:24px;border:1px solid var(--line);background:var(--panel);border-radius:12px;color:var(--muted);margin-top:16px}
.gw-tabs button:focus-visible,.book-tabs button:focus-visible,.iyes-contacts-book-r1 button:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
@media(max-width:900px){.iyes-gateway-slim-r1 .mgw-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.iyes-gateway-slim-r1 .mgw-filter{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.iyes-gateway-slim-r1 .top,.iyes-contacts-book-r1 .top{align-items:flex-start}.iyes-gateway-slim-r1 h1,.iyes-contacts-book-r1 h1{font-size:21px}.iyes-gateway-slim-r1 .top-actions,.iyes-contacts-book-r1 .top-actions{width:100%;justify-content:flex-start}.iyes-gateway-slim-r1 .mgw-grid .kpi{flex-direction:column;align-items:flex-start;padding:12px}.iyes-gateway-slim-r1 .mgw-grid{gap:8px}.iyes-gateway-slim-r1 .mgw-filter{grid-template-columns:1fr 1fr}.iyes-gateway-slim-r1 .card{padding:12px}.iyes-contacts-book-r1 .book-filters label:not(.book-search){flex:1 1 42%}.iyes-whatsapp-direct-r1 .iyes-v341-inline-head{padding:14px;flex-direction:column}.iyes-whatsapp-direct-r1 .iyes-v341-summary{padding-inline:14px}.iyes-whatsapp-direct-r1 .iyes-v340-grid{padding:14px}.iyes-whatsapp-direct-r1 .iyes-v341-routing-note{margin:0 14px 14px}.book-pages{justify-content:space-between}}
@media(pointer:coarse){.gw-tabs button,.book-tabs button,.iyes-contacts-book-r1 button,.iyes-gateway-slim-r1 button,.book-editor button{min-height:44px}}
.iyes-whatsapp-direct-r1 .iyes-v340-actions button{background:var(--panel2);border-color:var(--line);color:var(--text)}
.iyes-whatsapp-direct-r1 .iyes-v340-actions button.danger{color:var(--red)}
.iyes-whatsapp-direct-r1 .iyes-v340-tags span{background:var(--panel2);color:var(--text)}

.iyes-gateway-slim-r1 .field label{color:var(--muted);font-weight:600}
