/*
  Centralino — a telephone switchboard for WhatsApp numbers.
  Layout: one column (phone first). Each WhatsApp number is a "line" with its own color (--lc):
  a lamp that lights up with unread messages, and a cord color that tints the whole conversation.
  Type: Bricolage Grotesque (display) · Figtree (text) · JetBrains Mono (numbers, times, counters).
*/
:root {
  --bg: #eceff4;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --fg: #111723;
  --muted: #5a6476;
  --line: #dde2ea;
  --accent: #3156e0;
  --ok: #12a067;
  --bad: #e0463c;
  --hole: #1b2230;
  --shade: rgba(9, 14, 22, .42);
  --shadow: 0 1px 2px rgba(17, 23, 35, .06), 0 6px 20px -8px rgba(17, 23, 35, .18);
  --bubble-mix: 15%;
  --lc: var(--accent);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e15;
    --surface: #121923;
    --surface-2: #17202c;
    --fg: #e9eef6;
    --muted: #8d99ad;
    --line: #222c3a;
    --accent: #6f8fff;
    --ok: #36c98c;
    --bad: #ff6a5e;
    --hole: #05080d;
    --shade: rgba(0, 0, 0, .58);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -10px rgba(0, 0, 0, .7);
    --bubble-mix: 30%;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.42 var(--body); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
input, textarea { font-size: 16px; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
a { color: var(--lc); }
:focus-visible { outline: 2px solid var(--lc); outline-offset: 2px; }
[hidden] { display: none !important; }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

#app {
  height: 100%; max-width: 680px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--bg); position: relative; padding-top: env(safe-area-inset-top, 0px);
}
@media (min-width: 720px) {
  body { background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--muted) 22%, transparent) 1px, transparent 1.5px) 0 0 / 18px 18px, var(--bg); }
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: var(--shadow); }
}
.boot { flex: 1; display: grid; place-items: center; font-family: var(--display); font-size: 30px; color: var(--muted); letter-spacing: -.02em; }

/* ---------- lamps & jacks (the switchboard vocabulary) ---------- */
.lamp {
  --c: var(--lc);
  width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block;
  background: color-mix(in srgb, var(--c) 28%, var(--surface-2));
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .25);
}
.lamp.on {
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--c) 45%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent), 0 0 14px 2px color-mix(in srgb, var(--c) 70%, transparent);
}
.lamp.ok { --c: var(--ok); }
.lamp.bad { --c: var(--bad); }
.jack {
  --c: var(--lc);
  width: 52px; height: 52px; border-radius: 50%; flex: none; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle, var(--hole) 0 34%, color-mix(in srgb, var(--c) 85%, #000) 36% 44%, var(--c) 46% 100%);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .28), inset 0 2px 3px rgba(255, 255, 255, .35), 0 2px 6px -2px color-mix(in srgb, var(--c) 60%, transparent);
}
.jack b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 15px var(--display); opacity: 0; }

