:root {
  --navy: #0B1938; --navy-2: #13254d; --lime: #A6CA67; --bg: #f4f6f9; --card: #fff; --text: #0B1938;
  --muted: #5b6577; --border: #dde2ea; --danger: #c0392b; --bubble-in: #e9ecf1; --bubble-out: #2f7cf6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 20px; padding: 20px 28px; }
.logo { height: 56px; width: auto; }
.top h1 { margin: 0; font-size: 22px; }
.sub { margin: 4px 0 0; color: #c9d2e3; font-size: 14px; max-width: 720px; }
.steps { list-style: none; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 20px auto 0; padding: 0 16px; max-width: 1180px; }
.steps li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 99px; padding: 6px 14px 6px 6px; font-weight: 600; font-size: 14px; }
.steps span { background: var(--navy); color: var(--lime); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.layout { max-width: 1180px; margin: 0 auto; padding: 20px 16px 50px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0; font-size: 17px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.row.tight { margin-top: 0; }
.row input { flex: 1; min-width: 200px; }
input, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; width: 100%; color: var(--text); background: #fff; }
input:focus, textarea:focus { outline: 2px solid var(--lime); border-color: var(--lime); }
.btn { font: inherit; border: 1px solid var(--border); background: #fff; color: var(--text); padding: 9px 16px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--navy); font-weight: 600; }
.btn.danger { color: var(--danger); border-color: #f0c9c4; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.reset { text-align: center; margin: 0; }
.panel { margin-top: 14px; display: grid; gap: 10px; background: var(--bg); padding: 14px; border-radius: 10px; }
.panel label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.example { background: #fff; border: 1px dashed var(--border); border-radius: 8px; padding: 8px 12px; margin: 0; font-size: 13px; color: var(--muted); white-space: pre-wrap; font-family: inherit; }
.toggle { margin-top: 14px; width: 100%; text-align: left; font: inherit; font-weight: 600; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; cursor: pointer; color: var(--text); }
.toggle::after { content: " ▾"; color: var(--muted); }
.toggle[aria-expanded="true"]::after { content: " ▴"; }
.list { list-style: none; margin: 10px 0 0; padding: 0; }
.list li { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.q { width: 100%; text-align: left; background: none; border: 0; font: inherit; font-weight: 600; padding: 11px 14px; cursor: pointer; color: var(--text); }
.a { padding: 0 14px 10px; color: var(--muted); white-space: pre-wrap; }
.actions { display: flex; gap: 8px; padding: 0 14px 12px; }
.page { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.page .meta { min-width: 0; }
.page .title, .page .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page .title { font-weight: 600; }
.page .url { font-size: 13px; color: var(--muted); }
.panel label.pick, .pick { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; font-weight: 400 !important; }
.pick input { width: auto; margin-top: 3px; }
.empty { color: var(--muted); padding: 8px 2px; border: 0 !important; }

/* phone */
.phone-col { position: sticky; top: 16px; }
.phone { width: 340px; max-width: 100%; margin: 0 auto; height: 640px; background: #fff; border: 10px solid #111; border-radius: 44px;
  box-shadow: 0 20px 50px rgba(11,25,56,.25); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 24px; background: #111; border-radius: 0 0 16px 16px; z-index: 2; }
.status { display: flex; justify-content: space-between; padding: 6px 22px 0; font-size: 12px; font-weight: 600; height: 28px; }
.contact { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px 10px; border-bottom: 1px solid #eef0f4; background: #fafbfc; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: var(--lime); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.who { text-align: center; display: grid; line-height: 1.25; }
.who strong { font-size: 14px; }
.who span { font-size: 12px; color: var(--muted); }
.thread { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 18px; font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; }
.bubble.in { align-self: flex-start; background: var(--bubble-in); color: #111; border-bottom-left-radius: 6px; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); color: #fff; border-bottom-right-radius: 6px; }
.sys { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.sys.missed { color: var(--danger); font-weight: 600; }
.typing { align-self: flex-start; background: var(--bubble-in); border-radius: 18px; padding: 10px 14px; display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b2; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.compose { display: flex; gap: 6px; padding: 8px 10px 14px; border-top: 1px solid #eef0f4; }
.compose input { border-radius: 20px; padding: 8px 14px; font-size: 14px; }
.compose button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bubble-out); color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.compose button:disabled { opacity: .5; }
.phone-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.owner { margin: 14px auto 0; max-width: 340px; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 16px; }
.owner-title { margin: 0; font-size: 12px; color: var(--lime); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.owner-msg { margin: 6px 0 0; font-size: 14px; }
.req { color: var(--danger); }
input.needed { border-color: #e8a59d; }
.need { text-align: center; margin: 14px auto 0; max-width: 340px; color: var(--danger); font-weight: 600; font-size: 14px; }
.nudge { margin: 14px auto 0; max-width: 340px; background: #fff8e6; border: 1px solid #f0d58a; color: #6b5300; border-radius: 10px; padding: 10px 14px; font-size: 14px; text-align: center; }
.compose input:disabled { background: #f1f3f6; }
.fine { text-align: center; color: var(--muted); font-size: 12px; margin: 12px auto 0; max-width: 340px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 8px; max-width: 90vw; z-index: 9; }
.toast.error { background: var(--danger); }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .phone-col { position: static; order: -1; }
}
@media (max-width: 600px) { .top { padding: 16px; } .logo { height: 42px; } .top h1 { font-size: 19px; } .phone { height: 560px; } }
.embed .top { display: none; }
.embed body { background: transparent; }
