/* Kall AI — Kall in 1. Kall design: paper #F6F5F1, ink #0C0F2E, cobalt #2E44FF, saffron #FFB31A, coral #FF5A4E.
   Kall AI's own color is the violet→cobalt gradient. Fonts are self-hosted (no outside requests). */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --bg: #F6F5F1; --paper: #FFFFFF; --ink: #0C0F2E; --ink2: #3F4363; --mute: #7A7D96; --line: #E6E4DC; --line2: #EFEDE6;
  --cobalt: #2E44FF; --saffron: #FFB31A; --coral: #FF5A4E; --violet: #6A3DF5; --green: #12A26B;
  --grad: linear-gradient(135deg, #C45CFF 0%, #6A3DF5 50%, #2E44FF 100%);
  --tint: #EEF0FF; --vtint: #F3EEFF;
  --r: 16px; --r2: 22px; --sh: 0 1px 2px rgba(12,15,46,.05), 0 6px 24px rgba(12,15,46,.06); --sh2: 0 10px 40px rgba(12,15,46,.16);
  --head: "Bricolage", "Jakarta", system-ui, sans-serif; --body: "Jakarta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --side: 276px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.55 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--cobalt); }
.ic { width: 20px; height: 20px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 650; font-size: 14.5px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; transition: background .15s, transform .1s; text-decoration: none; }
.btn:hover { background: #FBFAF7; } .btn:active { transform: scale(.98); }
.btn.pri { background: var(--ink); color: #fff; border-color: var(--ink); } .btn.pri:hover { background: #1c2050; }
.btn.grad { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(106,61,245,.28); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; } .btn.sm .ic { width: 16px; height: 16px; }
.btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: rgba(12,15,46,.05); }
.btn.danger { color: #C9322A; } .btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink2); }
.iconbtn:hover { background: rgba(12,15,46,.06); color: var(--ink); }
.iconbtn.sm { width: 32px; height: 32px; border-radius: 10px; } .iconbtn.sm .ic { width: 17px; height: 17px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; } .field > span { font-size: 13px; font-weight: 650; color: var(--ink2); }
.field small, .hint { color: var(--mute); font-size: 12.5px; }
.inp, select.inp, textarea.inp { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
.inp:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(46,68,255,.12); }
textarea.inp { resize: vertical; min-height: 84px; line-height: 1.5; }
.sw { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; border-radius: 99px; background: #D5D3CB; transition: background .2s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.sw input:checked + i { background: var(--green); } .sw input:checked + i::after { transform: translateX(18px); }
.sw input:focus-visible + i { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.pill .ic { width: 13px; height: 13px; }
.pill.ok { background: #E3F6EE; color: #0B7A50; } .pill.warn { background: #FFF3DA; color: #8A5A00; } .pill.bad { background: #FFE6E3; color: #B42B22; } .pill.v { background: var(--vtint); color: #5A2FD6; } .pill.blue { background: var(--tint); color: #2236D9; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- brand ---------- */
.orb { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 4px 14px rgba(106,61,245,.3); overflow: hidden; }
.orb .ic { width: 19px; height: 19px; } .orb img { width: 100%; height: 100%; object-fit: cover; }
.orb.lg { width: 64px; height: 64px; border-radius: 22px; } .orb.lg .ic { width: 34px; height: 34px; }
.orb.sm { width: 28px; height: 28px; border-radius: 9px; } .orb.sm .ic { width: 16px; height: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 750 18px/1 var(--head); letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand small { display: block; font: 600 11.5px/1.2 var(--body); color: var(--mute); letter-spacing: 0; margin-top: 3px; }

/* ---------- app shell ---------- */
.app { display: flex; height: 100dvh; overflow: hidden; }
.side { width: var(--side); flex: none; background: #EFEDE6; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; gap: 10px; z-index: 30; }
.side .newchat { justify-content: flex-start; width: 100%; height: 44px; border-radius: 14px; }
.side .search { position: relative; } .side .search .ic { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--mute); }
.side .search input { padding-left: 34px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.7); }
.chats { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.chats h6 { margin: 14px 8px 6px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); font-weight: 700; }
.chatrow { display: flex; align-items: center; gap: 4px; border-radius: 11px; padding: 0 4px 0 10px; height: 38px; cursor: pointer; color: var(--ink2); font-size: 14px; }
.chatrow span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow:hover { background: rgba(12,15,46,.05); } .chatrow.on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--sh); }
.chatrow .iconbtn { opacity: 0; width: 28px; height: 28px; } .chatrow:hover .iconbtn, .chatrow.on .iconbtn { opacity: 1; }
.chats .empty { padding: 18px 10px; color: var(--mute); font-size: 13.5px; }
.sidefoot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 4px; }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); }
.acct:hover { background: rgba(12,15,46,.05); }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--saffron); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; text-transform: uppercase; }
.sidelink { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--ink2); text-decoration: none; font-size: 14px; font-weight: 600; }
.sidelink:hover { background: rgba(12,15,46,.05); color: var(--ink); } .sidelink .ic { width: 18px; height: 18px; }
.scrim { display: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; background: var(--bg); }
.top { height: 56px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid transparent; }
.top.lined { border-bottom-color: var(--line); }
.top .title { flex: 1; min-width: 0; font: 650 15px/1.2 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.top .mob { display: none; }
.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.col { max-width: 780px; margin: 0 auto; padding: 18px 20px 28px; }

/* ---------- landing / empty chat ---------- */
.hello { min-height: calc(100% - 10px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 20px 10px; }
.hello h1 { font: 760 clamp(28px, 4.6vw, 40px)/1.08 var(--head); letter-spacing: -.025em; margin: 18px 0 8px; }
.hello p.tag { color: var(--ink2); margin: 0 0 26px; max-width: 460px; }
.sugs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 640px; }
.sug { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 13px 14px; display: flex; gap: 11px; align-items: flex-start; font-size: 14px; line-height: 1.35; color: var(--ink); transition: border .15s, transform .12s, box-shadow .15s; }
.sug:hover { border-color: #CFCBF7; box-shadow: var(--sh); transform: translateY(-1px); }
.sug .k { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.sug .k .ic { width: 17px; height: 17px; } .sug b { display: block; font-size: 12px; color: var(--mute); font-weight: 650; margin-bottom: 2px; }
.k.coding { background: #E9ECFF; color: #2E44FF; } .k.website { background: #F1E9FF; color: #6A3DF5; } .k.torah { background: #FFF2D6; color: #A86A00; } .k.writing { background: #E3F6EE; color: #0B7A50; } .k.math { background: #FFE9E7; color: #D8362C; } .k.general { background: #EEF0F5; color: #3F4363; } .k.image { background: #E4F4FB; color: #0A7BA8; } .k.long { background: #F4EEE4; color: #7A5A2A; } .k.blocked { background: #FFE6E3; color: #C9322A; } .k.custom { background: #F1F0EA; color: #555; }
.feats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.feats .pill { background: rgba(255,255,255,.7); border: 1px solid var(--line); height: 28px; padding: 0 11px; }

/* ---------- messages ---------- */
.msg { display: flex; gap: 12px; margin: 0 0 22px; animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { justify-content: flex-end; }
.msg.user .bub { background: var(--paper); border: 1px solid var(--line); border-radius: 20px 20px 6px 20px; padding: 10px 15px; max-width: min(82%, 600px); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(12,15,46,.04); }
.msg.user .bub img { display: block; max-width: 220px; max-height: 220px; border-radius: 12px; margin: 2px 0 8px; }
.msg.ai .body { flex: 1; min-width: 0; padding-top: 3px; }
.msg.ai .orb { margin-top: 1px; }
.meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; color: var(--mute); font-weight: 600; flex-wrap: wrap; }
.cat { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 6px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.cat .ic { width: 13px; height: 13px; }
.by { font-size: 12px; color: var(--mute); font-weight: 600; }
.acts { display: flex; gap: 2px; margin-top: 6px; opacity: .85; }
.acts .iconbtn { width: 32px; height: 32px; border-radius: 10px; } .acts .iconbtn .ic { width: 16px; height: 16px; }
.acts .taught { color: var(--green); }
.thinking { display: inline-flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 14px; font-weight: 600; height: 30px; }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); animation: bl 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; background: #4F41F8; } .dots i:nth-child(3) { animation-delay: .3s; background: var(--cobalt); }
@keyframes bl { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.stagecard { display: inline-flex; flex-direction: column; gap: 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--sh); max-width: 420px; }
.stagecard .sc-top { display: flex; align-items: center; gap: 10px; } .stagecard .sc-top b { font-size: 14.5px; font-weight: 700; }
.stagecard .sc-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; font-weight: 650; color: var(--mute); }
.stagecard .sc-steps span { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--line2); }
.stagecard .sc-steps span.now { background: var(--vtint); color: #5A2FD6; } .stagecard .sc-steps span.done { background: #E3F6EE; color: #0B7A50; }
.stagecard .sc-steps .ic { width: 13px; height: 13px; } .stagecard .sc-line { width: 10px; height: 2px; border-radius: 2px; background: var(--line); }
.stagecard small { color: var(--mute); font-size: 12px; }
.switched { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 12.5px; color: #8A5A00; background: #FFF6E2; border-radius: 12px; padding: 7px 10px; max-width: 560px; }
.switched .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.blockcard { display: flex; gap: 12px; align-items: flex-start; background: #FFF4F2; border: 1px solid #FFD6D0; color: #8F231B; border-radius: 16px; padding: 12px 14px; font-weight: 600; max-width: 560px; }
.blockcard .ic { color: var(--coral); margin-top: 1px; }
.blockcard small { display: block; color: #B0544C; font-weight: 500; font-size: 12.5px; margin-top: 2px; }
.limitcard { display: flex; gap: 12px; align-items: flex-start; background: #FFF8E8; border: 1px solid #FFE3A6; color: #6B4700; border-radius: 16px; padding: 12px 14px; font-weight: 600; max-width: 560px; }
.limitcard .ic { color: #D99000; margin-top: 1px; } .limitcard .btn { margin-top: 10px; }
.errcard { background: #FFF; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; color: #B42B22; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; } .md ul, .md ol { margin: 0 0 12px; padding-left: 22px; } .md li { margin: 3px 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--head); letter-spacing: -.01em; line-height: 1.2; margin: 18px 0 8px; }
.md h1 { font-size: 23px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; } .md h4 { font-size: 15.5px; }
.md code { font: 13.5px/1.4 var(--mono); background: #ECEAF6; padding: 1.5px 5px; border-radius: 6px; }
.md blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid #CFC6FA; color: var(--ink2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; } .md th { background: #F1EFE8; }
.md a { color: var(--cobalt); text-underline-offset: 2px; }
.cb { background: #12152F; color: #E7E8F5; border-radius: 14px; margin: 0 0 14px; overflow: hidden; }
.cb header { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; font: 600 12px var(--body); color: #A9ADD0; background: #1A1E3E; }
.cb header button { color: #C8CBEA; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; } .cb header button:hover { background: rgba(255,255,255,.08); }
.cb header .ic { width: 14px; height: 14px; }
.cb pre { margin: 0; padding: 12px 14px 14px; overflow-x: auto; font: 13px/1.6 var(--mono); tab-size: 2; }
.cb code { background: none; padding: 0; font: inherit; color: inherit; }
.t-k { color: #C9A2FF; } .t-s { color: #8FE3B0; } .t-c { color: #7C82A8; font-style: italic; } .t-n { color: #FFC56B; } .t-t { color: #7FB4FF; } .t-a { color: #FFB38A; } .t-f { color: #8BD5FF; }
.cvcard { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 12px 14px; margin: 0 0 14px; max-width: 460px; cursor: pointer; box-shadow: var(--sh); transition: border .15s, transform .12s; text-align: left; width: 100%; }
.cvcard:hover { border-color: #CFC6FA; transform: translateY(-1px); }
.cvcard .ico { width: 42px; height: 42px; border-radius: 13px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.cvcard b { display: block; font-size: 14.5px; } .cvcard small { color: var(--mute); font-size: 12.5px; font-weight: 600; }
.cvcard .go { margin-left: auto; color: var(--violet); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 4px; }
.caret { display: inline-block; width: 8px; height: 17px; background: var(--violet); border-radius: 2px; vertical-align: -3px; animation: cblink 1s steps(2) infinite; margin-left: 2px; }
@keyframes cblink { 50% { opacity: 0; } }

/* ---------- composer ---------- */
.composer { flex: none; padding: 0 16px calc(12px + var(--safe-b)); }
.box { max-width: 780px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--sh); padding: 8px 8px 8px 8px; transition: border .15s, box-shadow .15s; }
.box:focus-within { border-color: #C9C1F8; box-shadow: 0 0 0 4px rgba(106,61,245,.08), var(--sh); }
.box textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; padding: 8px 10px 4px; max-height: 220px; min-height: 28px; line-height: 1.5; display: block; font-size: 16px; }
.boxrow { display: flex; align-items: center; gap: 4px; }
.boxrow .grow { flex: 1; }
.sendbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(106,61,245,.35); transition: transform .1s, opacity .15s; }
.sendbtn:active { transform: scale(.94); } .sendbtn[disabled] { opacity: .35; box-shadow: none; }
.sendbtn.stop { background: var(--ink); box-shadow: none; }
.attach { display: flex; gap: 8px; padding: 6px 8px 2px; flex-wrap: wrap; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(12,15,46,.75); color: #fff; display: grid; place-items: center; }
.thumb button .ic { width: 13px; height: 13px; }
.thumb.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6); }
.fine { max-width: 780px; margin: 7px auto 0; text-align: center; font-size: 12px; color: var(--mute); }
.fine b { color: var(--ink2); font-weight: 650; }
.signin { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 6px 6px 6px 14px; }
.signin span { color: var(--ink2); font-size: 14.5px; font-weight: 600; }

/* ---------- canvas ---------- */
.canvas { width: 0; flex: none; display: flex; flex-direction: column; background: var(--paper); border-left: 1px solid var(--line); overflow: hidden; transition: width .28s ease; }
.app.cv-open .canvas { width: min(54vw, 860px); }
.cvtop { height: 56px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); }
.cvtop .t { flex: 1; min-width: 0; } .cvtop .t b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvtop .t small { color: var(--mute); font-size: 12px; font-weight: 600; }
.seg { display: inline-flex; background: #F0EEE7; border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 11px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.seg button .ic { width: 15px; height: 15px; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(12,15,46,.12); }
.cvbody { flex: 1; position: relative; min-height: 0; background: #F3F2EE; }
.cvbody iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.cvbody .frame-wrap { position: absolute; inset: 0; display: flex; justify-content: center; align-items: stretch; padding: 0; }
.cvbody.phone .frame-wrap { padding: 16px; } .cvbody.phone iframe { position: relative; width: 390px; max-width: 100%; height: 100%; border-radius: 22px; box-shadow: var(--sh2); }
.editor { position: absolute; inset: 0; display: flex; background: #12152F; }
.editor .gutter { padding: 14px 8px 14px 12px; color: #4F557E; font: 13px/1.6 var(--mono); text-align: right; user-select: none; overflow: hidden; white-space: pre; min-width: 46px; }
.editor textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; color: #E7E8F5; font: 13px/1.6 var(--mono); padding: 14px 14px 14px 6px; white-space: pre; tab-size: 2; caret-color: #C9A2FF; }
.cvask { flex: none; padding: 10px; border-top: 1px solid var(--line); background: var(--paper); padding-bottom: calc(10px + var(--safe-b)); }
.cvask form { display: flex; gap: 8px; align-items: center; background: #F6F5F1; border: 1px solid var(--line); border-radius: 18px; padding: 5px 5px 5px 14px; }
.cvask input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; font-size: 15px; }
.cvask .sendbtn { width: 36px; height: 36px; }
.cvstatus { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(12,15,46,.86); color: #fff; padding: 7px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; z-index: 2; }
.cvstatus .dots i { background: #fff; }
.mobtoggle { display: none; }

/* ---------- modal / menus ---------- */
.modal { position: fixed; inset: 0; background: rgba(12,15,46,.38); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--paper); border-radius: 24px; width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--sh2); padding: 20px; animation: rise .2s; }
.sheet h3 { font: 740 20px/1.2 var(--head); margin: 0 0 4px; } .sheet p.sub { color: var(--ink2); margin: 0 0 16px; font-size: 14px; }
.sheet .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.menu { position: fixed; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh2); padding: 6px; min-width: 180px; z-index: 120; animation: fade .12s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; text-align: left; }
.menu button:hover { background: #F4F3EE; } .menu button.danger { color: #C9322A; } .menu .ic { width: 17px; height: 17px; }
.opts { display: grid; gap: 8px; margin-bottom: 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; cursor: pointer; }
.opt.on { border-color: var(--violet); background: var(--vtint); } .opt input { margin-top: 3px; accent-color: var(--violet); }
.opt b { display: block; font-size: 14px; } .opt small { color: var(--ink2); font-size: 12.5px; }

/* ---------- demo bar (preview only) ---------- */
.demobar { position: fixed; z-index: 150; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 6px; background: rgba(12,15,46,.92); color: #fff; border-radius: 99px; padding: 4px 4px 4px 12px; font-size: 12px; font-weight: 650; box-shadow: var(--sh2); backdrop-filter: blur(8px); }
.demobar span { color: #FFC94F; letter-spacing: .02em; }
.demobar button { color: #C9CBE6; height: 28px; padding: 0 11px; border-radius: 99px; font-weight: 650; font-size: 12.5px; }
.demobar button.on { background: #fff; color: var(--ink); }
body.demo .top, body.demo .atop { padding-top: 0; }
body.demo .app { padding-top: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--sh2); }
  .app.side-open .side { transform: none; }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12,15,46,.3); z-index: 25; }
  .top .mob { display: inline-grid; }
  .app.cv-open .canvas { position: fixed; inset: 0; width: 100%; z-index: 60; border: 0; }
  .app.cv-open.cv-hide .canvas { transform: translateY(100%); }
  .canvas { transition: transform .28s ease; }
  .mobtoggle { display: flex; position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b)); }
  .app.cv-open .mobtoggle { display: flex; } .app:not(.cv-open) .mobtoggle { display: none; }
  .app.cv-open:not(.cv-hide) .mobtoggle { bottom: calc(74px + var(--safe-b)); }
  .mobtoggle .seg { background: rgba(12,15,46,.9); box-shadow: var(--sh2); } .mobtoggle .seg button { color: #C9CBE6; } .mobtoggle .seg button.on { background: #fff; color: var(--ink); }
  .cvtop .hidemob { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .col { padding: 14px 14px 22px; }
  .sugs { grid-template-columns: 1fr; gap: 8px; }
  .sug:nth-child(n+4) { display: none; }
  .hello { justify-content: flex-start; padding-top: 7vh; }
  .hello p.tag { margin-bottom: 18px; }
  .msg { gap: 9px; } .msg.ai .orb { width: 26px; height: 26px; border-radius: 9px; } .msg.ai .orb .ic { width: 15px; height: 15px; }
  .msg.user .bub { max-width: 88%; }
  .composer { padding: 0 10px calc(8px + var(--safe-b)); }
  .feats { display: none; }
  .demobar { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(4px + var(--safe-b)); }
  .cvtop { gap: 2px; padding: 0 6px 0 4px; } .cvtop .t small { display: none; } .seg button { padding: 0 9px; } .cvtop .seg button span.lbl { display: none; }
  body.demo .composer { padding-bottom: calc(44px + var(--safe-b)); }
  body.demo .mobtoggle { bottom: calc(190px + var(--safe-b)); }
  body.demo .app.cv-open:not(.cv-hide) .mobtoggle { bottom: calc(112px + var(--safe-b)); }
  body.demo .cvask { padding-bottom: calc(46px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