/* ---------- top bars ---------- */
.bar {
  display: flex; align-items: center; gap: 10px; padding-block: 10px; min-height: 62px; flex: none;
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative;
}
.bar.cord::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--lc); }
.bar h1, .bar h2 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }
.bar h1 { font-size: 26px; }
.bar h2 { font-size: 17.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
.bar .t { flex: 1; min-width: 0; }
.bar .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--fg); flex: none; transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* ---------- login: a lit switchboard ---------- */
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 30px; padding-block: 32px; overflow-y: auto; }
.board {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; padding: 18px; border-radius: 22px; max-width: 360px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 92%, var(--accent)), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.board .cell { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.board .lamp { width: 9px; height: 9px; }
.board .hole { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--hole) 0 42%, #8b95a6 46% 58%, #c9d0db 62%); box-shadow: inset 0 -1px 2px rgba(0, 0, 0, .3); }
.login h1 { font-family: var(--display); font-size: clamp(44px, 13vw, 60px); line-height: .95; margin: 0 0 10px; letter-spacing: -.045em; }
.login p { margin: 0; color: var(--muted); max-width: 34ch; font-size: 16px; }
.eyebrow { font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ---------- forms & buttons ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.input { width: 100%; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--lc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lc) 16%, transparent); }
textarea.input { resize: none; min-height: 72px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px; font-weight: 600; transition: transform .12s, filter .15s, background .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--lc); color: #fff; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--lc) 80%, transparent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.ghost { color: var(--muted); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.outline { border: 1px solid var(--line); background: var(--surface); }
.btn.full { width: 100%; }
.btn.small { padding: 8px 13px; font-size: 13.5px; border-radius: 11px; }
form.stack, .stack { display: flex; flex-direction: column; gap: 14px; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.err { color: var(--bad); font-size: 13.5px; margin: 0; min-height: 1.2em; }

/* ---------- the switchboard (lines) ---------- */
.board-head { padding-block: 22px 6px; }
.board-head h1 { font-family: var(--display); font-size: 38px; letter-spacing: -.04em; margin: 0; line-height: 1; }
.readout { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.readout span { font: 500 12px var(--mono); padding: 5px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.readout b { color: var(--fg); font-weight: 600; }
.head-actions { position: absolute; right: max(10px, env(safe-area-inset-right, 0px)); top: 14px; display: flex; gap: 4px; }
.lines-wrap { position: relative; }
.section-label { font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 22px 0 10px; }
.lines { display: grid; grid-template-columns: 1fr; gap: 12px; padding-bottom: 24px; }
@media (min-width: 560px) { .lines { grid-template-columns: 1fr 1fr; } }
.line-card {
  --c: var(--lc);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; position: relative; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.line-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: .9; }
.line-card:hover { transform: translateY(-2px); }
.line-card:active { transform: scale(.985); }
.line-card .info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.line-card .name { font: 700 20px var(--display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-card .num { font: 500 12.5px var(--mono); color: var(--muted); }
.line-card .state { font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.line-card .state.bad { color: var(--bad); }
.line-card .side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.line-card .big { font: 600 26px var(--mono); line-height: 1; color: var(--c); letter-spacing: -.04em; }
.line-card .big.zero { color: var(--line); }
.add-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; text-align: left; border-radius: 22px; border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); color: var(--fg); font-weight: 600; transition: border-color .15s, background .15s; }
.add-card:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.add-card .plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed color-mix(in srgb, var(--muted) 55%, transparent); color: var(--accent); }
.add-card small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.tip { margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.tip b { font-weight: 600; }
.tip .btn { align-self: flex-start; }

/* ---------- chats ---------- */
.search { padding-block: 10px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.search { display: flex; gap: 8px; }
.search .input { flex: 1; min-width: 0; }
.new-chat { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; border-radius: 12px; background: var(--lc); color: #fff; font-weight: 600; font-size: 13.5px; box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--lc) 85%, transparent); transition: transform .12s; }
.new-chat:active { transform: scale(.96); }
.new-chat svg { width: 17px; height: 17px; }
.search .input { padding: 10px 15px; background: var(--surface-2); border-color: transparent; border-radius: 12px; }
.banner { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding-block: 10px; background: color-mix(in srgb, var(--bad) 9%, var(--surface)); border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--bad); flex: none; }
.chat-row { display: flex; gap: 13px; align-items: center; width: 100%; text-align: left; padding: 10px 8px; margin-inline: -8px; width: calc(100% + 16px); border-radius: 16px; transition: background .12s; }
.chat-row:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.chat-row + .chat-row { margin-top: 1px; }
.avatar { position: relative; overflow: hidden; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; flex: none; font-size: 16px; letter-spacing: .02em; }
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }
.avatar-wrap { position: relative; flex: none; border-radius: 50%; }
.avatar-wrap.unread { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--lc); }
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-row .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-row .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-row .cn { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .time { font: 500 11.5px var(--mono); color: var(--muted); flex: none; }
.chat-row .time.hot { color: var(--lc); }
.chat-row .bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-row .prev { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 4px; min-width: 0; }
.chat-row.unread .cn { font-weight: 700; }
.chat-row.unread .prev { color: var(--fg); }
.prev > span { overflow: hidden; text-overflow: ellipsis; }
.prev.missed { color: var(--bad); }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--lc); color: #fff; font: 600 11.5px var(--mono); display: grid; place-items: center; flex: none; }
.empty { padding: 56px 8px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; max-width: 34ch; margin: 0 auto; }

/* typing */
.typing, .sub.typing { color: var(--lc) !important; }
.dots { display: inline-flex; gap: 3px; align-items: center; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; }

/* ---------- conversation ---------- */
.conv-bg {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--lc) 18%, transparent) 1px, transparent 1.6px) 0 0 / 16px 16px,
    linear-gradient(180deg, color-mix(in srgb, var(--lc) 6%, var(--bg)), var(--bg) 60%);
}
.msgs { display: flex; flex-direction: column; gap: 3px; padding-block: 14px 18px; }
.day { align-self: center; font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 4px 11px; border-radius: 20px; margin: 12px 0 8px; }
.more { align-self: center; }
.msg-wrap { display: flex; flex-direction: column; max-width: 82%; }
.msg-wrap.in { align-self: flex-start; align-items: flex-start; }
.msg-wrap.out { align-self: flex-end; align-items: flex-end; }
.msg {
  max-width: 100%; padding: 7px 11px 6px; border-radius: 18px; position: relative; overflow-wrap: anywhere; white-space: pre-wrap;
  cursor: pointer; user-select: text; -webkit-user-select: text; font-size: 15.5px; line-height: 1.38;
}
.msg.in { background: var(--surface); border-bottom-left-radius: 6px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.msg.out { background: color-mix(in srgb, var(--lc) var(--bubble-mix), var(--surface)); border-bottom-right-radius: 6px; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); }
.msg.same.in { border-top-left-radius: 8px; }
.msg.same.out { border-top-right-radius: 8px; }
.msg-wrap + .msg-wrap.gap { margin-top: 8px; }
.msg .meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font: 500 10.5px var(--mono); color: var(--muted); margin-top: 2px; white-space: nowrap; float: right; margin-left: 10px; position: relative; top: 4px; }
.msg .who { font-size: 12.5px; font-weight: 700; margin-bottom: 1px; white-space: normal; }
.msg .quote { border-left: 3px solid var(--lc); background: color-mix(in srgb, var(--lc) 9%, transparent); border-radius: 8px; padding: 5px 9px; margin-bottom: 5px; font-size: 13px; color: var(--muted); white-space: normal; max-height: 4em; overflow: hidden; }
.msg .quote b { display: block; color: var(--lc); font-weight: 700; font-size: 12px; }
.msg .deleted { font-style: italic; color: var(--muted); }
.msg .failed { color: var(--bad); font-size: 12px; white-space: normal; }
.media { display: block; border-radius: 13px; width: 250px; max-width: 100%; background: var(--surface-2); object-fit: cover; margin: 1px -5px 4px; max-width: calc(100% + 10px); }
.sticker { width: 140px; height: 140px; object-fit: contain; background: none; margin: 0; }
.msg audio { width: 250px; max-width: 100%; display: block; height: 40px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--lc) 9%, transparent); text-decoration: none; color: var(--fg); white-space: normal; margin-bottom: 4px; font-weight: 500; }
.doc svg { width: 24px; height: 24px; flex: none; color: var(--lc); }
.tick { width: 16px; height: 11px; flex: none; }
.tick.read { color: var(--lc); }
.reacts { display: flex; gap: 4px; margin: -5px 10px 3px; position: relative; z-index: 1; flex-wrap: wrap; }
.react { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1px 8px; font-size: 13.5px; line-height: 1.55; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.react.mine { border-color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, var(--surface)); }
.call-pill { align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; margin: 6px 0; cursor: pointer; }
.call-pill svg { width: 16px; height: 16px; }
.call-pill.missed { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.call-pill .mono { color: var(--muted); font-size: 11px; }

/* composer */
.composer-wrap { flex: none; background: color-mix(in srgb, var(--surface) 88%, transparent); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 44px; padding: 10px 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); outline: none; line-height: 1.35; transition: border-color .15s, box-shadow .15s; }
.composer textarea:focus { border-color: var(--lc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lc) 14%, transparent); }
.send { width: 44px; height: 44px; border-radius: 50%; background: var(--lc); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--lc) 85%, transparent); transition: transform .12s; }
.send:active:not(:disabled) { transform: scale(.92); }
.send svg, .attach svg { width: 20px; height: 20px; }
.attach { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.attach:hover { background: var(--surface-2); }
.ctx-bar { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.ctx { flex: 1; min-width: 0; border-left: 3px solid var(--lc); background: color-mix(in srgb, var(--lc) 9%, var(--surface)); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; font-size: 13px; }
.ctx b { color: var(--lc); font-weight: 700; font-size: 12.5px; }
.ctx span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-box { display: flex; flex-direction: column; gap: 2px; padding-block: 8px 4px; max-height: 40vh; overflow-y: auto; }
.quick-item, .list-row { display: flex; gap: 12px; align-items: baseline; text-align: left; width: 100%; padding: 10px 8px; border-radius: 10px; }
.quick-item:hover, .list-row:hover { background: var(--surface-2); }
.kbd { font: 600 13px var(--mono); color: var(--lc); flex: none; }
.list-text { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 8px; margin-top: 10px; }
.list-row + .list-row { border-top: 1px solid var(--line); border-radius: 0; }
.list-empty { padding: 14px 8px; }
.composer.rec { align-items: center; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--bad); flex: none; box-shadow: 0 0 10px var(--bad); }
.rec-time { font: 600 15px var(--mono); }
.rec-label { flex: 1; color: var(--muted); font-size: 14px; }
.wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 28px; overflow: hidden; }
.wave i { width: 3px; border-radius: 2px; background: color-mix(in srgb, var(--bad) 70%, var(--muted)); height: 30%; }

