/* RCS Studio — styles */
@import url("./tokens.css");

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--rh-font-body);
  color: var(--rh-fg);
  background: var(--rh-bg-alt);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─────────── App shell ─────────── */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

/* ─────────── Sidebar ─────────── */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--rh-border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--rh-border);
  margin-bottom: 12px;
}
.sb-brand .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--rh-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -.02em;
}
.sb-brand-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.sb-brand-sub { font-size: 11px; color: var(--rh-fg-muted); font-weight: 600; }

.sb-section {
  font-size: 10px;
  font-weight: 800;
  color: var(--rh-fg-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 14px 10px 6px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rh-fg-body);
  text-align: left;
  width: 100%;
  transition: all .18s var(--rh-ease);
}
.sb-item:hover { background: var(--rh-primary-ghost); color: var(--rh-primary); }
.sb-item.active { background: var(--rh-primary); color: #fff; }
.sb-item .ico { width: 16px; height: 16px; flex-shrink: 0; }
.sb-item .badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  background: var(--rh-primary-tint);
  color: var(--rh-primary);
  padding: 2px 7px;
  border-radius: 999px;
}
.sb-item.active .badge { background: rgba(255,255,255,.22); color: #fff; }

.sb-foot {
  margin-top: auto;
  padding: 12px;
  background: var(--rh-bg-lightblue);
  border-radius: 10px;
  font-size: 12px;
  color: var(--rh-fg-body);
}
.sb-foot h6 { margin: 0 0 4px; font-size: 12px; font-weight: 800; }
.sb-foot p { margin: 0 0 8px; font-size: 11px; color: var(--rh-fg-muted); line-height: 1.5; }
.sb-foot button {
  width: 100%; border: 0; background: var(--rh-primary); color: #fff;
  padding: 7px 10px; border-radius: 6px; font-weight: 700; font-size: 11px;
}

/* ─────────── Main ─────────── */
.main { min-width: 0; display: flex; flex-direction: column; }

/* Top bar */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--rh-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.tb-crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--rh-fg-muted); font-weight: 600;
}
.tb-crumbs span.current { color: var(--rh-fg); }
.tb-crumbs .sep { opacity: .5; }

.tb-title-row { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.tb-title-input {
  border: 0; outline: 0; background: transparent;
  font-weight: 800; font-size: 17px; color: var(--rh-fg);
  padding: 4px 6px; border-radius: 6px; min-width: 0; flex: 0 1 auto;
}
.tb-title-input:hover { background: var(--rh-bg); }
.tb-title-input:focus { background: var(--rh-bg); box-shadow: var(--rh-shadow-focus); }

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: var(--rh-primary-tint); color: var(--rh-primary);
}
.status-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.draft { background: #f1f1f1; color: var(--rh-fg-muted); }
.status-chip.live { background: #dcf5e7; color: var(--rh-success); }

.tb-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Buttons */
.btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rh-fg-body);
  transition: all .18s var(--rh-ease);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: var(--rh-bg); }
.btn-primary {
  background: var(--rh-primary); color: #fff; border-color: var(--rh-primary);
}
.btn-primary:hover { background: var(--rh-primary-dark); border-color: var(--rh-primary-dark); }
.btn-outline {
  background: #fff; color: var(--rh-fg); border-color: var(--rh-border-strong);
}
.btn-outline:hover { background: var(--rh-bg); border-color: var(--rh-fg-muted); color: var(--rh-fg); }
.btn-ghost { color: var(--rh-fg-body); }
.btn-yellow { background: var(--rh-accent-yellow); color: #fff; border-color: var(--rh-accent-yellow); }
.btn-yellow:hover { background: var(--rh-accent-yellow-hover); border-color: var(--rh-accent-yellow-hover); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 8px; }

/* ─────────── Workspace ─────────── */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 0;
  flex: 1;
}

/* Editor (left) */
.editor {
  padding: 22px 28px 60px;
  overflow-y: auto;
  background: var(--rh-bg-alt);
  border-right: 1px solid var(--rh-border);
}
.section {
  background: #fff;
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rh-border);
  background: #fff;
}
.section-head .head-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--rh-primary-tint); color: var(--rh-primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.section-head h5 { margin: 0; font-size: 14px; font-weight: 800; color: var(--rh-fg); line-height: 1.2; }
.section-head p { margin: 2px 0 0; font-size: 11px; color: var(--rh-fg-muted); font-weight: 500; }
.section-head .meta { margin-left: auto; font-size: 11px; color: var(--rh-fg-muted); font-weight: 600; }
.section-body { padding: 18px; }
.section-body.tight { padding: 14px 18px; }

/* Eyebrow */
.eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rh-primary);
}

