/* Customer messenger — a focused, single column surface. */
body { background: radial-gradient(900px 420px at 50% -8%, var(--brand-100), transparent 65%), var(--bg); }
.messenger-root { min-height: 100vh; display: flex; justify-content: center; align-items: stretch; }
.messenger { width: 100%; max-width: 480px; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; position: relative; }
@media (min-width: 720px) {
  .messenger-root { padding: 22px 0; }
  .messenger { min-height: calc(100vh - 44px); max-height: calc(100vh - 44px); border-radius: 26px; overflow: hidden; box-shadow: var(--sh-3); border: 1px solid var(--line-2); }
}

/* header */
.hdr { background: linear-gradient(145deg, var(--brand-900) 0%, var(--brand-600) 62%, var(--brand) 100%); color: #fff; padding: 18px 20px 26px; flex-shrink: 0; position: relative; }
.hdr.flat { padding-bottom: 14px; }
.hdr .brandrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hdr .logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; }
.hdr .logo img { width: 32px; height: 32px; object-fit: contain; }
.hdr .ib { width: 34px; height: 34px; border-radius: 10px; color: #fff; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; }
.hdr .ib:hover { background: rgba(255,255,255,.24); }
.hdr h1 { font-size: 22px; margin-top: 14px; line-height: 1.3; }
.hdr h2 { font-size: 17px; }
.hdr .sub { opacity: .88; font-size: 13px; margin-top: 2px; }
.hdr .chip { background: rgba(255,255,255,.18); color: #fff; }
.hdr .team { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hdr .team .avatar { border: 2px solid rgba(255,255,255,.7); }

/* body */
.body { flex: 1; min-height: 0; overflow: auto; padding: 16px 16px 90px; display: flex; flex-direction: column; gap: 12px; }
.body.lift { margin-top: -14px; }
.body.flush { padding: 0 0 80px; }

/* bottom nav */
.nav { position: absolute; bottom: 0; left: 0; right: 0; height: 66px; background: var(--surface); border-top: 1px solid var(--line-2); display: flex; justify-content: space-around; align-items: center; padding: 0 6px env(safe-area-inset-bottom); }
.nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--faint); min-width: 58px; padding: 6px 2px; border-radius: 10px; }
.nav a.active { color: var(--brand-600); }
.nav a .badge { position: absolute; top: 2px; inset-inline-end: 10px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--rose); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* home cards */
.hero-card { background: var(--surface); border-radius: 18px; box-shadow: var(--sh-2); padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; border: 1px solid var(--line-2); transition: transform .12s, box-shadow .12s; }
.hero-card:hover { transform: translateY(-1px); box-shadow: var(--sh-3); }
.hero-card .go { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-card.dark { background: var(--brand-900); color: #fff; border: 0; }
.hero-card.dark .go { background: rgba(255,255,255,.18); }
.tile { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; cursor: pointer; transition: box-shadow .12s; }
.tile:hover { box-shadow: var(--sh-2); }
.tile .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 4px; }

/* conversation list item */
.convitem { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.convitem:hover { box-shadow: var(--sh-2); border-color: var(--brand-100); }
.convitem.unread { border-inline-start: 3px solid var(--brand); }
.convitem .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* chat */
.chatview { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.chatview .msgs { flex: 1; overflow: auto; }
.ticketbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--brand-50); color: var(--brand-600); padding: 8px 16px; font-size: 12px; font-weight: 700; cursor: pointer; border-bottom: 1px solid var(--brand-100); }
.compbar { background: var(--surface); border-top: 1px solid var(--line-2); padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.quick button { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--brand-600); white-space: nowrap; background: var(--surface); }
.quick button:hover { background: var(--brand-50); }
.rate-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rate-box .rate { display: flex; gap: 6px; }
.rate-box .rate button { padding: 2px; transition: transform .1s; }
.rate-box .rate button:hover { transform: scale(1.15); }
.queue-note { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 6px 12px; text-align: center; }

/* ticket track */
.kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi .k { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.kpi .k .l { font-size: 11px; color: var(--muted); }
.kpi .k .v { font-weight: 800; font-size: 14px; color: var(--brand-900); }
.ticket-head { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }

/* help */
.article { background: var(--surface); border-radius: 16px; padding: 18px; line-height: 1.9; white-space: pre-wrap; border: 1px solid var(--line-2); }
.newsitem { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.newsitem.maint { border-color: var(--amber); background: var(--amber-bg); }
.newsitem p { white-space: pre-wrap; line-height: 1.7; color: var(--text-2); font-size: 13px; }

/* login */
.m-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; }
.m-login .card { width: 100%; max-width: 400px; border-radius: 24px; padding: 30px 26px 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--sh-3); }
.m-login img.logo-big { width: 120px; height: auto; margin: 0 auto; display: block; }
.m-login h1 { text-align: center; font-size: 20px; color: var(--brand-900); }