/* ---------- sheets ---------- */
.shade { position: absolute; inset: 0; background: var(--shade); display: flex; align-items: flex-end; z-index: 20; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet {
  width: 100%; max-height: 92%; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0;
  padding-top: 10px; padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .35);
}
.sheet::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); flex: none; }
.sheet h3 { margin: 0; font-family: var(--display); font-size: 24px; letter-spacing: -.02em; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: baseline; color: var(--muted); font-size: 14.5px; counter-increment: s; }
.steps li::before { content: counter(s); font: 600 12px var(--mono); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--lc) 14%, var(--surface)); color: var(--lc); flex: none; transform: translateY(-1px); }
.steps b { color: var(--fg); font-weight: 600; }
.qr-wrap { align-self: center; padding: 14px; background: #fff; border-radius: 22px; width: 252px; height: 252px; display: grid; place-items: center; color: #5a6476; text-align: center; font-size: 13.5px; box-shadow: 0 0 0 1px var(--line), 0 0 0 6px color-mix(in srgb, var(--lc) 18%, transparent); }
.qr-wrap img { width: 224px; height: 224px; display: block; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.chip > span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 20px; border: 1px solid var(--line); font-size: 14px; background: var(--surface); }
.chip input:checked + span { border-color: var(--c, var(--lc)); background: color-mix(in srgb, var(--c, var(--lc)) 13%, var(--surface)); font-weight: 600; }
.chip input:disabled + span { opacity: .45; }
.chip input:focus-visible + span { outline: 2px solid var(--lc); outline-offset: 2px; }
.phone { display: flex; gap: 8px; }
.phone .input:first-child { width: 82px; flex: none; text-align: center; font-family: var(--mono); }
.slash { width: 46px !important; flex: none; text-align: center; color: var(--muted); padding-inline: 0; }
.divider { height: 1px; background: var(--line); }
.emoji-row { display: flex; justify-content: space-between; gap: 4px; padding: 6px; border-radius: 30px; background: var(--surface-2); }
.emoji { font-size: 27px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; transition: transform .12s; }
.emoji:hover { transform: scale(1.15); }
.emoji.on { background: color-mix(in srgb, var(--lc) 18%, var(--surface)); box-shadow: inset 0 0 0 2px var(--lc); }
.menu { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.menu-item { text-align: left; padding: 15px 16px; font-size: 16px; }
.menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--bad); }
.fwd-list { max-height: 45vh; overflow-y: auto; padding-inline: 8px; }

