/* WhatsApp iOS–style theme for MCP-WEB */
:root {
  --wa-teal: #075e54;
  --wa-teal-mid: #128c7e;
  --wa-green: #25d366;
  --wa-green-dark: #1da851;
  --wa-bubble-out: #d9fdd3;
  --wa-bubble-in: #ffffff;
  --wa-bg-chat: #efeae2;
  --wa-bg-panel: #ffffff;
  --wa-bg-list: #ffffff;
  --wa-header: #f0f2f5;
  --wa-border: #e9edef;
  --wa-text: #111b21;
  --wa-text-sec: #667781;
  --wa-tick: #53bdeb;
  --wa-tick-gray: #8696a0;
  --wa-danger: #ea0038;
  --wa-quote-out: #c5e6bf;
  --wa-quote-in: #f0f2f5;
  --sidebar-w: 380px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-bubble: 7.5px;
  --shadow-bubble: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  background: #d1d7db;
  color: var(--wa-text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* ----- Login (WA-ish green) ----- */
.login-screen {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #075e54 0 35%, #ece5dd 35% 100%);
}

.login-bg {
  display: none;
}

.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--wa-green);
  color: #fff;
  font-weight: 700;
  font-size: 1.8rem;
  display: grid;
  place-items: center;
}

.brand-mark.sm {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  margin: 0;
}

.login-brand h1 {
  margin: 0 auto 4px;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--wa-text);
  font-weight: 600;
}

.login-brand p {
  margin: 0;
  color: var(--wa-text-sec);
  font-size: 0.9rem;
}

.login-card form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
}

label > span {
  font-size: 0.8rem;
  color: var(--wa-text-sec);
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d1d7db;
  background: #fff;
  color: var(--wa-text);
  outline: none;
  color-scheme: light;
  -webkit-text-fill-color: var(--wa-text);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--wa-teal-mid);
  box-shadow: 0 0 0 2px rgba(18, 140, 126, 0.15);
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--wa-text) !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 32px;
  border-radius: 8px;
  color: var(--wa-text-sec);
}

.form-error {
  color: var(--wa-danger);
  font-size: 0.9rem;
  margin: 0;
}

.form-hint {
  color: var(--wa-text-sec);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.12s, background 0.12s;
}

.btn-primary {
  background: var(--wa-green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--wa-green-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--wa-teal);
  border: none;
}

.btn-block {
  width: 100%;
  padding: 12px;
  border-radius: 24px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--wa-text-sec);
  font-size: 1.15rem;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ----- App shell ----- */
.app {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  background: var(--wa-bg-panel);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  min-height: 0;
  overflow: hidden;
}

/* Sidebar = Chats list */
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--wa-border);
  background: var(--wa-bg-list);
  min-height: 0;
}

.sidebar-head {
  background: var(--wa-header);
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--wa-border);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.brand-row > div:last-child {
  min-width: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--wa-text);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--wa-text-sec);
}

.brand-sub.online {
  color: var(--wa-green);
}

.brand-sub.offline {
  color: var(--wa-danger);
}

.me-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}

.me-info {
  flex: 1;
  min-width: 0;
}

.me-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me-dept {
  font-size: 0.75rem;
  color: var(--wa-text-sec);
}

.search-wrap {
  padding: 8px 12px 10px;
  background: var(--wa-header);
}

.search-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.search-row input[type="search"] {
  flex: 1;
  border-radius: 8px;
  background: #fff;
  border: none;
  padding: 9px 14px;
  font-size: 0.9rem;
}

.search-btn {
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
  height: 38px;
}

#btn-sidebar-search-clear {
  min-width: 36px;
  padding: 8px !important;
  color: var(--wa-text-sec) !important;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  background: #fff;
}

.nav-section h3 {
  margin: 0;
  padding: 10px 16px 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wa-teal-mid);
  font-weight: 700;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  color: inherit;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.1s;
}

.nav-item:hover {
  background: #f5f6f6;
}

.nav-item.active {
  background: #f0f2f5;
}

.nav-item .meta {
  flex: 1;
  min-width: 0;
}

