/* Internal Knowledge Base: plain CSS, no build step. */
:root {
  --bg: #f4f6fa; --card: #ffffff; --text: #1b2430; --muted: #66727f; --line: #dfe4ec;
  --brand: #0a8a43; --brand-dark: #076c34; --brand-soft: #e3f5ea; --accent: #ffcd2f; --navy: #101a2c; --navy-2: #1a2a47;
  --ok: #17803d; --ok-soft: #e3f6ea; --warn: #a15c00; --warn-soft: #fff3dc;
  --bad: #c0262d; --bad-soft: #fdeaea; --web: #7a3dd1; --web-soft: #f1e9fd;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 14px rgba(20,30,50,.05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; } h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
code { font-family: var(--mono); font-size: .88em; background: #eef1f6; padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .num { text-align: right; font-variant-numeric: tabular-nums; }
.inline { display: inline; } .dim { opacity: .55; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 1.2rem; padding: 0 1.2rem; height: 54px; background: linear-gradient(180deg, #121d33, #0e1729); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 10px rgba(8,14,26,.25); }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; font-weight: 700; letter-spacing: .2px; } .brand:hover { text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-text { padding-left: .65rem; border-left: 1px solid rgba(255,255,255,.22); font-size: .95rem; line-height: 1.1; }
.nav { display: flex; gap: .2rem; flex: 1; }
.nav a { color: #c8d3e6; padding: .4rem .8rem; border-radius: 8px; } .nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.usermenu { display: flex; align-items: center; gap: .6rem; } .usermenu .who { color: #dbe5f7; }
.role { font-size: .72rem; background: rgba(255,205,47,.16); color: #ffe08a; padding: .1rem .45rem; border-radius: 99px; margin-left: .3rem; }

.container { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.crumb { margin: 0; font-size: .9rem; }
.subnav { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.subnav a { padding: .5rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; } .subnav a:hover { text-decoration: none; color: var(--text); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .grid-2 > .card { margin-bottom: 1rem; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* forms */
label { display: block; font-size: .85rem; font-weight: 600; color: #3a4655; margin-bottom: .8rem; }
label small { font-weight: 400; display: block; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; margin-top: .25rem; padding: .5rem .65rem; border: 1px solid #c9d2df; border-radius: 8px; background: #fff; font: inherit; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8fd3ac; border-color: var(--brand); }
input[type=file] { margin-top: .25rem; width: 100%; }
.row { display: flex; gap: 1rem; } .row > label { flex: 1; } .row.wrap { flex-wrap: wrap; align-items: flex-end; } .row.wrap > label { min-width: 190px; }
.grow { flex: 2 !important; }
.check { display: inline-flex; gap: .4rem; align-items: center; font-weight: 500; } .check input { width: auto; margin: 0; } .check.big { font-size: .95rem; margin-right: 1.2rem; }
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; } .filters label { margin: 0; min-width: 140px; } .filters .grow { min-width: 240px; }
.filter-actions { display: flex; gap: .4rem; padding-bottom: .8rem; } .filters .filter-actions { padding-bottom: 0; }

.btn { display: inline-block; padding: .5rem .95rem; border: 1px solid #c3ccda; background: #fff; color: var(--text); border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f1f4f9; text-decoration: none; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: #fff; color: var(--bad); border-color: #e3a8ab; } .btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; } .topbar .btn-ghost { color: #c8d3e6; } .topbar .btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: .25rem .6rem; font-size: .85rem; } .btn-block { display: block; width: 100%; text-align: center; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.flash { padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-ok { background: var(--ok-soft); border-color: #b7e3c6; color: #0f5c2b; }
.flash-info { background: var(--brand-soft); border-color: #b6e0c5; color: #0b5a2d; }
.flash-warn { background: var(--warn-soft); border-color: #f1d9a6; color: var(--warn); }
.flash-error { background: var(--bad-soft); border-color: #f0b9bc; color: #8f1c22; }

/* tables */
.table-wrap { padding: 0; overflow-x: auto; } .table-wrap > p { padding: 0 1.2rem 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .65rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .65rem .9rem; border-bottom: 1px solid #edf0f5; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td input, .table td select { margin-top: 0; }
.table td.actions { text-align: right; white-space: nowrap; } .table td.actions form.inline { display: inline; margin-left: .3rem; }
.table th.sel, .table td.sel { width: 2rem; text-align: center; }
.users-table td { vertical-align: top; } .who-cell { min-width: 250px; } .who-cell input { margin-top: 0; margin-bottom: .35rem; } .users-table .actions { white-space: nowrap; } .users-table select { min-width: 8.5rem; width: auto; }
.bulk-bar { display: flex; gap: .8rem; align-items: center; margin: 0 0 .6rem; }
.tags { margin-top: .25rem; } .tag { display: inline-block; font-size: .75rem; background: #eef1f6; color: #44505f; padding: .05rem .5rem; border-radius: 99px; margin: 0 .25rem .2rem 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; }
.badge-ready { background: var(--ok-soft); color: var(--ok); } .badge-queued, .badge-processing { background: var(--warn-soft); color: var(--warn); }
.badge-failed { background: var(--bad-soft); color: var(--bad); }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
dl.meta { display: grid; grid-template-columns: 110px 1fr; gap: .4rem 1rem; margin: 0 0 1rem; } dl.meta dt { color: var(--muted); } dl.meta dd { margin: 0; }
iframe.pdf { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; }
.chunk { border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; background: #fbfcfe; } .chunk summary { cursor: pointer; padding: .5rem .8rem; font-weight: 600; }
.chunk:target { outline: 2px solid var(--brand); } .chunk-text { margin: 0; padding: .8rem 1rem; white-space: pre-wrap; word-break: break-word; font: .88rem/1.5 var(--mono); border-top: 1px solid var(--line); max-height: 420px; overflow: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; color: var(--muted); font-size: .85rem; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 1.6rem; font-weight: 700; color: var(--text); } .stat.bad span { color: var(--bad); }

/* auth: split screen with the logo watermark */
body.auth { background: #f4f7fb; }
.auth-main { min-height: 100vh; }
.auth-main > .flash { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 50; max-width: 440px; box-shadow: var(--shadow); background: #fff; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr); min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 3.2rem 4rem 2rem;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(0,166,79,.38), transparent 62%),
    radial-gradient(760px 520px at 92% 92%, rgba(255,205,47,.20), transparent 60%),
    linear-gradient(150deg, #0a1322 0%, #0f2038 55%, #0b2a29 100%); }
.hero-inner, .hero-foot { position: relative; z-index: 1; }
.hero-inner { margin: auto 0; max-width: 560px; }
.hero-logo-lg { height: auto; width: 150px; display: block; margin-bottom: 1.6rem; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
.auth-hero h1 { font-size: 2.6rem; line-height: 1.1; margin: 0 0 .9rem; letter-spacing: -.02em; }
.hero-lead { font-size: 1.1rem; line-height: 1.6; color: #cdd9ec; margin: 0 0 2rem; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.05rem; }
.hero-points li { display: flex; gap: .9rem; align-items: flex-start; }
.hero-points strong { display: block; font-size: 1rem; }
.hero-points div span { display: block; color: #aebdd6; font-size: .92rem; margin-top: .1rem; }
.tick { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,166,79,.25); border: 1px solid rgba(0,200,100,.55); position: relative; margin-top: .1rem; }
.tick::after { content: ""; position: absolute; left: 8px; top: 5px; width: 6px; height: 11px; border: solid var(--accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.hero-foot { margin: 2rem 0 0; color: #8fa2c2; font-size: .85rem; }
.auth-side { display: grid; place-items: center; padding: 2rem; background: radial-gradient(600px 360px at 80% 0%, rgba(0,166,79,.08), transparent 70%), #f4f7fb; }
.auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 16px; padding: 2.2rem 2rem 1.6rem; box-shadow: 0 18px 50px rgba(16,26,44,.13), 0 2px 6px rgba(16,26,44,.05); }
.auth-card h2 { font-size: 1.55rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
.auth-card form { margin-top: 1.3rem; }
.auth-card input[type=email], .auth-card input[type=password] { padding: .7rem .85rem; font-size: 1rem; border-radius: 10px; background: #f8fafc; }
.auth-card input:focus { background: #fff; }
.btn-lg { padding: .75rem 1rem; font-size: 1.02rem; border-radius: 10px; }
.auth-card .btn-primary { background: linear-gradient(135deg, #0ea14f, #087a3b); box-shadow: 0 6px 16px rgba(10,138,67,.28); margin-top: .4rem; }
.auth-card .btn-primary:hover { background: linear-gradient(135deg, #0b8d44, #066c33); }
.auth-note { text-align: center; margin: 1.1rem 0 0; }
.auth-logo-mobile { display: none; margin: 0 auto 1rem; filter: drop-shadow(0 1px 1px rgba(110,85,0,.55)); }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; } .auth-hero { display: none; }
  .auth-side { min-height: 100vh; background: linear-gradient(160deg, #0f2038, #0b2a29); }
  .auth-logo-mobile { display: block; }
}

/* chat */
body.chat-page { overflow: hidden; }
.chat-layout { display: grid; grid-template-columns: 280px 1fr; grid-template-rows: minmax(0, 1fr); height: calc(100vh - 54px); height: calc(100dvh - 54px); overflow: hidden; }
.chat-side { background: #fff; border-right: 1px solid var(--line); padding: .9rem .8rem; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.chat-side .btn-primary { background: linear-gradient(135deg, #0ea14f, #087a3b); box-shadow: 0 4px 12px rgba(10,138,67,.25); border-radius: 10px; padding: .6rem .9rem; }
.side-title { margin: 1.1rem .4rem .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8794a6; }
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv-list li { display: flex; align-items: center; border-radius: 10px; margin-bottom: 2px; border-left: 3px solid transparent; }
.conv-list li:hover { background: #f2f6f4; } .conv-list li.active { background: var(--brand-soft); border-left-color: var(--brand); }
.conv-list a { flex: 1; color: var(--text); padding: .5rem .6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.conv-list li.active a { font-weight: 600; } .conv-list a:hover { text-decoration: none; }
.conv-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: .3rem .5rem; font-size: 1rem; visibility: hidden; border-radius: 6px; }
.conv-list li:hover .conv-del { visibility: visible; } .conv-del:hover { color: var(--bad); background: var(--bad-soft); }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; padding: 0 1.5rem;
  background: radial-gradient(900px 340px at 50% -120px, rgba(0,166,79,.10), transparent 70%), radial-gradient(520px 300px at 100% 100%, rgba(255,205,47,.07), transparent 70%), var(--bg); }
.chat-toolbar { display: flex; gap: 1rem; align-items: center; padding: .75rem 0; flex-wrap: wrap; flex-shrink: 0; width: 100%; }
.chat-title { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.02rem; }
.chat-title small { font-weight: 500; color: var(--muted); font-size: .82rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #1fbf6a; box-shadow: 0 0 0 4px rgba(31,191,106,.18); }
.model-tag { margin-left: auto; opacity: .8; }
.inline-label { display: flex; gap: .4rem; align-items: center; margin: 0; font-weight: 500; } .inline-label select { width: auto; margin: 0; border-radius: 99px; padding: .35rem .8rem; background: #fff; }

.messages { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .4rem .2rem 1.2rem; scroll-behavior: smooth; }

/* welcome screen */
.empty { max-width: 980px; margin: 5vh auto 0; text-align: center; }
.hero-logo { width: 84px; height: auto; margin: 0 auto .6rem; display: block; filter: drop-shadow(0 1px 1px rgba(110,85,0,.55)) drop-shadow(0 6px 14px rgba(16,26,44,.14)); }
.empty h2 { font-size: 1.95rem; letter-spacing: -.02em; margin: .2rem 0 .5rem; }
.empty .lead { max-width: 560px; margin: 0 auto 1.6rem; line-height: 1.6; }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; text-align: left; }
.ex-card { text-align: left; display: flex; gap: .85rem; align-items: flex-start; padding: .95rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font: inherit; color: var(--text);
  box-shadow: var(--shadow); transition: transform .12s, border-color .12s, box-shadow .12s; }
.ex-card:hover { transform: translateY(-2px); border-color: #7fcf9f; box-shadow: 0 8px 22px rgba(10,138,67,.14); }
.ex-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.ex-ico svg { width: 20px; height: 20px; }
.ex-title { display: block; font-weight: 700; margin-bottom: .1rem; } .ex-sub { display: block; color: var(--muted); font-size: .85rem; line-height: 1.35; }
.chip { border: 1px solid #c3ccda; background: #fff; border-radius: 99px; padding: .4rem .9rem; cursor: pointer; font: inherit; color: var(--text); } .chip:hover { background: var(--brand-soft); }

/* conversation */
.msg { width: 100%; margin: 0 0 1.4rem; }
.msg.user { display: flex; justify-content: flex-end; align-items: flex-end; gap: .6rem; }
.msg.user .bubble { background: linear-gradient(135deg, #0ea14f, #087a3b); color: #fff; width: fit-content; max-width: 82%; padding: .65rem 1rem; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; word-break: break-word; box-shadow: 0 4px 14px rgba(10,138,67,.22); }
.user-av { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.msg.assistant { display: flex; gap: .8rem; align-items: flex-start; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid var(--line); padding: 6px; object-fit: contain; box-shadow: var(--shadow); }
.msg-body { flex: 1; min-width: 0; }
.msg.assistant .bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: .9rem 1.15rem; box-shadow: var(--shadow); overflow-wrap: anywhere; line-height: 1.62; }
.msg-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; font-size: .8rem; color: var(--muted); } .msg-head > span:first-child { font-weight: 700; color: var(--text); }
.label { font-weight: 700; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; }
.label-internal { background: var(--ok-soft); color: var(--ok); } .label-web { background: var(--web-soft); color: var(--web); }
.label-both { background: var(--brand-soft); color: var(--brand); } .label-none { background: var(--warn-soft); color: var(--warn); }
.status { color: var(--muted); font-style: italic; font-size: .88rem; }
.bubble p { margin: .4rem 0; } .bubble h2, .bubble h3 { font-size: 1rem; margin: .9rem 0 .3rem; } .bubble ol, .bubble ul { padding-left: 1.4rem; margin: .4rem 0; } .bubble li { margin: .25rem 0; }
.bubble table { border-collapse: collapse; margin: .5rem 0; } .bubble th, .bubble td { border: 1px solid var(--line); padding: .25rem .5rem; }
.bubble pre { background: #0f1b2d; color: #e6edf7; padding: .8rem 1rem; border-radius: 8px; overflow-x: auto; margin: .6rem 0; font: .85rem/1.5 var(--mono); position: relative; }
.bubble pre code { background: transparent; padding: 0; color: inherit; }
.copy-btn { position: absolute; top: .4rem; right: .4rem; font-size: .72rem; padding: .15rem .5rem; border-radius: 6px; border: 1px solid #3a4c6b; background: #1b2b45; color: #cfe0ff; cursor: pointer; }
.copy-btn:hover { background: #26395a; }
a.cite { font-size: .72rem; font-weight: 700; padding: .02rem .35rem; border-radius: 5px; background: var(--brand-soft); color: var(--brand); vertical-align: super; margin: 0 .1rem; } a.cite:hover { background: #c9ecd7; text-decoration: none; }
a.cite.w { background: var(--web-soft); color: var(--web); }
.sources { margin-top: .7rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.src { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; background: #fbfcfe; font-size: .85rem; } .src.flash-on { outline: 2px solid var(--brand); }
.src .kind { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; } .src .kind.internal { color: var(--ok); } .src .kind.web { color: var(--web); }
.src .t { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .src .sec, .src .snip { color: var(--muted); font-size: .8rem; }
.src .snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .src.uncited { opacity: .75; }
.sources-title { margin: .7rem 0 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.msg-actions { display: flex; gap: .3rem; margin-top: .5rem; align-items: center; flex-wrap: wrap; }
.fb { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: .15rem .5rem; cursor: pointer; font-size: .95rem; } .fb:hover { background: #f1f4f9; } .fb.on { background: var(--brand-soft); border-color: var(--brand); }
.fb-comment { display: flex; gap: .4rem; width: 100%; margin-top: .3rem; } .fb-comment input { margin: 0; }
.status { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: .5rem; }
.status::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cfe9da; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer { flex-shrink: 0; display: flex; gap: .7rem; width: 100%; margin: 0; align-items: stretch; }
.composer-box { flex: 1; min-width: 0; display: flex; gap: .5rem; align-items: flex-end; background: #fff; border: 1px solid #cbd5e1; border-radius: 18px; padding: .45rem .5rem .45rem .6rem; box-shadow: 0 8px 28px rgba(16,26,44,.10); transition: border-color .12s, box-shadow .12s; }
.composer-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,138,67,.16), 0 8px 28px rgba(16,26,44,.10); }
.composer .composer-model { flex: none; width: auto; max-width: 16rem; margin: 0; align-self: stretch; background: #fff; border: 1px solid #cbd5e1; border-radius: 18px; padding: 0 .9rem; font-size: .88rem; font-weight: 600; box-shadow: 0 8px 28px rgba(16,26,44,.10); cursor: pointer; }
.composer .composer-model:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(10,138,67,.16); }
.composer textarea { flex: 1; min-width: 0; margin: 0; resize: none; max-height: 180px; border: 0; background: transparent; padding: .55rem .4rem; border-radius: 12px; outline: none; box-shadow: none; }
.composer textarea:focus { outline: none; }
.composer .btn-primary, .composer .btn { white-space: nowrap; align-self: flex-end; }
.composer .btn-primary { border-radius: 12px; padding: .6rem 1.1rem; background: linear-gradient(135deg, #0ea14f, #087a3b); }
.composer .btn[hidden] { display: none; }
.foot { flex-shrink: 0; text-align: center; margin: .5rem 0 .7rem; }
.only-mobile { display: none; }
@media (max-width: 820px) {
  .chat-layout { grid-template-columns: 1fr; } .chat-side { position: fixed; inset: 54px auto 0 0; width: 280px; z-index: 15; transform: translateX(-100%); transition: transform .15s; }
  .chat-side.open { transform: none; box-shadow: 4px 0 20px rgba(0,0,0,.2); } .only-mobile { display: inline-block; }
  .usermenu .who { display: none; } .brand-text { display: none; }
  .topbar { gap: .4rem; padding: 0 .6rem; } .brand-logo { height: 30px; width: auto; }
  .nav { gap: .1rem; overflow-x: auto; scrollbar-width: none; min-width: 0; } .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: .4rem .55rem; white-space: nowrap; font-size: .9rem; }
  .usermenu .btn { white-space: nowrap; padding: .3rem .55rem; font-size: .85rem; }
  .avatar, .user-av { display: none; }
  .chat-main { padding: 0 .7rem; }
  .chat-toolbar { gap: .5rem; padding: .55rem 0; flex-wrap: nowrap; }
  .chat-title { white-space: nowrap; font-size: .98rem; } .chat-title small { display: none; }
  .chat-toolbar .btn { white-space: nowrap; }
  .inline-label { margin-left: auto; min-width: 0; } .inline-label .lbl { display: none; }
  .inline-label select { max-width: 9.5rem; font-size: .85rem; padding: .3rem .6rem; text-overflow: ellipsis; }
  .empty { margin-top: .6rem; } .empty h2 { font-size: 1.35rem; margin-bottom: .3rem; } .empty .lead { display: none; }
  .examples { grid-template-columns: 1fr; gap: .5rem; }
  .ex-card { padding: .6rem .75rem; gap: .7rem; align-items: center; } .ex-ico { width: 32px; height: 32px; } .ex-ico svg { width: 17px; height: 17px; }
  .ex-title { margin: 0; font-size: .93rem; } .ex-sub { display: none; }
  .composer { flex-direction: column; gap: .45rem; }
  .composer .composer-model { width: 100%; max-width: none; align-self: auto; padding: .45rem .8rem; border-radius: 12px; font-size: .85rem; box-shadow: none; }
  .composer-box { border-radius: 14px; padding: .35rem .4rem .35rem .5rem; }
  .composer textarea { font-size: 16px; padding: .45rem .3rem; }
  .composer .btn-primary { padding: .5rem .9rem; }
  .foot { font-size: .72rem; margin: .35rem 0 .5rem; }
  .msg.user .bubble { max-width: 92%; }
}

/* small screens: shared pages */
@media (max-width: 640px) {
  .nav a { padding: .4rem .45rem; font-size: .86rem; } .usermenu .btn { padding: .3rem .45rem; font-size: .8rem; }
  .subnav { overflow-x: auto; scrollbar-width: none; white-space: nowrap; } .subnav::-webkit-scrollbar { display: none; }
  .subnav a { padding: .5rem .7rem; flex: none; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; align-items: end; }
  .filters label { min-width: 0; } .filters .grow { grid-column: 1 / -1; min-width: 0; } .filters .filter-actions { grid-column: 1 / -1; }
  .filters select, .filters input { max-width: 100%; }
  .row { flex-direction: column; gap: .6rem; } .row.wrap > label { min-width: 0; width: 100%; }
}
