/* Messages (T3, module chat): a phone with a chat messenger (green/teal, wallpaper, ticks) and an SMS app. */
/* P9 scheme tokens: light = the colours these rules always used, dark = the messenger and SMS apps in their own dark themes. */
:root {
  --messages-blue-text: #0b65c2;
  --messages-green-line: #c6e8d5;
  --messages-green-text: #2f6b52;
  --messages-green-text-2: #11704a;
  --messages-green-text-3: #1f7a5a;
  --messages-line: #fff;
  --messages-line-2: #eceeed;
  --messages-line-3: #e6e8e7;
  --messages-line-4: #e3e5e4;
  --messages-shade: rgba(0,0,0,.04);
  --messages-shade-2: rgba(0,0,0,.035);
  --messages-surface: #fff;
  --messages-surface-2: #fafafa;
  --messages-surface-3: #f7f8fa;
  --messages-surface-4: #f4f6f5;
  --messages-surface-5: #f0f2f5;
  --messages-surface-6: #e8f5ee;
  --messages-surface-7: #e9e9eb;
  --messages-surface-8: #efe7dd;
  --messages-text: #111;
  --messages-text-2: #445;
  --messages-text-3: #54656f;
  --messages-text-4: #667;
  --messages-text-5: #5d6b72;
  --messages-tint-blue: #e1f2fb;
  --messages-tint-green: #d9fdd3;
  --messages-tint-green-2: #d7e9df;
  --messages-tint-yellow: #fff7d1;
  --messages-yellow-text: #5d5226;
}
[data-scheme="dark"] {
  --messages-blue-text: #6fadfd;
  --messages-green-line: #36493e;
  --messages-green-text: #83b99f;
  --messages-green-text-2: #74bd97;
  --messages-green-text-3: #73bd9d;
  --messages-line: #343434;
  --messages-line-2: #3b3d3c;
  --messages-line-3: #3e403f;
  --messages-line-4: #3f4140;
  --messages-shade: rgba(255, 255, 255, 0.048);
  --messages-shade-2: rgba(255, 255, 255, 0.042);
  --messages-surface: #111b21;
  --messages-surface-2: #1e1e1e;
  --messages-surface-3: #1f2021;
  --messages-surface-4: #212322;
  --messages-surface-5: #202c33;
  --messages-surface-6: #212824;
  --messages-surface-7: #2e2e2f;
  --messages-surface-8: #332e28;
  --messages-text: #ececec;
  --messages-text-2: #c3c3d8;
  --messages-text-3: #a4b7c2;
  --messages-text-4: #aeaec1;
  --messages-text-5: #a3b2ba;
  --messages-tint-blue: #202a30;
  --messages-tint-green: #005c4b;
  --messages-tint-green-2: #2b3630;
  --messages-tint-yellow: #272209;
  --messages-yellow-text: #b6ab82;
}
.t3-domain { color: var(--messages-blue-text); text-decoration: underline; font: inherit; padding: 0; background: none; border: 0; cursor: pointer; }
.ms-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px minmax(0, 1fr); gap: 24px; align-items: start; }
.ms-side { grid-column: 1; justify-self: end; max-width: 260px; padding-top: 30px; color: var(--muted); font-size: 13px; }
.ms-side h2 { font-size: 20px; color: var(--text); margin: 2px 0 6px; }
.ms-side-note { margin-top: 12px; padding: 10px 12px; border-left: 3px solid #1fb36b; background: var(--surface); border-radius: 6px; }
.ms-phone { grid-column: 2; width: 390px; height: min(820px, calc(100dvh - 150px)); min-height: 560px; background: #111; border-radius: 44px; padding: 12px; box-shadow: 0 30px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.ms-status { display: flex; justify-content: space-between; align-items: center; color: #fff; font: 600 13px/1 -apple-system, "Segoe UI", sans-serif; padding: 8px 22px 8px; }
.ms-status-icons { display: flex; gap: 3px; align-items: flex-end; }
.ms-status-icons i { width: 3px; background: var(--messages-surface); border-radius: 1px; display: block; }
.ms-status-icons i:nth-child(1) { height: 5px; } .ms-status-icons i:nth-child(2) { height: 8px; } .ms-status-icons i:nth-child(3) { height: 11px; }
.ms-status-icons b { width: 22px; height: 11px; border: 1.5px solid var(--messages-line); border-radius: 3px; margin-left: 5px; background: linear-gradient(90deg, var(--messages-surface) 70%, transparent 70%); background-clip: content-box; padding: 1px; }
.ms-screen { flex: 1; background: var(--messages-surface); border-radius: 32px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }
.ms-apphead { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 10px; background: var(--messages-surface); }
.ms-apphead h2 { font-size: 26px; font-weight: 700; color: var(--messages-text); }
.ms-apphead.is-sms h2 { color: var(--messages-text); }
.ms-head-icons { display: flex; gap: 14px; color: var(--messages-green-text-3); }
.ms-dirbar { padding: 0 14px 8px; }
.ms-chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--messages-surface-6); color: var(--messages-green-text-2); border: 1px solid var(--messages-green-line); }
.ms-chip.is-on { background: #11704a; color: #fff; }
.ms-list { flex: 1; overflow-y: auto; }
.ms-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 9px 16px; text-align: left; background: none; border: 0; cursor: pointer; }
.ms-row:hover { background: var(--messages-surface-4); }
.ms-row img, .ms-row .avatar { flex: none; }
.ms-row-copy { flex: 1; min-width: 0; border-bottom: 1px solid var(--messages-line-2); padding-bottom: 10px; }
.ms-row-top, .ms-row-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ms-row-top strong { font-size: 16px; color: var(--messages-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-row-top time { font-size: 12px; color: var(--messages-text-4); }
.ms-row-top time.is-unread { color: #1fb36b; font-weight: 600; }
.ms-preview { font-size: 14px; color: var(--messages-text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 3px; align-items: center; }
.ms-badge { background: #1fb36b; color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; }
.ms-group-av { width: 46px; height: 46px; border-radius: 50%; background: var(--messages-tint-green-2); color: var(--messages-green-text); display: grid; place-items: center; position: relative; flex: none; }
.ms-group-av b { position: absolute; bottom: -2px; right: -2px; background: #1fb36b; color: #fff; font-size: 9px; border-radius: 999px; padding: 1px 4px; border: 2px solid var(--messages-line); }
.ms-empty, .ms-sys { text-align: center; color: var(--messages-text-4); font-size: 12.5px; padding: 16px; }
.ms-sys { background: var(--messages-tint-yellow); color: var(--messages-yellow-text); border-radius: 8px; margin: 8px auto; max-width: 290px; padding: 6px 10px; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.ms-tabs { display: flex; justify-content: space-around; border-top: 1px solid var(--messages-line-3); padding: 8px 0 14px; background: var(--messages-surface-2); }
.ms-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--messages-text-4); background: none; border: 0; }
.ms-tabs button.is-active { color: var(--messages-green-text-2); font-weight: 700; }
.ms-convhead { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--messages-surface-3); border-bottom: 1px solid var(--messages-line-4); }
.ms-convhead .ms-head-icons { margin-left: auto; }
.ms-back { background: none; border: 0; color: var(--messages-green-text-2); transform: rotate(180deg); display: grid; place-items: center; padding: 4px; }
.ms-conv-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ms-conv-title strong { font-size: 15px; color: var(--messages-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-conv-title small { font-size: 11.5px; color: var(--messages-text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-convhead .ms-group-av { width: 36px; height: 36px; }
.ms-thread { flex: 1; overflow-y: auto; padding: 10px 10px 14px; background-color: var(--messages-surface-8); background-image: radial-gradient(var(--messages-shade-2) 1px, transparent 1px); background-size: 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.ms-thread.is-sms { background: var(--messages-surface); }
.ms-day { text-align: center; margin: 8px 0; }
.ms-day span { background: var(--messages-tint-blue); color: var(--messages-text-2); font-size: 11.5px; padding: 4px 10px; border-radius: 8px; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.ms-msg { display: flex; }
.ms-msg.self { justify-content: flex-end; }
.ms-msg.first { margin-top: 6px; }
.ms-bubble { max-width: 82%; background: var(--messages-surface); border-radius: 10px; padding: 6px 8px 4px; box-shadow: 0 1px 0 rgba(0,0,0,.12); font-size: 14.5px; line-height: 1.35; color: var(--messages-text); position: relative; }
.ms-msg.self .ms-bubble { background: var(--messages-tint-green); }
.ms-thread.is-sms .ms-bubble { background: var(--messages-surface-7); border-radius: 18px; box-shadow: none; padding: 8px 12px; }
.ms-thread.is-sms .ms-msg.self .ms-bubble { background: #1f8bff; color: #fff; }
.ms-thread.is-sms .ms-msg.self .ms-meta, .ms-thread.is-sms .ms-msg.self .ms-tick { color: rgba(255,255,255,.8); }
.ms-sender { display: block; font-size: 12.5px; margin-bottom: 1px; }
.ms-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.ms-meta { float: right; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--messages-text-4); margin: 6px 0 -2px 10px; }
.ms-tick { display: inline-flex; color: #8696a0; position: relative; }
.ms-tick2 { margin-left: -7px; display: inline-flex; }
.ms-tick.is-read { color: #34b7f1; }
.ms-fwd { font-size: 12px; color: var(--messages-text-4); font-style: italic; display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.ms-voice { display: flex; align-items: center; gap: 8px; min-width: 230px; padding: 2px 0; }
.ms-play { width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: var(--messages-text-5); display: grid; place-items: center; }
.ms-wave { display: flex; align-items: center; gap: 2px; flex: 1; height: 24px; }
.ms-wave i { width: 3px; background: #9fb0b8; border-radius: 2px; display: block; }
.ms-wave.is-playing i { background: #1fb36b; }
.ms-voice small { font-size: 11px; color: var(--messages-text-4); }
.ms-transcript { font-size: 12.5px !important; color: var(--messages-text-2); background: var(--messages-shade); border-radius: 6px; padding: 4px 6px; margin-top: 4px !important; }
.ms-transcript span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #889; }
.ms-photo { position: relative; margin: -2px -4px 4px; border-radius: 8px; overflow: hidden; }
.ms-photo img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.ms-photo-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.2); }
.ms-compose { display: flex; gap: 6px; align-items: center; padding: 8px 8px 12px; background: var(--messages-surface-5); }
.ms-compose input { flex: 1; border: 0; border-radius: 22px; padding: 10px 14px; font-size: 15px; background: var(--messages-surface); outline: none; }
.ms-icbtn, .ms-send { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; }
.ms-icbtn { background: none; color: var(--messages-text-3); }
.ms-send { background: #1fb36b; color: #fff; }
@media (max-width: 1100px) { .ms-wrap { grid-template-columns: minmax(0, 1fr); } .ms-side { display: none; } .ms-phone { grid-column: 1; justify-self: center; min-width: 0; max-width: 100%; } }
@media (max-width: 720px) {
  .ms-phone { width: 100%; height: calc(100dvh - 130px); min-height: 520px; background: none; padding: 0; border-radius: 0; box-shadow: none; }
  .ms-status { display: none; }
  .ms-screen { border-radius: 12px; border: 1px solid var(--border); }
}