.nav-item .title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.nav-item .title {
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item .time {
  font-size: 0.72rem;
  color: var(--wa-text-sec);
  flex-shrink: 0;
}

.nav-item .sub {
  font-size: 0.82rem;
  color: var(--wa-text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--wa-green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-left: 6px;
}

.avatar {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe5e7;
  flex-shrink: 0;
}

.avatar.lg {
  width: 40px;
  height: 40px;
}

.avatar.xl {
  width: 72px;
  height: 72px;
}

.avatar.initial {
  display: grid;
  place-items: center;
  font-weight: 600;
  background: linear-gradient(145deg, #00a884, #128c7e);
  color: #fff;
  font-size: 1.1rem;
}

.avatar.lg.initial {
  font-size: 1rem;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.status-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  bottom: 1px;
  right: 1px;
  background: #8696a0;
}

.status-dot.on {
  background: var(--wa-green);
}

.sidebar-foot {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--wa-border);
  background: var(--wa-header);
}

.sidebar-foot .btn {
  flex: 1;
  font-size: 0.85rem;
  color: var(--wa-teal);
  border-radius: 8px;
}

/* ----- Chat pane ----- */
.chat-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--wa-bg-chat);
  height: 100%;
  overflow: hidden;
}

.empty-chat {
  margin: auto;
  text-align: center;
  color: var(--wa-text-sec);
  padding: 40px 24px;
  max-width: 480px;
}

.empty-illustration {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-chat h2 {
  margin: 0 0 8px;
  color: var(--wa-text);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.3;
}

.chat-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--wa-header);
  border-bottom: 1px solid var(--wa-border);
  z-index: 5;
}

.chat-peer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.chat-peer h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peer-status {
  margin: 1px 0 0;
  font-size: 0.75rem;
  color: var(--wa-text-sec);
}

.peer-status.online {
  color: var(--wa-teal-mid);
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.search-msg-wrap input {
  width: 140px;
  padding: 7px 10px;
  font-size: 0.82rem;
  border-radius: 8px;
  border: none;
  background: #fff;
}

.typing-bar {
  padding: 4px 16px;
  font-size: 0.78rem;
  color: var(--wa-teal-mid);
  font-style: italic;
  background: transparent;
  min-height: 22px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 7% 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background-color: var(--wa-bg-chat);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5c2 8 8 12 12 14-4 2-8 8-12 14-4-6-8-12-12-14 4-2 10-6 12-14z' fill='%23d4cdc4' fill-opacity='.25'/%3E%3C/svg%3E");
  scroll-behavior: smooth;
}

.day-sep {
  align-self: center;
  font-size: 0.75rem;
  color: var(--wa-text-sec);
  background: #fff;
  padding: 5px 12px 6px;
  border-radius: 8px;
  margin: 8px 0;
  box-shadow: var(--shadow-bubble);
  font-weight: 500;
}

.msg {
  max-width: min(75%, 520px);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2px 0;
  position: relative;
  animation: msg-in 0.15s ease both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg.mine {
  align-self: flex-end;
}

.msg.theirs {
  align-self: flex-start;
}

.msg-bubble {
  padding: 6px 7px 8px 9px;
  border-radius: var(--radius-bubble);
  line-height: 1.4;
  word-break: break-word;
  position: relative;
  box-shadow: var(--shadow-bubble);
  font-size: 0.9375rem;
}

.msg.mine .msg-bubble {
  background: var(--wa-bubble-out);
  border-top-right-radius: 0;
}

.msg.theirs .msg-bubble {
  background: var(--wa-bubble-in);
  border-top-left-radius: 0;
}

.msg-author {
  font-size: 0.78rem;
  font-weight: 600;
  color: #06cf9c;
  margin-bottom: 2px;
}

.msg-text {
  white-space: pre-wrap;
  padding-right: 4px;
  user-select: text;
  -webkit-user-select: text;
}

.msg.sender-deleted .msg-bubble {
  border-left: 3px solid #c48b1a;
}

.msg-deleted-note {
  font-size: 0.72rem;
  font-style: italic;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 4px;
  padding: 3px 6px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.msg.mine .msg-deleted-note {
  color: #854d0e;
  background: rgba(120, 80, 0, 0.12);
}

.admin-chat-msg.sender-deleted {
  border-left: 3px solid #c48b1a;
  padding-left: 8px;
}

.admin-deleted-note {
  margin: 2px 0 6px;
}

.msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: inherit;
}

.msg-file:hover {
  background: rgba(0, 0, 0, 0.07);
}

.msg-file-icon {
  font-size: 1.4rem;
}

.msg-file-name {
  font-weight: 500;
  font-size: 0.88rem;
}

.msg-file-size {
  font-size: 0.72rem;
  color: var(--wa-text-sec);
}

.msg-img {
  max-width: min(280px, 70vw);
  max-height: 280px;
  border-radius: 6px;
  display: block;
  margin-top: 2px;
  cursor: pointer;
}

.msg-bubble.is-sticker {
  background: transparent !important;
  box-shadow: none;
  padding: 0 4px 2px;
}

.msg-bubble.is-sticker .msg-actions-menu {
  right: 8px;
}

.msg-sticker {
  width: 148px;
  height: 148px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.msg-album {
  display: grid;
  gap: 3px;
  margin-top: 2px;
  max-width: min(280px, 72vw);
  overflow: hidden;
  border-radius: 8px;
}

.msg-album.count-1 { grid-template-columns: 1fr; }
.msg-album.count-2 { grid-template-columns: 1fr 1fr; }
.msg-album.count-3 { grid-template-columns: 1fr 1fr; }
.msg-album.count-4,
.msg-album.count-n { grid-template-columns: 1fr 1fr; }

.msg-album-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}

.msg-album.count-1 .msg-album-item {
  aspect-ratio: auto;
  max-height: 280px;
}

.msg-album.count-1 .msg-album-item img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
}

.msg-album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-album-more {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
}

.picker-panel {
  border-top: 1px solid #f0f2f5;
  background: #fafafa;
}

.picker-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 8px 0;
}

