/* Item 378: two-pane Telegram CS inbox */

.telegram-inbox-layout{
  display:grid;
  grid-template-columns:minmax(20rem,22.5rem) minmax(0,1fr);
  gap:16px;
  align-items:stretch;
  min-height:calc(100vh - 14rem);
}
.telegram-inbox-list-pane,
.telegram-inbox-thread-pane{
  background:#fff;
  border:1px solid #d7e4e2;
  border-radius:16px;
  min-height:28rem;
  display:flex;
  flex-direction:column;
  min-width:0;
}
.telegram-inbox-list-toolbar{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:16px 16px 12px;
  border-bottom:1px solid #edf2f3;
}
.telegram-inbox-list-heading{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  min-width:0;
}
.telegram-inbox-list-heading h2{
  margin:0;
  font-size:17px;
  letter-spacing:-.02em;
}
.telegram-inbox-list-heading p{
  margin:0;
  color:var(--admin-muted, #5b6b75);
  font-size:12px;
  white-space:nowrap;
}
.telegram-inbox-filters{
  display:flex;
  flex-direction:column;
  gap:8px;
  width:100%;
  min-width:0;
}
.telegram-inbox-search-field,
.telegram-inbox-filter-field{
  display:block;
  width:100%;
  min-width:0;
}
.telegram-inbox-search-field input{
  width:100%;
  box-sizing:border-box;
  min-height:42px;
  padding:8px 12px;
  border:1px solid #c9d6d4;
  border-radius:12px;
  font:500 13px/1.4 system-ui,sans-serif;
}
.telegram-inbox-filter-row{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.telegram-inbox-filter-field{flex:1}
.telegram-inbox-filter-field select{
  width:100%;
  box-sizing:border-box;
  min-height:42px;
  padding:8px 12px;
  border:1px solid #c9d6d4;
  border-radius:12px;
  font:500 13px/1.4 system-ui,sans-serif;
  background:#fff;
}
.telegram-inbox-filters .admin-filter-button{
  flex:0 0 auto;
  white-space:nowrap;
}
.telegram-inbox-list-body{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  position:relative;
}
.telegram-inbox-conversation-list{
  overflow:auto;
  flex:1;
}
.telegram-inbox-list-pane .admin-empty-state,
.telegram-inbox-thread-pane > .admin-empty-state{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  margin:0;
  padding:32px 24px;
  min-height:16rem;
}
.telegram-inbox-item{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #edf2f3;background:#fff;padding:12px 16px;cursor:pointer}
.telegram-inbox-item:hover,
.telegram-inbox-item.is-active{background:#f4faf9}
.telegram-inbox-item-title{display:flex;justify-content:space-between;gap:8px;font:650 14px/1.3 system-ui,sans-serif;color:#16344c}
.telegram-inbox-item-meta{margin:4px 0 0;color:#5b6b75;font:500 12px/1.35 system-ui,sans-serif}
.telegram-inbox-unread{display:inline-flex;min-width:1.25rem;justify-content:center;border-radius:999px;background:#0b5f86;color:#fff;font:700 11px/1.4 system-ui,sans-serif;padding:0 6px}
.telegram-inbox-thread{flex:1;min-height:0;display:flex;flex-direction:column}
.telegram-inbox-thread-header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:16px;border-bottom:1px solid #edf2f3}
.telegram-inbox-peer-meta{margin:4px 0 0;color:#5b6b75;font:500 13px/1.4 system-ui,sans-serif}
.telegram-inbox-thread-actions{display:flex;flex-wrap:wrap;gap:8px}
.telegram-inbox-messages{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:10px;background:#f7fbfa}
.telegram-inbox-bubble{max-width:min(36rem,86%);padding:10px 12px;border-radius:14px;background:#fff;border:1px solid #d7e4e2;font:500 14px/1.45 system-ui,sans-serif;color:#16344c;white-space:pre-wrap}
.telegram-inbox-bubble.is-outbound{margin-left:auto;background:#e6f4fb;border-color:#b9deef}
.telegram-inbox-bubble time{display:block;margin-top:6px;color:#5b6b75;font:500 11px/1.3 system-ui,sans-serif}
.telegram-inbox-composer{padding:12px 16px 16px;border-top:1px solid #edf2f3;display:flex;flex-direction:column;gap:8px}
.telegram-inbox-composer textarea{width:100%;border:1px solid #c9d6d4;border-radius:12px;padding:10px 12px;font:500 14px/1.4 system-ui,sans-serif;resize:vertical}
.telegram-inbox-composer-actions{display:flex;justify-content:space-between;gap:8px;align-items:center}
.telegram-inbox-flag{color:#9a3412;font:650 12px/1.3 system-ui,sans-serif}
.telegram-support-target-choices{display:grid;gap:8px;margin:12px 0}
.telegram-support-choice{display:grid;gap:10px;padding:10px 12px;border:1px solid #d7e4e2;border-radius:12px}
.telegram-support-choice:has(input[name="telegramSupportTarget"]:checked){border-color:#0b5f86;background:#f4faf9}
.telegram-support-choice > label{display:grid;grid-template-columns:20px minmax(0,1fr);gap:10px;align-items:start;cursor:pointer}
.telegram-support-target-choices small{display:block;margin-top:4px;color:#5b6b75;font-weight:500}
.telegram-support-handle-field{display:grid;gap:6px;margin-left:30px}
.telegram-support-handle-field label,
.telegram-support-handle-field .admin-field{display:block;grid-template-columns:none;cursor:default;white-space:nowrap}
.telegram-support-handle-field input[type="text"]{width:min(100%,22rem);max-width:100%;padding:8px 10px;border:1px solid #c5d3d0;border-radius:8px;font:inherit}
.telegram-support-handle-field input[type="text"]:disabled{background:#f3f5f5;color:#5b6b75}
.telegram-support-webhook-note{display:block;margin-top:2px;color:#5b6b75;font-weight:500}

@media (max-width:900px){
  .telegram-inbox-layout{grid-template-columns:1fr;min-height:0}
  .telegram-inbox-list-pane,
  .telegram-inbox-thread-pane{min-height:18rem}
}