.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; z-index: 30; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow); }
.offline { background: var(--bad); color: #fff; text-align: center; font: 600 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px; flex: none; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .28s cubic-bezier(.2, .9, .3, 1.1); }
  .shade { animation: fade .2s ease-out; }
  .toast { animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2); }
  .pop { animation: pop .35s cubic-bezier(.2, .9, .3, 1.25); }
  .msg-wrap.out.pop { transform-origin: bottom right; }
  .msg-wrap.in.pop { transform-origin: bottom left; }
  .lamp.on.pulse { animation: lamp 1.8s ease-in-out infinite; }
  .board .lamp.on { animation: lamp 2.4s ease-in-out infinite; }
  .dots i { animation: dot 1.2s ease-in-out infinite; }
  .dots i:nth-child(2) { animation-delay: .15s; }
  .dots i:nth-child(3) { animation-delay: .3s; }
  .rec-dot { animation: blink 1s ease-in-out infinite; }
  .wave i { animation: wave 1s ease-in-out infinite; }
  .screen-in { animation: screenIn .24s ease-out; }
  @keyframes up { from { transform: translateY(40px); opacity: .3; } to { transform: none; opacity: 1; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
  @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
  @keyframes lamp { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.45); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 26%, transparent), 0 0 22px 4px color-mix(in srgb, var(--c) 80%, transparent); } }
  @keyframes dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
  @keyframes blink { 50% { opacity: .3; } }
  @keyframes wave { 0%, 100% { height: 25%; } 50% { height: 90%; } }
  @keyframes screenIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
}
