/* TS WhatsApp V15.12.0 — correct global nested-section spacing, preserve native
   CRUD/forms, align dashboard/updater cards and make WhatsApp-size chat bubbles. */

/* Historical global CSS adds margin-top:24px to the second section in every
   content > div. Those sections are GRID ITEMS here; the margin broke their
   alignment even though the grid's row sizing was otherwise correct. */
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail,
html body.ts-studio.page-updater main.content .profile-grid {
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch!important;
  column-gap:16px!important;
  row-gap:16px!important;
  margin-top:0!important;
  margin-bottom:18px!important;
}
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail > section.card,
html body.ts-studio.page-updater main.content .profile-grid > section.card,
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail > section.card + section.card,
html body.ts-studio.page-updater main.content .profile-grid > section.card + section.card {
  box-sizing:border-box!important;
  margin:0!important;
  transform:none!important;
  align-self:stretch!important;
  position:relative!important;
  min-width:0!important;
  height:100%!important;
  max-width:none!important;
}
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail > section.card {
  display:flex!important;
  flex-direction:column!important;
  padding:16px 18px!important;
  gap:10px!important;
}
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail > section.card h3 {
  margin:0!important;
  font-size:16px!important;
  line-height:1.35!important;
}
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail :is(.task-list,.quick-grid) {
  align-content:start!important;
  margin-top:0!important;
}
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail :is(.task-list a,.quick-grid a) {
  min-height:42px!important;
  padding:10px 12px!important;
  line-height:1.35!important;
  font-size:12px!important;
  text-decoration:none!important;
}
html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail .quick-grid {
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
}
html body.ts-studio.page-updater main.content .profile-grid > section.card {
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
  padding:18px!important;
  gap:10px!important;
}
html body.ts-studio.page-updater main.content .profile-grid > section.card p.muted {
  min-height:0!important;
  margin:0 0 4px!important;
  line-height:1.5!important;
}
html body.ts-studio.page-updater main.content .profile-grid > section.card form {
  margin:0!important;
  min-width:0!important;
}
html body.ts-studio.page-updater main.content .profile-grid > section.card .status-panel {
  margin-top:0!important;
  min-height:42px!important;
  width:100%!important;
}
/* Visual alignment: both sections begin at the top. Each card fills the same
   grid row, but content naturally flows without huge blank inner gaps. */
html body.ts-studio.page-updater main.content .profile-grid > section.card:last-child .status-panel {
  margin-top:auto!important;
}

/* WhatsApp Web chat: content-sized messages, not tall tiles or wide panels. */
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row {
  display:flex!important;
  align-items:flex-start!important;
  margin:2px 0!important;
  padding:0!important;
  min-height:0!important;
}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.in {justify-content:flex-start!important}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.out {justify-content:flex-end!important}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row .message-bubble {
  position:relative!important;
  display:block!important;
  box-sizing:border-box!important;
  width:max-content!important;
  min-width:0!important;
  max-width:min(72%,500px)!important;
  margin:0!important;
  padding:5px 8px 5px!important;
  border-radius:8px!important;
  font-size:12px!important;
  line-height:1.4!important;
  box-shadow:0 1px 1px rgba(0,0,0,.06)!important;
  overflow-wrap:anywhere!important;
  overflow:visible!important;
}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.in.group-start .message-bubble{border-top-left-radius:2px!important}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.out.group-start .message-bubble{border-top-right-radius:2px!important}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.group-cont .message-bubble{border-radius:6px!important}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble .message-body {
  display:block!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  font-size:12px!important;
  line-height:1.43!important;
  font-weight:400!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble .message-origin {
  display:block!important;
  margin:0 0 3px!important;
  font-size:9px!important;
  line-height:1.28!important;
  font-weight:500!important;
  opacity:.77!important;
}
/* Metadata is now inside .message-body immediately after the actual message
   text, so it behaves like WA Web: to the right of the final words, with a
   natural wrap only when there is truly no room. No absolute overlap. */
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble .message-body > .message-meta {
  display:inline-flex!important;
  position:static!important;
  float:none!important;
  vertical-align:baseline!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  gap:3px!important;
  white-space:nowrap!important;
  width:auto!important;
  margin:0 0 0 6px!important;
  padding:0!important;
  line-height:1!important;
  font-size:9px!important;
  font-weight:400!important;
  opacity:.75!important;
  color:inherit!important;
}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble .message-body > .message-meta > span {
  display:inline!important;
  font-size:9px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble .message-meta .message-status {
  font-size:11px!important;
  letter-spacing:-2px!important;
  font-weight:750!important;
}
html[data-theme='light'] body.ts-studio.page-inbox .inbox-v3 .message-row.out .message-status.status-read,
html[data-theme='dark'] body.ts-studio.page-inbox .inbox-v3 .message-row.out .message-status.status-read {color:#37b6df!important;opacity:1!important}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble .message-delete-form {
  display:inline-flex!important;
  position:absolute!important;
  top:-22px!important;
  right:-8px!important;
  z-index:6!important;
  margin:0!important;
  padding:0!important;
  width:auto!important;
  visibility:hidden!important;
  opacity:0!important;
}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble:hover .message-delete-form,
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble:focus-within .message-delete-form {
  visibility:visible!important;
  opacity:1!important;
}
html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-delete-form button {
  display:inline-flex!important;
  justify-content:center!important;
  align-items:center!important;
  width:26px!important;
  height:26px!important;
  min-width:26px!important;
  min-height:26px!important;
  padding:0!important;
  border-radius:7px!important;
  background:#fff!important;
  color:#a62b2b!important;
  border:1px solid #e1e5ec!important;
  box-shadow:0 2px 6px rgba(0,0,0,.1)!important;
  font-size:14px!important;
}
html[data-theme='dark'] body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-delete-form button{background:#263b50!important;color:#f3b3b3!important;border-color:#49617a!important}
@media(hover:none){html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-bubble .message-delete-form{visibility:visible!important;opacity:.8!important}}
html[data-theme='light'] body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.in .message-bubble{background:#fff!important;border:1px solid #dee5ed!important;color:#162940!important}
html[data-theme='light'] body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.out .message-bubble{background:#d9fdd2!important;border:1px solid #c8eac5!important;color:#153b32!important}
html[data-theme='dark'] body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.in .message-bubble{background:#1f2b37!important;border:1px solid #334655!important;color:#edf6ff!important}
html[data-theme='dark'] body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row.out .message-bubble{background:#075e52!important;border:1px solid #156f61!important;color:#edfff9!important}

@media(max-width:900px){
  html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail,
  html body.ts-studio.page-updater main.content .profile-grid{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
  html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail > section.card,
  html body.ts-studio.page-updater main.content .profile-grid > section.card{height:auto!important;margin:0!important}
}
@media(max-width:600px){
  html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail > section.card,
  html body.ts-studio.page-updater main.content .profile-grid > section.card{padding:13px!important}
  html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail .quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail :is(.task-list a,.quick-grid a){min-height:38px!important;padding:9px!important;font-size:11px!important}
  html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row .message-bubble{max-width:86%!important;font-size:12px!important}
}
@media(max-width:360px){
  html body.ts-studio.page-index main.content .dashboard-grid.studio-dashboard-detail .quick-grid{grid-template-columns:1fr!important}
  html body.ts-studio.page-inbox .inbox-v3 .inbox-message-wall .message-row .message-bubble{max-width:92%!important}
}