.picker-tabs button {
  flex: 1;
  height: 32px;
  border-radius: 8px 8px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wa-text-sec);
}

.picker-tabs button.active {
  background: #fff;
  color: var(--wa-teal);
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
}

.sticker-grid button {
  aspect-ratio: 1;
  border-radius: 12px;
  padding: 4px;
  background: #f0f2f5;
  border: none;
  cursor: pointer;
}

.sticker-grid button:hover {
  background: #e9edef;
}

.sticker-grid button:active {
  transform: scale(0.94);
}

.sticker-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f0f2f5;
  font-size: 0.82rem;
}

.file-preview.multi {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: stretch;
  gap: 8px;
}

.file-preview-item {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
}

.file-preview-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}

.file-preview-item .file-preview-doc {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}

.file-preview-item button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  margin: 0;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.8rem;
  z-index: 2;
}

.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }

.lightbox-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 12px;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  padding: 0 2px;
  font-size: 0.68rem;
  color: var(--wa-text-sec);
  float: right;
  margin-left: 8px;
  position: relative;
  top: 4px;
}

.msg-bubble::after {
  content: "";
  display: table;
  clear: both;
}

.msg-receipt {
  letter-spacing: -1.5px;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--wa-tick-gray);
}

.msg-receipt.read {
  color: var(--wa-tick);
}

.msg-actions-menu {
  position: absolute;
  top: 2px;
  right: 4px;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 2;
}

.msg:hover .msg-actions-menu {
  opacity: 1;
}

.msg-actions-menu button {
  width: 28px;
  height: 22px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--wa-text-sec);
  font-size: 0.7rem;
}

/* Quote / reply in bubble */
.msg-quote {
  display: flex;
  gap: 0;
  margin: 0 0 4px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--wa-quote-in);
}

.msg.mine .msg-quote {
  background: var(--wa-quote-out);
}

.msg-quote-accent {
  width: 4px;
  background: #06cf9c;
  flex-shrink: 0;
}

.msg-quote-body {
  padding: 4px 8px;
  min-width: 0;
  flex: 1;
}

.msg-quote-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #06cf9c;
}

