/* The owner console, in the app's look: rail, list, pane. White and black, hairlines, soft pills. */
:root {
  --bg: #fff; --rail: #F6F6F5; --hover: #EFEFEE; --sel: #E9E9E7; --ink: #0A0A0C; --ink-2: #55555A; --ink-3: #8A8A90;
  --line: rgba(0, 0, 0, .1); --line-2: rgba(0, 0, 0, .06); --accent: #E9FB52;
  --green: #12813F; --green-bg: #E3F5E9; --amber: #9A5B00; --amber-bg: #FFF1D6; --red: #C0271F; --red-bg: #FDE9E7; --blue: #1F6FEB; --blue-bg: #E8F0FE; --mute-bg: #EFEFEE;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; font-weight: 500; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
a { color: inherit; text-decoration: none; }
b { font-weight: 550; }
small { font-size: 12.5px; color: var(--ink-3); }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: #D6D6D4 transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 12px; border-radius: 6px; font-weight: 500; white-space: nowrap; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.btn:hover { background: var(--hover); }
.btn-dark { background: var(--ink); color: #fff; box-shadow: none; } .btn-dark:hover { background: #2a2a2e; }
.btn-red { color: var(--red); } .btn-red.armed { background: var(--red); color: #fff; box-shadow: none; }
.input { height: 32px; padding: 0 10px; border-radius: 6px; border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); outline: none; }
.input:focus { box-shadow: inset 0 0 0 1px var(--ink); }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.ok { background: var(--green-bg); color: var(--green); } .warn { background: var(--amber-bg); color: var(--amber); } .bad { background: var(--red-bg); color: var(--red); }
.info { background: var(--blue-bg); color: var(--blue); } .mute { background: var(--mute-bg); color: var(--ink-2); }

/* sign-in */
.lock { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.lock-card { width: min(320px, 100%); display: grid; gap: 12px; }
.lock-card h1 { font: 600 28px/1.1 'Hanken Grotesk', 'Inter', sans-serif; letter-spacing: -.03em; margin-bottom: 8px; }
.lock-card .btn { height: 40px; } .lock-card form { display: grid; gap: 8px; }
.lock-card summary { cursor: pointer; color: var(--ink-3); font-size: 13px; list-style: none; text-align: center; }
.err { color: var(--red); font-size: 13px; }

/* frame */
.app { display: grid; grid-template-columns: 210px minmax(0, 1fr); height: 100%; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; background: var(--rail); border-right: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; padding: 2px 8px 18px; font: 650 17px/1 'Hanken Grotesk', 'Inter', sans-serif; letter-spacing: -.03em; }
.logo i { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); display: grid; place-items: center; }
.logo i::after { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.nav { display: flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 6px; color: var(--ink-2); }
.nav:hover { background: var(--hover); } .nav.on { background: var(--sel); color: var(--ink); font-weight: 500; }
.nav span { flex: 1; } .nav i { font-style: normal; font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--ink); } .nav i:empty { display: none; }
.side-end { margin-top: auto; padding: 0 10px; } .side-end a { color: var(--ink-3); font-size: 13px; } .side-end a:hover { color: var(--ink); }
main { min-width: 0; height: 100%; overflow: auto; }

.page { max-width: 860px; margin: 0 auto; padding: 32px 28px 60px; display: grid; gap: 28px; align-content: start; }
.title { font: 600 26px/1.1 'Hanken Grotesk', 'Inter', sans-serif; letter-spacing: -.03em; }
h2 { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); background: var(--rail); overflow: hidden; }
.kpi { padding: 16px 18px; display: grid; gap: 2px; } .kpi + .kpi { border-left: 1px solid var(--line); }
.kpi b { font: 600 30px/1.1 'Hanken Grotesk', 'Inter', sans-serif; letter-spacing: -.03em; }

.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; margin: 0 -10px; border-radius: 8px; min-width: 0; }
a.row:hover, button.row:hover { background: var(--hover); } .row.on { background: var(--sel); }
.row > div { flex: 1; min-width: 0; display: grid; } .row > div > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { flex: none; display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 13px; }
.none { padding: 18px 0; color: var(--ink-3); }

