/* Nest Chat screens on top of the shared kit (app.css): the inbox, chat bubbles, the widget preview. */
.page.wide { max-width: none; padding: 0; height: calc(100vh - 60px); display: flex; flex-direction: column; }
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 370px minmax(0, 1fr) 300px; background: var(--surface); }
.inbox > * { min-height: 0; min-width: 0; }
.ib-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.ib-tools { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.ib-rows { overflow-y: auto; flex: 1; }
.ib-row { display: flex; gap: 11px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--ink); font: inherit; }
.ib-row:hover { background: var(--raise); } .ib-row.on { background: var(--brand-bg); }
.ib-row .av { flex: none; } .ib-row .b { min-width: 0; flex: 1; }
.ib-row .l1 { display: flex; gap: 8px; align-items: baseline; } .ib-row .l1 b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ib-row .l1 time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.ib-row .l2 { display: flex; gap: 8px; align-items: center; margin-top: 2px; } .ib-row .l2 span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.ib-row.new .l1 b, .ib-row.new .l2 span { font-weight: 700; color: var(--ink); }
.cnt { background: var(--bus); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 19px; height: 19px; padding: 0 6px; display: inline-grid; place-items: center; flex: none; }
.ib-chat { display: flex; flex-direction: column; background: var(--paper); }
.ib-head { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; min-height: 60px; }
.ib-head h2 { font-size: 15.5px; } .ib-head .sub { font-size: 12.5px; color: var(--ink-3); }
.ib-msgs { flex: 1; overflow-y: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 7px; }
.msg { max-width: min(76%, 620px); padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.msg.visitor { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.agent { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot, .msg.ai { align-self: flex-end; background: var(--brand-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); border-bottom-right-radius: 4px; }
.msg.note { align-self: flex-end; background: var(--late-bg); color: var(--ink); border: 1px dashed color-mix(in srgb, var(--late) 45%, var(--line)); }
.msg.system { align-self: center; background: transparent; color: var(--ink-3); font-size: 12.5px; text-align: center; padding: 2px 8px; max-width: 90%; }
.msg small { display: block; font-size: 11px; opacity: .7; margin-top: 3px; } .msg.visitor small { text-align: left; } .msg.agent small, .msg.bot small, .msg.ai small, .msg.note small { text-align: right; }
.ib-reply { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.ib-reply textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; font: inherit; resize: none; min-height: 64px; max-height: 180px; background: var(--surface); color: var(--ink); }
.ib-reply textarea:focus { outline: 0; border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent); }
.ib-reply.note textarea { background: var(--late-bg); }
.ib-side { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.ib-side h3 { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.ib-side .kv { grid-template-columns: 78px 1fr; font-size: 13px; } .ib-side .kv dd { overflow-wrap: anywhere; }
.pv { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; } .pv a { color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pv a:hover { text-decoration: underline; } .pv time { color: var(--ink-3); font-size: 11.5px; }
.ib-back { display: none; }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--present); margin-right: 6px; } .dot-on.off { background: var(--ink-3); opacity: .5; }
.avail { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink); }
.avail.off { color: var(--ink-3); }
.snip { background: #12142A; color: #E7E9F6; border-radius: 12px; padding: 14px 16px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-bg); color: var(--brand-ink); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.menu-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 170px 36px; gap: 8px; align-items: start; }
.fld-row { display: grid; grid-template-columns: minmax(0, 1.5fr) 130px 96px 36px; gap: 8px; align-items: center; }
.wprev { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #F6F7FB; max-width: 340px; box-shadow: var(--shadow); font-size: 13.5px; }
.wprev .h { color: #fff; padding: 14px; display: flex; gap: 10px; align-items: center; } .wprev .h i { width: 36px; height: 36px; border-radius: 50%; background: #fff3; display: grid; place-items: center; font-style: normal; font-weight: 800; }
.wprev .h b { display: block; } .wprev .h span { font-size: 12px; opacity: .9; }
.wprev .bd { padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; } .wprev .bb { background: #fff; border: 1px solid #E6E8F0; border-radius: 14px; border-bottom-left-radius: 4px; padding: 8px 12px; align-self: flex-start; max-width: 85%; color: #12142A; }
.wprev .ops { display: flex; flex-wrap: wrap; gap: 6px; } .wprev .ops span { border: 1.5px solid; border-radius: 99px; padding: 5px 12px; font-weight: 600; font-size: 12.5px; background: #fff; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 150px; }
.bars .bcol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bars .bb { width: 100%; max-width: 26px; border-radius: 5px 5px 0 0; background: var(--brand); min-height: 2px; } .bars .bb.l { background: var(--bus); }
.bars small { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.lead-st { display: inline-flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 1180px) { .inbox { grid-template-columns: 300px minmax(0, 1fr); } .ib-side { display: none; } }
@media (max-width: 760px) {
  .page.wide { height: calc(100dvh - 60px); }
  .inbox { grid-template-columns: 1fr; } .inbox.has .ib-list { display: none; } .inbox:not(.has) .ib-chat { display: none; }
  .ib-back { display: inline-grid; } .menu-row, .fld-row { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
}
.top .menu-btn { display: none; }
@media (max-width: 1000px) { .top .menu-btn { display: inline-grid; } }
.ib-tools .seg { width: 100%; } .ib-tools .seg button { flex: 1; padding: 5px 6px; white-space: nowrap; font-size: 12.5px; }
.ib-row .l2 > .cnt, .ib-row .l2 > .pill { flex: none; }
.stars-s { color: #F5A524; letter-spacing: 1px; font-size: 13px; white-space: nowrap; } .stars-s i { color: var(--line-2); font-style: normal; }
.msg.typing-p { opacity: .65; border-style: dashed; font-style: italic; }
.ib-reply { position: relative; }
.slash { position: absolute; left: 14px; right: 14px; bottom: calc(100% - 4px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 5; }
.slash button { display: grid; grid-template-columns: 150px 1fr; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.slash button.on, .slash button:hover { background: var(--brand-bg); }
.slash button span { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tpl button { text-align: left; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); display: grid; gap: 3px; }
.tpl button:hover { border-color: var(--line-2); } .tpl button.on { border-color: var(--brand); background: var(--brand-bg); }
.tpl small { color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }
.fprev { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 14px; background: #F4F5FA; }
.ans-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) 170px 36px; gap: 8px; align-items: start; }
.hbars { display: grid; gap: 7px; } .hrow { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 70px; gap: 10px; align-items: center; font-size: 13px; }
.hrow .track { height: 10px; border-radius: 6px; background: var(--sunk); overflow: hidden; } .hrow .track i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 90px; } .hours div { background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.hours-x { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; font-size: 10px; color: var(--ink-3); text-align: center; margin-top: 4px; }
@media (max-width: 760px) { .ans-row { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); } .slash button { grid-template-columns: 1fr; gap: 2px; } }
.split.side { grid-template-columns: minmax(0, 1fr) 380px; } .modal.wide { width: min(760px, calc(100vw - 28px)); max-width: none; }
@media (max-width: 1000px) { .split.side { grid-template-columns: minmax(0, 1fr); } }