.msg-quote-text {
  font-size: 0.8rem;
  color: var(--wa-text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.msg.highlight .msg-bubble {
  box-shadow: 0 0 0 2px var(--wa-green);
}

.msg.starred .msg-bubble {
  outline: 1px solid rgba(255, 193, 7, 0.5);
}

.msg-star {
  position: absolute;
  top: -2px;
  left: -2px;
  font-size: 0.7rem;
  filter: drop-shadow(0 0 1px #fff);
}

/* Reply bar + composer */
.reply-bar {
  display: flex;
  align-items: stretch;
  margin: 0 12px;
  background: #f0f2f5;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  border-bottom: none;
}

.reply-bar-accent {
  width: 4px;
  background: #06cf9c;
}

.reply-bar-body {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
}

.reply-bar-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #06cf9c;
}

.reply-bar-text {
  font-size: 0.82rem;
  color: var(--wa-text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-bar-close {
  width: 40px;
  color: var(--wa-text-sec);
  font-size: 1rem;
}

.reply-bar.is-edit {
  background: #fff8e6;
}

.reply-bar.is-edit .reply-bar-accent {
  background: #c48b1a;
}

.reply-bar.is-edit .reply-bar-name {
  color: #b45309;
}

.composer.is-editing .attach-btn {
  pointer-events: none;
  opacity: 0.35;
}

.msg-edited {
  font-style: italic;
  opacity: 0.85;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px 12px;
  background: var(--wa-header);
}

.attach-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--wa-text-sec);
  font-size: 1.25rem;
  flex-shrink: 0;
  cursor: pointer;
}

.attach-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.composer-field {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 24px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

#msg-input {
  resize: none;
  max-height: 120px;
  min-height: 36px;
  border: none;
  padding: 8px 10px;
  border-radius: 24px;
  line-height: 1.4;
  background: transparent;
  box-shadow: none;
}

#msg-input:focus {
  box-shadow: none;
  border: none;
}

.emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  padding: 6px 6px 8px;
  max-height: 160px;
  overflow-y: auto;
  border-top: 1px solid #f0f2f5;
  background: #fafafa;
}

.emoji-row button {
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.emoji-row button:hover {
  background: #e9edef;
}

.emoji-row button:active {
  background: #d1d7db;
  transform: scale(0.92);
}

.send-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50% !important;
  padding: 0 !important;
  background: var(--wa-teal-mid) !important;
  color: #fff !important;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--wa-teal) !important;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 94, 84, 0.85);
  border: 3px dashed #fff;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  z-index: 20;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  pointer-events: none;
}

.drop-overlay span {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
}

/* Action sheet (WA long-press menu) */
.action-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: end center;
  padding: 16px;
}

.action-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 20, 26, 0.45);
}

.action-sheet-panel {
  position: relative;
  width: min(360px, 100%);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  animation: sheet-up 0.22s ease;
}

@keyframes sheet-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.action-sheet-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  font-size: 0.95rem;
  border-bottom: 1px solid #f0f2f5;
  color: var(--wa-text);
}

.action-sheet-panel button:hover {
  background: #f5f6f6;
}

.action-sheet-panel button.danger {
  color: var(--wa-danger);
}

.action-sheet-panel button.cancel {
  text-align: center;
  font-weight: 600;
  color: var(--wa-teal);
  border-bottom: none;
}

/* Forward picker */
.forward-list {
  max-height: 320px;
  overflow-y: auto;
  margin: 8px 0;
}

.forward-list label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
}

.forward-list input {
  width: auto;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 20, 26, 0.5);
}

.modal-panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.modal-wide {
  width: min(900px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--wa-teal);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
}

.modal-head .icon-btn {
  color: #fff;
}

.modal-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.avatar-edit {
  display: flex;
  align-items: center;
  gap: 16px;
}

hr {
  border: none;
  border-top: 1px solid var(--wa-border);
  margin: 8px 0;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wa-text-sec);
  background: #f0f2f5;
}

.tab.active {
  background: var(--wa-teal);
  color: #fff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--wa-border);
}

.admin-table th {
  color: var(--wa-text-sec);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.admin-table .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-table .actions button {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f0f2f5;
}

.admin-table .actions button.danger {
  color: var(--wa-danger);
}

.admin-pw-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-pw-text {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  background: #f0f2f5;
  padding: 3px 8px;
  border-radius: 6px;
}

.pw-reveal-btn,
.pw-copy-btn {
  font-size: 0.75rem !important;
  padding: 4px 8px !important;
  border-radius: 6px;
  background: #f0f2f5;
}

.pw-unknown {
  color: var(--wa-text-sec);
}

.online-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.online-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #f0f2f5;
  margin-bottom: 6px;
}