/* agencies: list + pane */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100%; }
.list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.list-top { padding: 22px 18px 10px; display: grid; gap: 12px; }
.list-top .input { width: 100%; background: var(--mute-bg); box-shadow: none; } .list-top .input:focus { background: var(--bg); box-shadow: inset 0 0 0 1px var(--ink); }
.tabs { display: flex; gap: 6px; }
.tabs button { height: 26px; padding: 0 11px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tabs button.on { background: var(--ink); color: #fff; box-shadow: none; }
.list .rows { overflow: auto; padding: 0 18px 20px; }
.pane { overflow: auto; }
.pane .page { max-width: 640px; gap: 24px; }
.key { font: 500 13px ui-monospace, Consolas, monospace; color: var(--ink-2); } .key:hover { color: var(--ink); text-decoration: underline; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; } .facts div { display: grid; } .facts b { font-weight: 500; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* requests */
.req { display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.req .row { padding: 0; margin: 0; } .req .acts .input { min-width: 150px; }

.veil { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(10, 10, 12, .3); }
.dialog { width: min(380px, 100%); background: var(--bg); border-radius: 12px; padding: 20px; display: grid; gap: 12px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .4); }
.dialog h2 { font-size: 16px; color: var(--ink); margin: 0; } .dialog .acts { justify-content: flex-end; }
.bigkey { font: 600 20px ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.toasts { position: fixed; z-index: 60; bottom: 20px; left: 0; right: 0; display: grid; justify-items: center; pointer-events: none; }
.toast { padding: 9px 13px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 500; } .toast.bad { background: var(--red); }

@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { flex-direction: row; align-items: center; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .logo { padding: 0 8px; } .side-end { display: none; }
  .page { padding: 20px 16px 48px; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  #back { display: inline !important; } .split { grid-template-columns: minmax(0, 1fr); } .split.open .list { display: none; } .split:not(.open) .pane { display: none; }
}

/* chats: a support inbox. The visitor on the left, the team (assistant and you) on the right */
.crows { padding: 0 10px 20px !important; }
.crow { display: flex; gap: 11px; align-items: center; padding: 10px 10px; border-radius: 8px; min-width: 0; }
.crow:hover { background: var(--hover); } .crow.on { background: var(--sel); }
.av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--mute-bg); color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.av.lg { width: 40px; height: 40px; font-size: 15px; background: var(--ink); color: var(--accent); }
.crow-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.crow-top, .crow-bot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crow-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.crow-top small { flex: none; font-size: 12px; }
.crow-bot span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 13px; }
.crow.new .crow-top b { font-weight: 650; } .crow.new .crow-bot span { color: var(--ink); }
.crow.new .av::after { content: ''; position: absolute; } .crow.new .av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.tdot { flex: none; width: 8px; height: 8px; border-radius: 50%; } .tdot.ok { background: var(--green); } .tdot.warn { background: #E3A008; } .tdot.bad { background: var(--red); }
.pane:has(.conv) { overflow: hidden; height: 100%; }
.conv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.conv-empty { height: 100%; display: grid; place-items: center; color: var(--ink-3); }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.conv-who { flex: 1; min-width: 0; display: grid; } .conv-who b { font: 600 16px/1.25 'Hanken Grotesk', 'Inter', sans-serif; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-ticket { display: flex; align-items: flex-start; gap: 10px; margin: 14px 24px 0; padding: 10px 12px; border-radius: 8px; background: var(--rail); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13.5px; color: var(--ink-2); }
.conv-ticket .pill { flex: none; }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 3px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(560px, 78%); }
.msg.tail { margin-bottom: 12px; }
.msg.ai, .msg.owner { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--rail); box-shadow: inset 0 0 0 1px var(--line-2); }
.msg.user .bubble { border-bottom-left-radius: 5px; }
.msg.ai .bubble { background: #EEF0EA; box-shadow: none; border-bottom-right-radius: 5px; }
.msg.owner .bubble { background: var(--ink); color: #fff; box-shadow: none; border-bottom-right-radius: 5px; }
.msg small { margin: 4px 4px 0; font-size: 11.5px; }
.composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 24px 20px; padding: 8px 8px 8px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); }
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--ink); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; font: inherit; padding: 6px 0; max-height: 160px; field-sizing: content; background: none; }