/* Type tab strip */
.type-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.type-tab {
  background: #fff;
  border: 1.5px solid var(--rh-border);
  border-radius: 10px;
  padding: 12px 10px 11px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left;
  transition: all .18s var(--rh-ease);
  cursor: pointer;
}
.type-tab:hover { border-color: var(--rh-primary); background: var(--rh-bg-lightblue); }
.type-tab.active {
  border-color: var(--rh-primary);
  background: var(--rh-primary-ghost);
  box-shadow: 0 0 0 3px rgba(21,60,245,.08);
}
.type-tab .tt-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--rh-bg); color: var(--rh-fg-muted);
  display: grid; place-items: center;
}
.type-tab.active .tt-icon { background: var(--rh-primary); color: #fff; }
.type-tab .tt-label {
  font-size: 12px; font-weight: 700; color: var(--rh-fg); line-height: 1.2;
}
.type-tab .tt-sub { font-size: 10px; color: var(--rh-fg-muted); font-weight: 600; line-height: 1.3; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
  font-size: 12px; font-weight: 700; color: var(--rh-fg);
  display: flex; align-items: center; justify-content: space-between;
}
.field label .hint { font-size: 10px; font-weight: 600; color: var(--rh-fg-muted); }
.field .help { font-size: 11px; color: var(--rh-fg-muted); }
.input, .textarea, .select {
  border: 1px solid var(--rh-border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--rh-fg);
  background: #fff;
  outline: 0;
  transition: all .18s var(--rh-ease);
  width: 100%;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--rh-primary);
  box-shadow: var(--rh-shadow-focus);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Counter */
.counter {
  font-size: 10px; color: var(--rh-fg-muted); text-align: right;
  margin-top: -2px;
}
.counter.warn { color: var(--rh-accent-yellow); }
.counter.over { color: var(--rh-danger); }

/* Variable chip */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.var-chip {
  font-size: 11px;
  background: var(--rh-primary-ghost);
  color: var(--rh-primary);
  border: 1px dashed rgba(21,60,245,.3);
  padding: 3px 8px; border-radius: 6px; font-weight: 700;
  cursor: pointer;
}
.var-chip:hover { background: var(--rh-primary-tint); }

/* Action button rows (quick replies, suggested actions) */
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-item {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 28px;
  gap: 8px;
  align-items: center;
  background: var(--rh-bg-alt);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  padding: 8px;
}
.action-item .drag {
  color: var(--rh-fg-muted); cursor: grab; display: grid; place-items: center;
}
.action-item .icon-pick {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--rh-primary-tint); color: var(--rh-primary);
  display: grid; place-items: center;
}
.action-item .remove {
  background: transparent; border: 0; color: var(--rh-fg-muted);
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
}
.action-item .remove:hover { background: #fde2e4; color: var(--rh-danger); }
.action-item .input-inline {
  border: 0; background: transparent; padding: 6px 8px; font-size: 12px;
  color: var(--rh-fg); outline: 0; border-radius: 5px;
}
.action-item .input-inline:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--rh-primary); }
.action-item .select-inline {
  border: 0; background: #fff; padding: 5px 6px; font-size: 11px;
  border-radius: 5px; font-weight: 700; color: var(--rh-fg-body);
}

.add-action {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--rh-border-strong);
  background: transparent;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px; font-weight: 700; color: var(--rh-fg-muted);
  width: 100%;
  margin-top: 8px;
}
.add-action:hover { border-color: var(--rh-primary); color: var(--rh-primary); background: var(--rh-primary-ghost); }

.suggested-types {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px;
}
.suggested-type {
  border: 1px solid var(--rh-border); background: #fff;
  border-radius: 7px; padding: 7px 4px;
  font-size: 10px; font-weight: 700; color: var(--rh-fg-body);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
}
.suggested-type:hover { border-color: var(--rh-primary); color: var(--rh-primary); }
.suggested-type svg { width: 14px; height: 14px; }

