:root {
  --brand: #5b4ef0; --brand-d: #4a3ed8; --brand-soft: #efedfd; --brand-line: #c9c3fa;
  --bg: #f7f7fa; --card: #fff; --line: #e7e7ee; --text: #1d1d27; --muted: #6b6b7b; --field: #f4f4f7;
  --ok: #17a34a; --ok-soft: #e7f7ec; --warn: #c47a00; --warn-soft: #fff4dc; --err: #d93636; --err-soft: #fdeaea;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif; color: var(--text); background: var(--bg); display: flex; min-height: 100vh; }
a { color: var(--brand); text-decoration: none; }
.sidebar { width: 230px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; padding: 0 8px 18px; }
.logo { background: var(--brand); color: #fff; border-radius: 7px; width: 26px; height: 26px; display: grid; place-items: center; font-size: 14px; }
nav a { display: block; padding: 10px 12px; border-radius: 10px; color: #333; margin-bottom: 4px; }
nav a:hover { background: var(--field); }
nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.account { margin-top: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; }
.account .pill { margin-top: 8px; display: block; text-align: center; }
main { flex: 1; padding: 28px 36px 80px; max-width: 1400px; min-width: 0; }
.acctabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.acctabs:empty { display: none; }
.acctabs a { padding: 9px 14px; border-radius: 10px 10px 0 0; color: #444; font-weight: 600; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.acctabs a:hover { background: #fff; }
.acctabs a.on { background: #fff; color: var(--brand); border-color: var(--line); border-bottom: 1px solid #fff; }
.acctabs a small { font-weight: 600; background: var(--field); color: var(--muted); border-radius: 99px; padding: 1px 7px; font-size: 11px; }
.acctabs a.on small { background: var(--brand-soft); color: var(--brand); }
.acctabs a.add { color: var(--brand); font-weight: 500; }
h1 { font-size: 24px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 18px; }
.card-title { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.card-title .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; font-size: 18px; }
.card-title h2 { margin: 0; color: var(--brand); font-size: 20px; }
.card-title small { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .sidebar { display: none; } main { padding: 16px; } }
label.lbl { display: block; font-weight: 600; margin: 0 0 8px; }
label.lbl em { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.field, input[type=text], input[type=number], input[type=url], textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--field); border-radius: 10px; padding: 12px 14px; font: inherit; color: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand-line); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 110px; resize: vertical; }
.section { margin-top: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; }
.x { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; color: var(--muted); flex-shrink: 0; }
.x:hover { color: var(--err); border-color: var(--err); }
.dashed { width: 100%; border: 1.5px dashed var(--brand-line); background: #faf9ff; color: var(--brand); border-radius: 10px; padding: 11px; font-weight: 600; cursor: pointer; margin-top: 10px; font: inherit; font-weight: 600; }
.vars { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.vars b { font-size: 12px; margin-right: 4px; }
.var { border: 1px solid var(--line); background: var(--field); border-radius: 999px; padding: 6px 12px; font-size: 12px; color: #555; cursor: pointer; }
.var:hover { border-color: var(--brand); color: var(--brand); }
.hint { color: var(--muted); font-size: 12px; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; display: inline-block; margin-top: 10px; }
.tpl-item { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.tpl-item input { background: var(--brand-soft); border-color: transparent; }
.toggle-row { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.toggle-row.on { border-color: var(--brand-line); background: #fbfaff; }
.toggle-row .ico { width: 34px; height: 34px; border-radius: 8px; background: var(--field); display: grid; place-items: center; }
.toggle-row .t { flex: 1; }
.toggle-row .t b { display: block; }
.toggle-row .t small { color: var(--muted); }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ccc; border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span:before { transform: translateX(18px); }
.fu { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; background: #fff; }
.fu-h { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 12px; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; }
.fu .row input { width: 80px; }
.fu .row select { width: 120px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; color: #333; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--brand-line); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-d); }
.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.footer-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.footer-bar > div { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat small { color: var(--muted); display: block; }
.stat b { font-size: 24px; }
.stat .bar { height: 5px; background: var(--field); border-radius: 9px; margin-top: 8px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--brand); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; background: #fafafc; position: sticky; top: 0; }
tr.click:hover td { background: #faf9ff; cursor: pointer; }
.table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: auto; max-height: 70vh; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--field); color: #555; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.muted { color: var(--muted); }
.trunc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.auto-card .info { flex: 1; min-width: 240px; }
.auto-card h3 { margin: 0 0 4px; font-size: 16px; }
.auto-card .mini { display: flex; gap: 18px; flex-wrap: wrap; }
.auto-card .mini div { text-align: center; }
.auto-card .mini b { display: block; font-size: 18px; }
.auto-card .mini small { color: var(--muted); font-size: 11px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { width: auto; min-width: 180px; padding: 9px 12px; }
.banner { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.warn { background: var(--warn-soft); border: 1px solid #f3d48f; }
.banner.ok { background: var(--ok-soft); border: 1px solid #b8e6c6; }
#toast { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 99; }
#toast div { background: #1d1d27; color: #fff; padding: 11px 16px; border-radius: 10px; max-width: 420px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
#toast div.err { background: var(--err); }
.modal { position: fixed; inset: 0; background: rgba(20,20,35,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 16px; padding: 22px; width: min(640px, 100%); max-height: 85vh; overflow: auto; }
.modal-box h3 { margin-top: 0; }
.timeline { border-left: 2px solid var(--brand-soft); margin-left: 6px; padding-left: 16px; }
.timeline div { margin-bottom: 12px; }
.timeline small { color: var(--muted); }
.timeline p { margin: 2px 0 0; white-space: pre-wrap; background: var(--field); padding: 8px 10px; border-radius: 8px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.settings-grid small { color: var(--muted); display: block; margin-top: 4px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* ---------- Unibox ---------- */
.ubx-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ubx-filters select, .ubx-filters input[type=text] { width: auto; flex: 1; min-width: 160px; padding: 9px 12px; }
.ubx-check { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-weight: 600; font-size: 13px; }
.ubx { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 14px; height: calc(100vh - 230px); min-height: 480px; }
.ubx-list, .ubx-thread { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow-y: auto; min-width: 0; }
.ubx-thread { display: flex; flex-direction: column; padding: 16px 18px; }
.ubx-item { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ubx-item:hover { background: var(--field); }
.ubx-item.on { background: var(--brand-soft); }
.ubx-item.unread .ubx-top b, .ubx-item.unread .ubx-snip { font-weight: 700; color: var(--text); }
.ubx-item.unread .ubx-av { box-shadow: 0 0 0 2px var(--brand); }
.ubx-av { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.ubx-av img { width: 100%; height: 100%; object-fit: cover; }
.ubx-av.big { width: 48px; height: 48px; font-size: 16px; }
.ubx-main { flex: 1; min-width: 0; }
.ubx-top { display: flex; justify-content: space-between; gap: 8px; }
.ubx-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ubx-snip { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ubx-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.ubx-tags .pill { font-size: 11px; padding: 1px 7px; }
.ubx-head { display: flex; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.ubx-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.ubx-bar select { width: auto; padding: 6px 10px; }
.ubx-msgs { flex: 1; overflow-y: auto; padding: 6px 2px; min-height: 120px; }
.ubx-day { text-align: center; color: var(--muted); font-size: 11px; margin: 10px 0 6px; }
.ubx-msg { display: flex; flex-direction: column; align-items: flex-start; margin: 4px 0; }
.ubx-msg.me { align-items: flex-end; }
.ubx-bub { max-width: 78%; background: var(--field); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; white-space: normal; overflow-wrap: anywhere; }
.ubx-msg.me .ubx-bub { background: var(--brand-soft); border-color: var(--brand-line); border-radius: 14px 14px 4px 14px; }
.ubx-compose { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.ubx-compose textarea { min-height: 90px; margin: 6px 0; }
@media (max-width: 900px) { .ubx { grid-template-columns: 1fr; height: auto; } .ubx-list { max-height: 45vh; } }

.ubx-icp{border:1px solid var(--line,#e5e7eb);border-radius:10px;padding:8px 10px;margin:0 0 8px;font-size:13px}
.ubx-facts{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:6px}
.ubx-facts span{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.ubx-opts{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:4px 0 6px}
.ubx-opts #uWhy{flex-basis:100%}
.ubx-playpick{display:flex;flex-wrap:wrap;gap:6px 18px}
.ubx-playpick label{white-space:nowrap;cursor:pointer}
.ubx-icp .row select,.ubx-icp .row .btn{width:auto;flex:0 0 auto;max-width:230px}

/* ---------- Unibox v2: full screen, calm, keyboard-first ---------- */
body.ubx-full .sidebar, body.ubx-full #acctabs { display: none; }
body.ubx-full main { padding: 0; max-width: none; }
body.ubx-full { background: #fff; }
.kx { --ink: #18181f; --sub: #6e6e7c; --faint: #a3a3b0; --hair: #ececf1; --hov: #f6f6f8; --sel: #f1f0fe;
  display: grid; grid-template-columns: 236px 1fr; height: 100vh; font: 13.5px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: #fff; }
.kx-i { flex-shrink: 0; display: block; }
.kx-rail { background: #fafafb; border-right: 1px solid var(--hair); padding: 10px 8px 10px; display: flex; flex-direction: column; overflow-y: auto; }
.kx-brand { display: flex; align-items: center; gap: 6px; padding: 2px 4px 10px; font-size: 14px; }
.kx-accs { display: flex; flex-direction: column; gap: 1px; padding-bottom: 4px; }
.kx-accrow { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 7px; color: var(--sub); font-size: 12.5px; }
.kx-accrow:hover { background: #f0f0f3; color: var(--ink); }
.kx-accrow.on { color: var(--ink); font-weight: 600; background: #efeff3; }
.kx-accrow small { color: var(--faint); }
.kx-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex-shrink: 0; }
.kx-dot2 { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #c4c4cf; margin: 0 5px 0 4px; flex-shrink: 0; }
.kx-dot2.hot { background: #ef4444; } .kx-dot2.inv { background: #6d5df5; } .kx-dot2.warm { background: #f59e0b; }
.kx-sec { font-size: 10.5px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; padding: 14px 10px 4px; display: flex; align-items: center; gap: 4px; }
.kx-toggle { cursor: pointer; } .kx-toggle:hover { color: var(--sub); }
.kx-split { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 7px; color: #3d3d48; }
.kx-split .kx-i { color: #8d8d9a; }
.kx-split:hover { background: #f0f0f3; }
.kx-split.on { background: #ebeaf9; color: #3f33d0; font-weight: 600; }
.kx-split.on .kx-i { color: #5b4ef0; }
.kx-nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-n { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.kx-split.hasdue .kx-n { color: #c2410c; font-weight: 600; }
.kx-over { color: #dc2626; font-weight: 700; font-size: 11px; animation: kxPulse 1.6s ease-in-out infinite; }
.kx-split.overdue .kx-i { color: #dc2626; }
@keyframes kxPulse { 50% { opacity: .45; } }
.kx-foot { margin-top: auto; display: flex; gap: 2px; padding: 10px 4px 0; border-top: 1px solid var(--hair); }
.kx-foot a { color: var(--faint); padding: 6px; border-radius: 6px; } .kx-foot a:hover { color: var(--ink); background: #f0f0f3; }
.kx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.kx-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px 8px; }
.kx-top h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 8px; }
.kx-top h2 span { color: var(--faint); font-weight: 500; font-size: 13px; }
.kx-tools { display: flex; gap: 6px; align-items: center; }
.kx-search { display: flex; align-items: center; gap: 6px; background: #f4f4f6; border-radius: 8px; padding: 0 8px; color: var(--faint); }
.kx-search input { border: 0; background: transparent; padding: 7px 0; width: 200px; font-size: 13px; outline: none; box-shadow: none; }
.kx-ghost { background: none; border: 0; padding: 6px; border-radius: 7px; cursor: pointer; color: #6e6e7c; display: inline-flex; align-items: center; font-size: 12px; }
.kx-ghost:hover:not(:disabled) { background: #f1f1f4; color: var(--ink); }
.kx-ghost:disabled { opacity: .3; cursor: default; }
.kx-ghost.is-on { color: #b45309; } .kx-ghost.is-over { color: #dc2626; animation: kxPulse 1.6s infinite; }
.kx-list { flex: 1; overflow-y: auto; padding-bottom: 40px; }
.kx-grp { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 14px 24px 4px; }
.kx-grp.over { color: #dc2626; }
.kx-row { display: grid; grid-template-columns: 28px minmax(140px, 230px) 1fr auto; align-items: center; gap: 14px; padding: 0 24px; height: 40px; cursor: pointer; position: relative; }
.kx-row:hover { background: var(--hov); }
.kx-row.cur { background: var(--sel); }
.kx-row.cur::after { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: #5b4ef0; }
.kx-row.overdue { background: #fff5f5; } .kx-row.overdue.cur { background: #ffecec; }
.kx-av { width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--c, #5b4ef0) 14%, #fff); color: var(--c, #5b4ef0); display: grid; place-items: center; font-size: 10px; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.kx-av img { width: 100%; height: 100%; object-fit: cover; }
.kx-av.md { width: 34px; height: 34px; font-size: 12px; }
.kx-av.due { background: #f4f4f6; color: #6e6e7c; } .kx-av.due.k-reply { background: #eef2ff; color: #4f46e5; } .kx-av.due.k-reminder { background: #fef2f2; color: #dc2626; } .kx-av.due.k-booking { background: #fff7ed; color: #c2410c; }
.kx-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kx-who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-row.unread .kx-who b { font-weight: 700; }
.kx-row.unread::before { content: ''; position: absolute; left: 11px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: #5b4ef0; }
.kx-acc { font-size: 10.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.kx-what { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--sub); }
.kx-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-row.unread .kx-txt { color: var(--ink); }
.kx-you { color: var(--faint); }
.kx-when { font-size: 12px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kx-acts { display: none; gap: 2px; position: absolute; right: 16px; top: 6px; background: inherit; padding-left: 10px; }
.kx-acts button { background: none; border: 0; cursor: pointer; padding: 5px; border-radius: 6px; color: #6e6e7c; display: grid; place-items: center; }
.kx-acts button:hover { background: #e8e7f6; color: var(--ink); }
.kx-row:hover .kx-acts, .kx-row.cur .kx-acts { display: flex; }
.kx-row:hover .kx-when, .kx-row.cur .kx-when { visibility: hidden; }
.kx-lbl { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; white-space: nowrap; background: #f1f1f4; color: #6e6e7c; }
.kx-lbl.hot { background: #fee2e2; color: #b91c1c; } .kx-lbl.inv { background: #ebeaf9; color: #4f46e5; } .kx-lbl.warm { background: #fef3c7; color: #92400e; } .kx-lbl.draft { background: #dcfce7; color: #15803d; }
.kx-rem { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--sub); white-space: nowrap; }
.kx-rem.today { color: #b45309; font-weight: 600; }
.kx-rem.over { color: #fff; background: #dc2626; border-radius: 5px; padding: 1px 7px; font-weight: 600; animation: kxPulse 1.6s ease-in-out infinite; }
.kx-empty { text-align: center; color: var(--faint); padding: 80px 20px; }
/* menus */
.kx-pal-bg { position: fixed; inset: 0; background: rgba(24, 24, 31, .22); display: flex; justify-content: center; align-items: flex-start; padding-top: 16vh; z-index: 100; }
.kx-pal { width: 460px; max-width: 92vw; background: #fff; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.04); overflow: hidden; font: 13.5px Inter, -apple-system, sans-serif; }
.kx-pal input { width: 100%; border: 0; border-bottom: 1px solid #ececf1; border-radius: 0; padding: 14px 16px; font-size: 14px; outline: none; background: #fff; box-shadow: none; }
.kx-pal-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.kx-pal-sec { font-size: 11px; color: #a3a3b0; padding: 8px 10px 3px; }
.kx-pal-it { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.kx-pal-it span { flex: 1; display: flex; align-items: center; }
.kx-pal-it small { color: #a3a3b0; font-size: 12px; }
.kx-pal-it.on { background: #f1f0fe; }
.kx-pal-none { padding: 14px; color: #a3a3b0; }
.kx kbd, .kx-pal kbd { font: 10.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: #f4f4f6; border: 1px solid #e6e6ec; border-radius: 4px; padding: 0 5px; color: #6e6e7c; }
/* chat */
.kx-chat { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
.kx-chat-top { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--hair); }
.kx-sep { width: 1px; height: 20px; background: var(--hair); margin: 0 6px; }
.kx-person { min-width: 0; margin-left: 4px; }
.kx-pname { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.kx-phead { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 460px; }
.kx-grow { flex: 1; }
.kx-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap; }
.kx-btn:hover { background: #f7f7f9; }
.kx-btn.li { color: #0a66c2; }
.kx-chat-top .kx-acc { font-size: 11.5px; padding: 3px 8px; }
.kx-banner { display: flex; align-items: center; gap: 8px; padding: 7px 20px; font-size: 12.5px; background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a; }
.kx-banner.over { background: #fef2f2; color: #b91c1c; border-color: #fecaca; font-weight: 600; }
.kx-chat-body { flex: 1; display: grid; grid-template-columns: 1fr 290px; min-height: 0; }
.kx-chat.noinfo .kx-chat-body { grid-template-columns: 1fr; }
.kx-chat.noinfo .kx-info { display: none; }
.kx-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.kx-msgs { flex: 1; overflow-y: auto; padding: 18px 0 8px; }
.kx-msgs > * { max-width: 740px; margin-left: auto; margin-right: auto; padding: 0 28px; }
.kx-day { text-align: center; font-size: 11px; color: var(--faint); margin: 18px auto 4px; }
.kx-msg { display: flex; flex-direction: column; align-items: flex-start; margin-top: 3px; }
.kx-msg.first { margin-top: 14px; }
.kx-msg.me { align-items: flex-end; }
.kx-from { font-size: 11.5px; font-weight: 600; color: #4a4a56; margin: 0 2px 4px; }
.kx-from span { color: var(--faint); font-weight: 400; margin-left: 4px; }
.kx-bub { max-width: 78%; background: #f3f3f6; border-radius: 14px; padding: 8px 13px; font-size: 13.5px; overflow-wrap: anywhere; }
.kx-msg.me .kx-bub { background: color-mix(in srgb, var(--c, #5b4ef0) 9%, #fff); }
.kx-pending { max-width: 740px; margin: 0 auto 6px; padding: 0 28px; font-size: 12px; color: #b45309; }
.kx-link { background: none; border: 0; padding: 0; color: #5b4ef0; cursor: pointer; font-size: 12.5px; text-align: left; display: inline-flex; align-items: center; gap: 6px; }
.kx-compose { max-width: 740px; width: calc(100% - 56px); margin: 6px auto 18px; border: 1px solid #e4e4ea; border-radius: 14px; padding: 10px 12px 8px; box-shadow: 0 4px 18px rgba(24,24,31,.05); background: #fff; }
.kx-compose:focus-within { border-color: #c9c3fa; }
.kx-sugg { border-bottom: 1px solid #f0f0f3; padding-bottom: 10px; margin-bottom: 6px; }
.kx-sugg-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #5b4ef0; margin-bottom: 6px; }
.kx-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.kx-card { text-align: left; border: 1px solid #ebeaf3; background: #fbfbfe; border-radius: 10px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit; }
.kx-card:hover { border-color: #c9c3fa; background: #f6f5ff; }
.kx-card.on { border-color: #5b4ef0; background: #f1f0fe; }
.kx-card-h { font-size: 11px; font-weight: 600; color: #5b4ef0; }
.kx-card-t { font-size: 12.5px; color: #3d3d48; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.kx-shimmer { height: 12px; border-radius: 6px; margin: 6px 0; background: linear-gradient(90deg, #f1f1f4, #e7e6f8, #f1f1f4); background-size: 200% 100%; animation: kxShim 1.2s linear infinite; }
.kx-shimmer.short { width: 60%; }
@keyframes kxShim { to { background-position: -200% 0; } }
.kx-note-in { font-size: 12px; color: #b45309; margin-top: 6px; }
.kx-mut { color: var(--faint); font-size: 12px; font-weight: 400; }
.kx-compose textarea { border: 0; padding: 4px 2px; min-height: 70px; resize: vertical; font: 13.5px/1.5 inherit; background: transparent; box-shadow: none; outline: none; width: 100%; color: var(--ink); }
.kx-cbar { display: flex; align-items: center; gap: 8px; }
.kx-cbar input[type=text], .kx-cbar #kxInstr { flex: 1; border: 0; background: #f4f4f6; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; min-width: 0; outline: none; box-shadow: none; }
.kx-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--sub); font-weight: 400; white-space: nowrap; }
.kx-mini input { width: auto; margin: 0; }
.kx-send { background: #18181f; color: #fff; border: 0; border-radius: 9px; padding: 7px 12px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; font-size: 13px; }
.kx-send:hover { background: #000; }
.kx-send kbd { background: #34343e; border-color: #44444f; color: #d4d4dc; }
.kx-send:disabled { opacity: .35; cursor: default; }
.kx-fine { color: var(--faint); font-size: 11.5px; margin-top: 6px; }
.kx-info { border-left: 1px solid var(--hair); padding: 18px; overflow-y: auto; font-size: 12.5px; background: #fcfcfd; }
.kx-info dl { display: grid; grid-template-columns: 86px 1fr; gap: 9px 10px; margin: 0; }
.kx-info dt { color: var(--faint); }
.kx-info dd { margin: 0; overflow-wrap: anywhere; }
.kx-info select { width: 100%; padding: 3px 6px; font-size: 12px; }
.kx-q { margin-top: 16px; display: flex; flex-direction: column; gap: 3px; }
.kx-why { margin-top: 14px; }
.kx-info-acts { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1100px) { .kx-chat-top .kx-acc, .kx-phead { display: none; } }
@media (max-width: 900px) { .kx { grid-template-columns: 1fr; } .kx-rail { display: none; } .kx-row { grid-template-columns: 26px 120px 1fr auto; padding: 0 14px; } .kx-chat-body { grid-template-columns: 1fr; } .kx-info { display: none; } }
.kx-sub { font-size: 12px; font-weight: 400; color: var(--faint); margin-left: 4px; letter-spacing: 0; }

/* ---- Posts ---- */
.pst textarea { width: 100%; font: inherit; line-height: 1.5; resize: vertical; }
.pst-drop { border: 1.5px dashed var(--border, #cbd5e1); border-radius: 10px; padding: 18px; text-align: center; margin-top: 8px; }
.pst-drop.on { background: rgba(59,130,246,.08); border-color: #3b82f6; }
.pst-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pst-th { width: 150px; }
.pst-th img { width: 150px; height: 150px; object-fit: cover; border-radius: 8px; display: block; }
.pst-th input { width: 100%; margin-top: 4px; font-size: 12px; }
.pst-tb { display: flex; gap: 4px; margin-top: 4px; }
.pst-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border, #e5e7eb); }
.pst-row:last-child { border-bottom: 0; }

/* likely-to-buy score chip */
.kx-score { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 18px; padding: 0 5px; margin-right: 6px; border-radius: 9px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.kx-score.hot { background: #fee2e2; color: #b91c1c; }
.kx-score.warm { background: #fef3c7; color: #92400e; }
.kx-score.cold { background: #f1f1f4; color: #6b6b7b; }
.kx-lbl.flag { background: #f1f1f4; color: #6b6b7b; }
.kx-quote { font-size: 12px; opacity: .65; border-left: 2px solid currentColor; padding: 1px 0 1px 7px; margin: 0 0 5px; }

/* Unibox table view */
.kx-tabs { display: flex; gap: 4px; }
.kx-tab { padding: 6px 12px; border-radius: 8px; color: #6b6b7b; font-weight: 600; font-size: 13px; text-decoration: none; }
.kx-tab span { margin-left: 6px; font-weight: 500; color: #9a9aab; }
.kx-tab.on { background: #f1f1f4; color: #1d1d27; }
.kx-tbl-wrap { display: grid; grid-template-columns: 1fr 0; height: calc(100vh - 64px); }
.kx-tbl-wrap.withpanel { grid-template-columns: minmax(0, 1fr) minmax(420px, 46%); }
.kx-tbl-scroll { overflow: auto; }
.kx-panel { overflow: auto; border-left: 1px solid #ececf1; }
.kx-tbl-wrap:not(.withpanel) .kx-panel { display: none; }
.kx-tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.kx-tbl th { position: sticky; top: 0; background: #fafafb; text-align: left; font-weight: 600; font-size: 11.5px; color: #6b6b7b; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid #ececf1; cursor: default; white-space: nowrap; }
.kx-tbl th[data-k] { cursor: pointer; } .kx-tbl th.on { color: #1d1d27; }
.kx-tbl td { padding: 8px 10px; border-bottom: 1px solid #f3f3f6; vertical-align: top; overflow: hidden; text-overflow: ellipsis; }
.kx-tbl th:nth-child(1) { width: 62px; } .kx-tbl th:nth-child(2) { width: 22%; } .kx-tbl th:nth-child(3) { width: 26%; } .kx-tbl th:nth-child(5) { width: 104px; } .kx-tbl th:nth-child(6) { width: 96px; }
.kx-tbl td.pp b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kx-tbl td.pp small { display: block; color: #9a9aab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kx-tbl td.why { color: #3a3a48; }
.kx-tbl td.last { color: #6b6b7b; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kx-tbl td.turn { white-space: nowrap; color: #6b6b7b; } .kx-tbl td.turn.us { color: #b91c1c; font-weight: 600; }
.kx-tr { cursor: pointer; } .kx-tr:hover td { background: #fafafb; } .kx-tr.cur td { background: #f3f1ff; }
.kx-dim { color: #c4c4cf; }
.kx-panel .kx-chat { height: 100%; }

.kx-side { display: flex; flex-direction: column; gap: 6px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--hair); }
.kx-side-h { color: var(--faint); font-size: 11.5px; }
.kx-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; }
.kx-seg button { border: 0; background: #fff; padding: 7px 6px; font-size: 12.5px; cursor: pointer; color: inherit; }
.kx-seg button + button { border-left: 1px solid var(--hair); }
.kx-seg button.on { background: #efeafd; color: #5b3fd1; font-weight: 600; cursor: default; }
.kx-sbtn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--hair); background: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; color: inherit; }
.kx-sbtn:hover { background: #f6f6f8; }
.kx-sbtn kbd { margin-left: auto; }

.kx-lblpick { display: flex; flex-wrap: wrap; gap: 5px; }
.kx-lblpick button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--hair); background: #fff; border-radius: 999px; padding: 4px 9px; font-size: 12px; cursor: pointer; color: inherit; }
.kx-lblpick button:hover { background: #f6f6f8; }
.kx-lblpick button.on { background: #efeafd; border-color: #c9bdf5; color: #5b3fd1; font-weight: 600; cursor: default; }
.kx-lblpick button.clear { color: var(--faint); }

.kx-lbl.replied { background: #e6f6ec; color: #17803d; margin-left: 6px; }
.kx-banner.kx-replied { background: #eefaf2; border-color: #bfe8cd; color: #14532d; }

/* Calendly + Close flags */
.kx-lbl.cal { background: #dcfce7; color: #15803d; } .kx-lbl.caldone { background: #e0f2fe; color: #0369a1; } .kx-lbl.calx { background: #f1f1f4; color: #8b8b98; text-decoration: line-through; }
.kx-lbl.crm { background: #ede9fe; color: #6d28d9; }
.kx-banner.kx-cal { background: #f0f9ff; color: #075985; border-color: #bae6fd; } .kx-banner.kx-cal.up { background: #f0fdf4; color: #166534; border-color: #bbf7d0; } .kx-banner.kx-cal.x { background: #f8f8fa; color: #6b6b7b; border-color: #e5e5ea; }
.kx-banner.kx-crm { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }

/* login roles (hosted version): "Unibox only" sees just the inbox; Logins page only for admins */
nav a.admin-only { display: none; }
body.login-admin nav a.admin-only { display: block; }
body.role-unibox nav a:not([data-nav="unibox"]), body.role-unibox a[href="#/unibox-setup"] { display: none; }

/* Unibox paused banner (rail) */
.kx-paused { margin: 0 8px 10px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.kx-paused span { color: #7a5a10; }
.kx-paused .kx-btn { align-self: flex-start; }

/* per-inbox pause */
.kx-accrow .kx-pz { margin-left: auto; opacity: 0; font-size: 11px; padding: 0 4px; border-radius: 4px; color: var(--sub); }
.kx-accrow:hover .kx-pz, .kx-accrow.pz .kx-pz { opacity: 1; }
.kx-accrow .kx-pz:hover { background: #e4e4ea; color: var(--ink); }
.kx-accrow.pz { color: var(--faint); }
.kx-pzall { display: block; margin: 0 8px 8px; padding: 3px 10px; font-size: 11.5px; color: var(--faint); }
.kx-pzall:hover { color: var(--ink); }
.lg-accs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.lg-accs label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; }
.lg-accs input { width: auto; margin: 0; }

/* Unibox assistant side panel */
.kx-ask { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; border-left: 1px solid #ececf1; box-shadow: -12px 0 32px rgba(20,20,40,.08); z-index: 60; display: flex; flex-direction: column; font-size: 13.5px; color: #18181f; }
.kx-ask-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #ececf1; }
.kx-ask-tabs { display: flex; gap: 4px; margin-left: 6px; flex: 1; }
.kx-ask-tabs a { padding: 3px 9px; border-radius: 6px; color: #6e6e7c; font-size: 12.5px; }
.kx-ask-tabs a.on { background: #f1f0fe; color: #4b3fd6; font-weight: 600; }
.kx-ask-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kx-ask-ctx { padding: 10px 14px 0; color: #6e6e7c; font-size: 12.5px; }
.kx-ask-ctx a { margin-left: 6px; }
.kx-ask-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.kx-ask-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.kx-ask-q { align-self: flex-end; max-width: 85%; background: #f1f0fe; padding: 7px 11px; border-radius: 10px 10px 2px 10px; white-space: pre-wrap; }
.kx-ask-a { background: #fafafb; border: 1px solid #ececf1; padding: 10px 12px; border-radius: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.kx-ask-a.busy { color: #a3a3b0; font-style: italic; }
.kx-ask-meta { margin-top: 8px; font-size: 11.5px; color: #a3a3b0; text-align: right; }
.kx-ask-empty { color: #6e6e7c; padding: 18px 4px; line-height: 1.5; }
.kx-ask-in { border-top: 1px solid #ececf1; padding: 10px 14px 12px; }
.kx-ask-in textarea { width: 100%; resize: vertical; min-height: 64px; font: inherit; }
.kx-ask-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.kx-ask-pad { padding: 12px 14px; overflow-y: auto; }
.kx-facts { width: 100%; min-height: 52vh; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.kx-tune { border: 1px solid #ececf1; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.kx-tune h4 { margin: 0 0 6px; } .kx-tune h5 { margin: 12px 0 4px; } .kx-tune ul { margin: 0; padding-left: 18px; }
.kx-tune pre { white-space: pre-wrap; font-size: 12px; background: #fafafb; padding: 8px; border-radius: 6px; max-height: 260px; overflow: auto; }
.kx-tune details { margin-top: 8px; }
.kx-askrail { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 7px; color: #4b3fd6; font-weight: 600; margin-top: 4px; }
.kx-askrail:hover { background: #f1f0fe; }
.kx-askrail .kx-n { margin-left: auto; color: #a3a3b0; font-weight: 400; font-size: 11px; }
.kx-ask .kx-btn.primary, .kx-ask-row .primary { background: #4b3fd6; border-color: #4b3fd6; color: #fff; }
.kx-ask .kx-btn:disabled { opacity: .5; cursor: default; }