.create-form {
  display: grid;
  gap: 12px;
}

.admin-chat-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 12px;
  min-height: 360px;
  max-height: min(58vh, 480px);
}

.admin-chat-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  border: 1px solid var(--wa-border);
  border-radius: 10px;
  padding: 8px;
}

.admin-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.admin-chat-list li button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
}

.admin-chat-list li button:hover,
.admin-chat-list li button.active {
  background: #f0f2f5;
}

.admin-chat-list .t {
  font-weight: 600;
  font-size: 0.86rem;
}

.admin-chat-list .s {
  font-size: 0.72rem;
  color: var(--wa-text-sec);
}

.admin-chat-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--wa-border);
  border-radius: 10px;
  overflow: hidden;
}

.admin-chat-title {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--wa-border);
  background: var(--wa-header);
}

.admin-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--wa-bg-chat);
}

.admin-chat-msg {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  font-size: 0.86rem;
  box-shadow: var(--shadow-bubble);
}

.admin-chat-msg .who {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--wa-teal-mid);
}

.admin-chat-msg .when {
  font-size: 0.68rem;
  color: var(--wa-text-sec);
  margin-top: 4px;
}

.admin-chat-msg.deleted {
  opacity: 0.55;
  font-style: italic;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 4px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #fff;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  z-index: 2;
}

.chat-peer {
  cursor: pointer;
}

.chat-peer:hover h2 {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.clickable-avatar {
  cursor: pointer;
}

.me-row #me-avatar {
  cursor: pointer;
}

/* Status (WA) */
.status-section {
  border-bottom: 1px solid var(--wa-border);
  background: #fff;
  padding: 8px 0 10px;
  flex-shrink: 0;
}

.status-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 8px;
}

.status-section-head h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wa-text-sec);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-new-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--wa-teal);
  background: rgba(7, 94, 84, 0.08);
  border: none;
  border-radius: 16px;
  padding: 6px 12px;
  cursor: pointer;
}

.status-new-btn:hover {
  background: rgba(7, 94, 84, 0.14);
}

.status-rail {
  border-bottom: 1px solid var(--wa-border);
  background: #fff;
  padding: 10px 0 8px;
}

.status-rail-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 0 14px 4px;
  -webkit-overflow-scrolling: touch;
}

.status-rail-scroll::-webkit-scrollbar {
  height: 0;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.status-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2px;
  background: #d1d7db;
  display: grid;
  place-items: center;
  position: relative;
}