/* Media upload */
.media-upload {
  border: 1.5px dashed var(--rh-border-strong);
  border-radius: 10px;
  background: var(--rh-bg-alt);
  padding: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.media-upload.has-media { padding: 8px; background: #fff; border-style: solid; border-color: var(--rh-border); }
.media-upload .media-thumb {
  width: 100%; height: 130px;
  border-radius: 7px;
  background-size: cover; background-position: center;
  position: relative;
}
.media-upload p { margin: 0; font-size: 12px; color: var(--rh-fg-muted); }
.media-upload .upload-cta { color: var(--rh-primary); font-weight: 800; font-size: 13px; }
.media-upload .gallery-preset {
  display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin-top: 10px; width: 100%;
}
.media-upload .gallery-preset button {
  aspect-ratio: 1; border-radius: 5px; border: 1.5px solid transparent;
  background-size: cover; background-position: center;
  padding: 0;
}
.media-upload .gallery-preset button.active { border-color: var(--rh-primary); box-shadow: 0 0 0 2px rgba(21,60,245,.18); }

/* Carousel card editor */
.carousel-cards {
  display: flex; flex-direction: column; gap: 10px;
}
.cc-card {
  border: 1.5px solid var(--rh-border);
  border-radius: 10px;
  padding: 12px;
  background: var(--rh-bg-alt);
}
.cc-card.active { border-color: var(--rh-primary); background: #fff; box-shadow: 0 0 0 3px rgba(21,60,245,.08); }
.cc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cc-head .cc-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rh-primary); color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.cc-head h6 { margin: 0; font-size: 13px; font-weight: 800; flex: 1; }
.cc-head .actions { display: flex; gap: 4px; }
.cc-head .actions button {
  background: transparent; border: 0; color: var(--rh-fg-muted);
  width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center;
}
.cc-head .actions button:hover { background: var(--rh-bg); color: var(--rh-fg); }

/* Recipients / Schedule / AB */
.toggle-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px dashed var(--rh-border);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .body { flex: 1; }
.toggle-row .body h6 { margin: 0 0 2px; font-size: 13px; font-weight: 800; }
.toggle-row .body p { margin: 0; font-size: 11px; color: var(--rh-fg-muted); }

.switch {
  position: relative; width: 36px; height: 20px; border-radius: 999px;
  background: #d9d9d9; cursor: pointer; transition: background .18s;
  flex-shrink: 0; border: 0; padding: 0;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .18s var(--rh-ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch.on { background: var(--rh-primary); }
.switch.on::after { transform: translateX(16px); }

.tag-pill {
  font-size: 11px; font-weight: 700;
  padding: 4px 9px 4px 10px; border-radius: 999px;
  background: var(--rh-primary-tint); color: var(--rh-primary);
  display: inline-flex; align-items: center; gap: 6px;
}
.tag-pill button { border: 0; background: transparent; color: inherit; padding: 0; line-height: 1; cursor: pointer; }
.tag-pill.green { background: #dcf5e7; color: var(--rh-success); }
.tag-pill.gray { background: var(--rh-muted); color: var(--rh-fg-body); }
.tag-pill.yellow { background: #fef3dc; color: var(--rh-accent-yellow); }

.recipient-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rh-border);
}
.r-stat { text-align: center; }
.r-stat .v { font-size: 18px; font-weight: 800; color: var(--rh-fg); line-height: 1; }
.r-stat .l { font-size: 10px; font-weight: 700; color: var(--rh-fg-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 5px; }

/* Schedule */
.schedule-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--rh-bg); border-radius: 8px; padding: 4px;
  margin-bottom: 14px;
}
.schedule-tab {
  border: 0; background: transparent;
  padding: 7px; border-radius: 6px;
  font-size: 12px; font-weight: 700; color: var(--rh-fg-muted);
}
.schedule-tab.active { background: #fff; color: var(--rh-primary); box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* A/B */
.ab-variants {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px;
}
.ab-card {
  border: 1px solid var(--rh-border); border-radius: 8px; padding: 10px;
  background: var(--rh-bg-alt);
}
.ab-card .v-label {
  font-size: 10px; font-weight: 800; color: var(--rh-primary);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px;
  display: flex; justify-content: space-between; align-items: center;
}
.ab-card .v-text { font-size: 12px; color: var(--rh-fg-body); line-height: 1.5; }
.ab-card.b .v-label { color: var(--rh-accent-yellow); }
.split-bar {
  height: 10px; border-radius: 999px; overflow: hidden; display: flex;
  background: var(--rh-bg); margin-top: 10px;
}
.split-bar .a { background: var(--rh-primary); }
.split-bar .b { background: var(--rh-accent-yellow); }

/* ─────────── Preview pane (right) ─────────── */
.preview {
  padding: 22px 22px 60px;
  background: linear-gradient(180deg, #eef0f7 0%, #f5f5f5 100%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  overflow-y: auto;
  position: relative;
}
.preview-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.preview-head h6 {
  margin: 0; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em; color: var(--rh-fg-muted);
}
.device-tabs {
  display: flex; gap: 4px; background: #fff; border-radius: 8px; padding: 3px;
  border: 1px solid var(--rh-border);
}
.device-tabs button {
  border: 0; background: transparent;
  padding: 5px 10px; border-radius: 5px;
  font-size: 11px; font-weight: 700; color: var(--rh-fg-muted);
  display: inline-flex; align-items: center; gap: 4px;
}
.device-tabs button.active { background: var(--rh-fg); color: #fff; }
.device-tabs button svg { width: 12px; height: 12px; }

/* Phone frame */
.phone {
  width: 340px;
  height: 700px;
  background: #111;
  border-radius: 46px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #1a1a1a,
    0 30px 60px -20px rgba(17,24,39,.4),
    0 18px 30px -15px rgba(17,24,39,.3);
  position: relative;
  flex-shrink: 0;
}
.phone .screen {
  width: 100%;
  height: 100%;
  background: #f3f4f8;
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.phone .notch {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 108px; height: 30px; background: #111; border-radius: 999px; z-index: 10;
}
.phone .side-btn-r {
  position: absolute; top: 160px; right: -2px; width: 4px; height: 70px;
  background: #1a1a1a; border-radius: 2px;
}
.phone .side-btn-l1 {
  position: absolute; top: 120px; left: -2px; width: 4px; height: 38px;
  background: #1a1a1a; border-radius: 2px;
}
.phone .side-btn-l2 {
  position: absolute; top: 180px; left: -2px; width: 4px; height: 64px;
  background: #1a1a1a; border-radius: 2px;
}

/* Status bar */
.statusbar {
  height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px 0 32px;
  background: #fff;
  font-size: 13px; font-weight: 700; color: var(--rh-fg);
  flex-shrink: 0;
}
.statusbar .right { display: flex; align-items: center; gap: 5px; }
.statusbar svg { width: 14px; height: 14px; }
.statusbar .battery {
  width: 22px; height: 11px; border: 1.2px solid var(--rh-fg);
  border-radius: 3px; padding: 1px; position: relative;
}
.statusbar .battery::after {
  content: ""; position: absolute; right: -3px; top: 3px;
  width: 1.5px; height: 4px; background: var(--rh-fg); border-radius: 1px;
}
.statusbar .battery .fill {
  background: var(--rh-fg); height: 100%; width: 78%; border-radius: 1px;
}

/* Chat header */
.chat-head {
  background: #fff;
  padding: 8px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--rh-border);
}
.chat-head .back { color: var(--rh-fg); display: grid; place-items: center; }
.chat-head .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--rh-primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  position: relative; flex-shrink: 0;
  overflow: hidden;
}
.chat-head .avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-head .verified {
  position: absolute; bottom: -2px; right: -2px;
  width: 16px; height: 16px; background: var(--rh-success); color: #fff;
  border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #fff;
}
.chat-head .verified svg { width: 9px; height: 9px; }
.chat-head .name { flex: 1; min-width: 0; }
.chat-head .name h6 {
  margin: 0; font-size: 14px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
}
.chat-head .name h6 svg { width: 13px; height: 13px; color: var(--rh-primary); flex-shrink: 0; }
.chat-head .name p { margin: 1px 0 0; font-size: 11px; color: var(--rh-success); font-weight: 700; }
.chat-head .ico-btn { color: var(--rh-fg-muted); padding: 4px; }

/* Chat body */
.chat-body {
  flex: 1; overflow-y: auto;
  padding: 14px 12px 80px;
  background: #f3f4f8;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-body::-webkit-scrollbar { width: 0; }
.day-stamp {
  text-align: center; font-size: 10px; color: var(--rh-fg-muted);
  font-weight: 600; margin: 2px 0 4px;
}

.bubble-wrap { display: flex; align-items: flex-end; gap: 6px; max-width: 86%; }
.bubble-wrap.in { align-self: flex-start; }
.bubble-wrap.out { align-self: flex-end; flex-direction: row-reverse; }
.bubble-wrap .b-avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--rh-primary); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
.bubble-wrap .b-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bubble {
  background: #fff;
  border-radius: 18px 18px 18px 4px;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--rh-fg);
  box-shadow: 0 1px 2px rgba(17,24,39,.06);
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.empty { color: var(--rh-fg-muted); font-style: italic; }
.bubble.out {
  background: var(--rh-primary);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}

.timestamp {
  font-size: 9px; color: var(--rh-fg-muted); margin-top: 3px;
  font-weight: 600;
}

/* Rich card */
.rich-card {
  background: #fff;
  border-radius: 18px 18px 18px 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17,24,39,.06);
  max-width: 100%;
  width: 256px;
}
.rich-card .rc-media {
  width: 100%; height: 130px;
  background-size: cover; background-position: center;
  background-color: var(--rh-bg);
  position: relative;
}
.rich-card .rc-media.tall { height: 158px; }
.rich-card .rc-media.short { height: 96px; }
.rich-card .rc-media .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--rh-fg-muted); font-size: 11px; font-weight: 700;
}
.rich-card .rc-body { padding: 10px 14px 6px; }
.rich-card .rc-title {
  font-size: 13px; font-weight: 800; color: var(--rh-fg);
  margin: 0 0 3px; line-height: 1.3;
}
.rich-card .rc-desc {
  font-size: 11.5px; color: var(--rh-fg-muted);
  line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.rich-card .rc-actions {
  border-top: 1px solid var(--rh-border);
  display: flex; flex-direction: column;
  margin-top: 8px;
}
.rich-card .rc-actions button {
  border: 0; background: #fff; color: var(--rh-primary);
  font-size: 12px; font-weight: 700;
  padding: 11px 14px; text-align: center;
  border-bottom: 1px solid var(--rh-border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.rich-card .rc-actions button:last-child { border-bottom: 0; }
.rich-card .rc-actions button svg { width: 13px; height: 13px; }

/* Carousel */
.carousel {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  max-width: 100%;
  scroll-snap-type: x mandatory;
}
.carousel::-webkit-scrollbar { height: 4px; }
.carousel::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 2px; }
.carousel .rich-card { width: 200px; flex-shrink: 0; scroll-snap-align: start; }
.carousel .rich-card .rc-media { height: 110px; }

/* Quick replies (chips) */
.quick-replies {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-self: flex-end;
  justify-content: flex-end;
  max-width: 86%;
  margin-top: 2px;
}
.qr-chip {
  background: #fff;
  border: 1.2px solid var(--rh-primary);
  color: var(--rh-primary);
  font-size: 11.5px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.qr-chip svg { width: 12px; height: 12px; }

/* Compose bar */
.compose {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rh-border);
  display: flex; align-items: center; gap: 8px;
}
.compose .input-mock {
  flex: 1; height: 36px; border-radius: 999px;
  background: var(--rh-bg);
  display: flex; align-items: center; padding: 0 14px;
  font-size: 12px; color: var(--rh-fg-muted);
}
.compose .send-mock {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--rh-primary); color: #fff;
  display: grid; place-items: center;
}
.compose .send-mock svg { width: 16px; height: 16px; }

/* Home indicator */
.home-indicator {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 4px; border-radius: 2px;
  background: rgba(0,0,0,.4);
}

/* Preview meta below phone */
.preview-meta {
  background: #fff; border: 1px solid var(--rh-border);
  border-radius: 10px; padding: 14px;
  width: 340px; font-size: 12px;
}
.preview-meta h6 {
  margin: 0 0 8px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em; color: var(--rh-fg-muted);
}
.preview-meta .row {
  display: flex; justify-content: space-between; padding: 5px 0;
  font-size: 12px;
}
.preview-meta .row .l { color: var(--rh-fg-muted); }
.preview-meta .row .v { color: var(--rh-fg); font-weight: 700; }
.preview-meta .row .v.green { color: var(--rh-success); }

/* Toast / notification */
.send-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--rh-fg); color: #fff;
  padding: 12px 22px 12px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(17,24,39,.3);
  z-index: 100;
  animation: rise .4s var(--rh-ease);
}
.send-toast svg { width: 18px; height: 18px; color: var(--rh-success); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Tweaks placeholder for floating panel layering */
.tweaks-mount { position: fixed; right: 20px; bottom: 20px; z-index: 200; }
