:root {
  --navy: #0a3d78;
  --blue: #0b63ce;
  --blue-2: #2879dc;
  --blue-soft: #eaf3ff;
  --blue-soft-2: #f5f9ff;
  --ink: #142033;
  --muted: #6f7b8d;
  --muted-2: #98a3b2;
  --line: #e3e9f1;
  --surface: #ffffff;
  --bg: #f6f9fd;
  --green: #1a9a67;
  --shadow: 0 18px 45px rgba(33, 63, 104, .10);
  --shadow-soft: 0 10px 30px rgba(35, 66, 104, .07);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, #ffffff 0, rgba(255,255,255,0) 42%),
    linear-gradient(180deg, #f9fbfe 0%, var(--bg) 100%);
}
button, textarea, input { font: inherit; }
button { cursor: pointer; }
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 76px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 34px;
  background: rgba(255,255,255,.90);
  border-bottom: 1px solid rgba(227,233,241,.96);
  backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-symbol {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; color: #fff; font-size: 22px;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  box-shadow: 0 10px 22px rgba(11, 99, 206, .20);
}
.brand-copy { min-width: 0; }
.brand-name { font-size: 19px; font-weight: 850; letter-spacing: -.035em; }
.brand-subtitle { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.author-label { color: #667487; font-size: 12px; white-space: nowrap; }
.author-label strong { color: #243246; font-weight: 800; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8c0cb; }
.status-dot.online { background: #23a66d; box-shadow: 0 0 0 4px rgba(35,166,109,.10); }
.status-dot.offline { background: #db5a5a; }

.main { width: min(1080px, 100%); margin: 0 auto; padding: 42px 24px 18px; flex: 1; display: flex; flex-direction: column; }
.hero { text-align: center; transition: opacity .18s ease, transform .18s ease; }
.hero.kicked { margin-bottom: 18px; }
.hero-kicker {
  display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .11em;
}
h1 { margin: 17px 0 10px; font-size: clamp(35px, 5.5vw, 60px); line-height: 1.02; letter-spacing: -.06em; }
h1 span { color: var(--blue); }
.hero p { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 1.72; }

  max-width: 660px; margin: 25px auto 0; padding: 13px 15px 14px;
  border: 1px solid #dce7f4; border-radius: 17px; text-align: left;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(246,250,255,.94));
  box-shadow: var(--shadow-soft);
}

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.quick-card {
  min-height: 120px; padding: 17px; text-align: left;
  border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.80);
  box-shadow: 0 8px 24px rgba(40,70,110,.045);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.quick-card:hover { transform: translateY(-2px); border-color: #c5d7ec; box-shadow: var(--shadow); }
.quick-icon { display: block; font-size: 23px; margin-bottom: 14px; }
.quick-title { display: block; color: #243246; font-weight: 800; font-size: 13px; }
.quick-desc { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.chat-area { flex: 1; min-height: 320px; margin-top: 16px; display: flex; flex-direction: column; }
.messages { flex: 1; display: flex; flex-direction: column; gap: 17px; padding: 4px 2px 20px; }
.message-row { display: flex; align-items: flex-start; gap: 11px; max-width: 88%; }
.user-row { align-self: flex-end; flex-direction: row-reverse; }
.avatar { flex: 0 0 auto; width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; font-size: 9px; font-weight: 850; }
.user-avatar { color: #fff; background: #243042; }
.bot-avatar { color: var(--blue); background: var(--blue-soft); }
.message-content { min-width: 0; }
.message-label { margin: 0 0 5px 2px; font-size: 10px; color: #7e8a9a; font-weight: 750; }
.bot-label { color: var(--blue); }
.bubble { padding: 12px 15px; border-radius: 15px; font-size: 14px; line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere; }
.user-bubble { color: #fff; background: #243042; border-top-right-radius: 5px; }
.bot-bubble { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-top-left-radius: 5px; box-shadow: 0 7px 24px rgba(25,49,82,.045); }
.meta-line { margin: 7px 2px 0; color: #9aa4b2; font-size: 10px; line-height: 1.4; }

.composer-zone { padding-top: 10px; position: sticky; bottom: 0; background: linear-gradient(to bottom, rgba(246,249,253,0), rgba(246,249,253,.97) 18%); }
.composer { display: flex; align-items: flex-end; gap: 9px; padding: 9px 9px 9px 14px; border: 1px solid #d6e1ee; border-radius: 19px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
textarea { width: 100%; min-height: 42px; max-height: 150px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 8px 2px 4px; line-height: 1.5; }
textarea::placeholder { color: #97a2b2; }
.send-btn { width: 43px; height: 43px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(145deg, var(--navy), var(--blue)); display: grid; place-items: center; font-size: 20px; box-shadow: 0 8px 18px rgba(11,99,206,.22); }
.send-btn:hover { filter: brightness(1.03); }
.send-btn:disabled { opacity: .45; cursor: default; }
.composer-note { padding: 8px 4px 0; color: #97a1ae; font-size: 10px; text-align: center; }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 22px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #a1acb9; animation: pulse 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .14s; }
.typing i:nth-child(3) { animation-delay: .28s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.footer { padding: 14px 24px 20px; text-align: center; color: #a0a8b5; font-size: 10px; }
.footer-main span { color: #6f7c8d; font-weight: 750; }
.documents-link { margin: 10px auto 0; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dbe5f0; border-radius: 999px; color: #62738a; background: rgba(255,255,255,.68); font-size: 10px; font-weight: 780; transition: .16s ease; }
.documents-link:hover { color: var(--blue); border-color: #c8d9ec; background: #fff; box-shadow: 0 8px 22px rgba(30,70,110,.07); transform: translateY(-1px); }
.documents-link-icon { font-size: 12px; line-height: 1; }
.documents-link-arrow { color: #9aabba; font-size: 11px; }
.documents-link:hover .documents-link-arrow { color: var(--blue); }

.documents-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 22px; background: rgba(19,34,56,.30); backdrop-filter: blur(7px); }
.documents-overlay[hidden] { display: none; }
.documents-modal { width: min(760px, 100%); max-height: min(760px, calc(100vh - 44px)); padding: 25px 24px 17px; background: rgba(255,255,255,.985); border: 1px solid rgba(218,227,237,.95); border-radius: 25px; box-shadow: 0 26px 80px rgba(22,44,76,.20); overflow: hidden; display: flex; flex-direction: column; }
.documents-panel-head { display: flex; justify-content: space-between; gap: 18px; }
.documents-kicker { color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.documents-panel-head h2 { margin: 6px 0 6px; font-size: 26px; letter-spacing: -.045em; }
.documents-panel-head p { margin: 0; max-width: 560px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.documents-close { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 12px; background: #f2f6fa; color: #718095; font-size: 22px; line-height: 1; }
.documents-close:hover { background: #e8eef6; color: #243246; }
.documents-toolbar { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; }
.document-search-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #dce5ef; border-radius: 13px; background: #fbfdff; }
.document-search-wrap > span { color: #93a0b0; font-size: 17px; }
.documents-toolbar input { min-width: 0; flex: 1; padding: 10px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.document-search-wrap:focus-within { border-color: #a9c4e5; box-shadow: 0 0 0 3px rgba(11,99,206,.08); }
.document-count { flex: 0 0 auto; color: #8a96a6; font-size: 10px; white-space: nowrap; }
.documents-list { flex: 1; min-height: 120px; overflow-y: auto; padding: 2px 2px 4px 0; }
.document-item { display: flex; align-items: center; gap: 12px; padding: 11px 5px; border-bottom: 1px solid #edf1f5; }
.document-item:last-child { border-bottom: 0; }
.document-file-icon { flex: 0 0 auto; width: 38px; height: 41px; border-radius: 11px; display: grid; place-items: center; background: #eef5fd; color: var(--blue); font-size: 14px; font-weight: 900; }
.document-file-icon.pdf { background: #fff1f0; color: #c45651; }
.document-file-icon.word { background: #edf4ff; color: #2f6fba; }
.document-file-icon.excel { background: #eef9f0; color: #348356; }
.document-info { min-width: 0; flex: 1; }
.document-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #243246; font-size: 12px; font-weight: 780; }
.document-meta { margin-top: 4px; color: #9aa4b2; font-size: 9px; line-height: 1.3; }
.document-download { flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border: 0; cursor: pointer; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: #eef5fd; font: inherit; font-size: 17px; font-weight: 800; }
.document-download:hover { background: #deebfa; }
.documents-loading, .documents-empty { padding: 38px 8px; text-align: center; color: #8b97a7; font-size: 11px; }
.documents-note { padding-top: 12px; margin-top: 4px; color: #a2aab5; font-size: 9px; line-height: 1.45; border-top: 1px solid #edf1f5; }
body.documents-open { overflow: hidden; }





@media (max-width: 800px) {
  .topbar { height: 70px; padding: 0 16px; }
  .brand-symbol { width: 38px; height: 38px; border-radius: 12px; }
  .brand-name { font-size: 17px; }
  .status, .author-label { display: none; }
  .main { padding: 30px 13px 10px; }
  h1 { font-size: clamp(34px, 11vw, 50px); }
  .hero p { font-size: 13px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .quick-card { min-height: 112px; padding: 14px; }
  .message-row { max-width: 95%; }
  .composer-note { font-size: 9px; }
  .documents-modal { max-height: calc(100vh - 24px); padding: 21px 17px 14px; border-radius: 21px; }
  .documents-panel-head h2 { font-size: 22px; }
  
}

@media (max-width: 460px) {
  .brand-subtitle { display: none; }
  .quick-title { font-size: 12px; }
  .quick-desc { font-size: 10px; }
  .bubble { font-size: 13px; }
  .documents-toolbar { align-items: stretch; flex-direction: column; }
  .document-count { text-align: right; }
  
  
}