.status-ring.unseen {
  background: conic-gradient(#25d366 0 100%);
}

.status-ring.has {
  background: conic-gradient(#25d366 0 100%);
}

.status-ring.seen {
  background: #adb5bd;
}

.status-ring .avatar,
.status-ring .status-letter {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

.status-letter.status-letter-plus {
  font-size: 1.4rem;
  background: #f0f2f5;
  color: var(--wa-teal);
}

.status-add {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wa-green);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.status-item-name {
  font-size: 0.7rem;
  color: var(--wa-text-sec);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Contact info panel */
.contact-modal .contact-panel {
  width: min(440px, 100%);
  max-height: 100dvh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.contact-hero {
  background: var(--wa-teal);
  color: #fff;
  text-align: center;
  padding: 20px 16px 28px;
  position: relative;
}

.contact-close {
  position: absolute;
  left: 8px;
  top: 8px;
  color: #fff !important;
  font-size: 1.8rem;
}

.contact-photo-wrap {
  width: 140px;
  height: 140px;
  margin: 12px auto 14px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.15);
}

.contact-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-initial {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 600;
  background: linear-gradient(145deg, #00a884, #0b6b5c);
}

.contact-hero h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 500;
}

.contact-hero p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.9rem;
}

.contact-body {
  padding: 8px 0 20px;
  overflow-y: auto;
  flex: 1;
  background: #f0f2f5;
}

.contact-row {
  background: #fff;
  padding: 14px 18px;
  border-bottom: 1px solid var(--wa-border);
}

.contact-label {
  font-size: 0.78rem;
  color: var(--wa-teal-mid);
  margin-bottom: 4px;
  font-weight: 500;
}

.contact-value {
  color: var(--wa-text);
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.contact-body .btn {
  margin: 16px 18px 0;
  width: calc(100% - 36px);
}

.status-colors {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.status-color.active {
  border-color: #111;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111;
}

/* Status viewer */
.status-viewer {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #111;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.status-viewer-progress {
  display: flex;
  gap: 4px;
  padding: 10px 10px 0;
}

.status-viewer-progress span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.status-viewer-progress span i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}

.status-viewer-progress span.done i {
  width: 100%;
}

.status-viewer-progress span.active i {
  animation: statusBar 5s linear forwards;
}

@keyframes statusBar {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.status-viewer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  z-index: 2;
}

.status-viewer-head .icon-btn {
  color: #fff;
}

.status-viewer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.avatar.sm-status {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.status-viewer-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.status-viewer-time {
  font-size: 0.75rem;
  opacity: 0.75;
}

.status-viewer-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  min-height: 0;
}

.status-viewer-media {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

.status-viewer-text {
  font-size: 1.6rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.35;
  max-width: 90%;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-viewer-nav {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 1;
}

.status-nav-zone {
  flex: 1;
  background: transparent;
  border: none;
  cursor: pointer;
}

html.mobile-ui .contact-modal {
  padding: 0;
  align-items: stretch;
}

html.mobile-ui .contact-panel {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  border-radius: 0;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}

/*
 * Mode HP: html.mobile-ui dari JS (penting untuk Android WebView).
 * Fallback CSS @media (max-width:1024px) untuk browser biasa.
 */
html.mobile-ui,
html.mobile-ui body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

/* Combined mobile layout rules */
html.mobile-ui .app {
  grid-template-columns: 1fr;
  max-width: 100%;
  width: 100%;
  height: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

html.mobile-ui .app:not(.show-chat) .sidebar {
  display: flex !important;
  position: absolute;
  inset: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  border-right: none;
}

html.mobile-ui .app:not(.show-chat) .chat-pane {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

html.mobile-ui .app.show-chat .sidebar {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

html.mobile-ui .app.show-chat .chat-pane {
  display: flex !important;
  visibility: visible;
  flex-direction: column;
  position: absolute;
  inset: 0;
  z-index: 30;
  width: 100%;
  min-height: 0;
  height: 100%;
  background: var(--wa-bg-chat);
}

html.mobile-ui .app.show-chat .chat-active:not(.hidden) {
  display: flex !important;
  flex: 1;
  min-height: 0;
  height: 100%;
}

html.mobile-ui .app.show-chat .empty-chat {
  display: none !important;
}

html.mobile-ui #btn-back-mobile {
  display: grid !important;
  width: 40px;
  height: 40px;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--wa-teal);
  flex-shrink: 0;
}

html.mobile-ui .chat-header {
  padding: 6px 8px;
  gap: 4px;
}

html.mobile-ui .chat-peer h2 {
  font-size: 0.95rem;
}

html.mobile-ui .peer-status {
  font-size: 0.7rem;
}

html.mobile-ui .avatar.lg {
  width: 36px;
  height: 36px;
}

html.mobile-ui .search-msg-wrap {
  display: none;
}

html.mobile-ui .chat-actions .icon-btn {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

html.mobile-ui .msg {
  max-width: 85%;
}

html.mobile-ui .messages {
  padding: 8px 10px 12px;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

html.mobile-ui .composer {
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  gap: 4px;
}

html.mobile-ui .attach-btn {
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
}

html.mobile-ui .send-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  font-size: 1rem !important;
}

html.mobile-ui .composer-field {
  border-radius: 20px;
}

html.mobile-ui #msg-input {
  min-height: 34px;
  font-size: 16px;
  padding: 8px 10px;
}

html.mobile-ui .search-row {
  flex-wrap: wrap;
}

html.mobile-ui .search-row input[type="search"] {
  flex: 1 1 100%;
  font-size: 16px;
}

html.mobile-ui .search-btn {
  flex: 1;
  height: 36px !important;
  font-size: 0.8rem !important;
}

html.mobile-ui .nav-item {
  padding: 10px 12px;
  min-height: 56px;
}

html.mobile-ui .avatar {
  width: 46px;
  height: 46px;
}

html.mobile-ui .sidebar-head {
  padding: 8px 10px;
}

html.mobile-ui .brand-title {
  font-size: 1.05rem;
}

html.mobile-ui .me-row {
  gap: 8px;
}

html.mobile-ui .modal-panel,
html.mobile-ui .modal-wide {
  width: 100% !important;
  max-height: 100dvh;
  border-radius: 0;
}

html.mobile-ui .modal {
  padding: 0;
  align-items: stretch;
}

html.mobile-ui .admin-chat-layout {
  grid-template-columns: 1fr;
  max-height: none;
  min-height: 40vh;
}

html.mobile-ui .emoji-row {
  max-height: 120px;
}

html.mobile-ui .sticker-grid {
  max-height: 220px;
  grid-template-columns: repeat(5, 1fr);
}

html.mobile-ui .msg-sticker {
  width: 120px;
  height: 120px;
}

html.mobile-ui .action-sheet {
  align-items: end;
  padding: 0;
}

html.mobile-ui .action-sheet-panel {
  width: 100%;
  border-radius: 16px 16px 0 0;
}

html.mobile-ui .login-screen {
  padding: 16px;
  min-height: 100dvh;
}

html.mobile-ui .login-card {
  padding: 24px 18px;
}

/* Fallback media query (browser HP tanpa kelas JS dulu) */
@media (max-width: 1024px) {
  html:not(.desktop-ui) .app {
    grid-template-columns: 1fr;
    max-width: 100%;
    width: 100%;
    height: 100%;
    height: 100dvh;
    position: relative;
    overflow: hidden;
  }

  html:not(.desktop-ui) .app:not(.show-chat) .sidebar {
    display: flex !important;
    position: absolute;
    inset: 0;
    z-index: 20;
    width: 100%;
    border-right: none;
  }

  html:not(.desktop-ui) .app:not(.show-chat) .chat-pane {
    display: none !important;
  }

  html:not(.desktop-ui) .app.show-chat .sidebar {
    display: none !important;
  }

  html:not(.desktop-ui) .app.show-chat .chat-pane {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    inset: 0;
    z-index: 30;
    width: 100%;
    height: 100%;
  }

  html:not(.desktop-ui) .app.show-chat .chat-active:not(.hidden) {
    display: flex !important;
    flex: 1;
    min-height: 0;
    height: 100%;
  }

  html:not(.desktop-ui) #btn-back-mobile {
    display: grid !important;
  }

  html:not(.desktop-ui) .search-msg-wrap {
    display: none;
  }

  html:not(.desktop-ui) #msg-input {
    font-size: 16px;
  }
}

/* Desktop: tombol back disembunyikan */
html.desktop-ui #btn-back-mobile {
  display: none !important;
}

/* Default (sebelum JS / layar lebar tanpa mobile-ui): sembunyikan back */
#btn-back-mobile {
  display: none;
}

html.mobile-ui #btn-back-mobile {
  display: grid !important;
  width: 40px;
  height: 40px;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--wa-teal);
  flex-shrink: 0;
}

/* Lock screen */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(7, 94, 84, 0.92) 0%, rgba(7, 94, 84, 0.85) 100%),
    #075e54;
  backdrop-filter: blur(12px);
}

.lock-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.lock-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.lock-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--wa-text);
}

.lock-card > p {
  margin: 0 0 18px;
  color: var(--wa-text-sec);
  font-size: 0.9rem;
}

.lock-card form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.lock-toggle-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f0f2f5;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
}

.lock-toggle-row > span:first-child {
  font-weight: 500;
  color: var(--wa-text);
  font-size: 0.95rem;
}

.lock-toggle-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.lock-switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d1d7db;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.lock-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.lock-toggle-row input:checked + .lock-switch {
  background: var(--wa-green);
}

.lock-toggle-row input:checked + .lock-switch::after {
  transform: translateX(20px);
}

#btn-lock {
  color: #075e54;
  font-size: 1.1rem;
}

#btn-lock:hover {
  background: rgba(7, 94, 84, 0.08);
}
