:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172437; background: #f5f8fc; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: linear-gradient(135deg, #f7fbff 0%, #f2f7f5 100%); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #9dd4ce; outline-offset: 2px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { background: #102739; color: #f3fbfc; padding: 26px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 10px; font-weight: 800; letter-spacing: -.03em; font-size: 1.25rem; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #102739; background: #9fe3d8; }
.nav-list { display: grid; gap: 5px; }
.nav-item { text-align: left; padding: 11px 12px; border-radius: 9px; color: #c5d5dc; background: transparent; font-weight: 650; }
.nav-item:hover, .nav-item.active { color: #fff; background: #24465a; }
.nav-item.disabled { color: #78909c; cursor: not-allowed; }
.nav-item span { float: right; font-size: .72rem; font-weight: 500; }
.sidebar-note { margin: auto 10px 0; color: #a4bbc4; font-size: .8rem; line-height: 1.5; }
.workspace { min-width: 0; }
.topbar { min-height: 76px; padding: 12px clamp(18px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #dce7ec; background: rgb(255 255 255 / .85); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 3; }
.context-switcher, .topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.context-switcher label { display: grid; gap: 3px; color: #607789; font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
select, input, textarea { border: 1px solid #cbd9e0; color: #203247; background: #fff; border-radius: 8px; }
select, input { min-height: 38px; padding: 7px 10px; }
.context-switcher select { width: 160px; }
.text-button, .subtle-button { color: #176b66; background: #e6f4f1; border: 1px solid #c7e6e0; padding: 9px 11px; border-radius: 8px; font-weight: 720; }
.subtle-button { color: #40596d; background: #fff; border-color: #d4e0e5; }
.subtle-button:hover, .text-button:hover { filter: brightness(.97); }
button:disabled { opacity: .55; cursor: not-allowed; }
.context-indicator { color: #4e697a; font-size: .82rem; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-control { display: grid; gap: 3px; color: #607789; font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.token-control input { width: 118px; }
.view { display: none; max-width: 1100px; margin: 0 auto; padding: clamp(20px, 4vw, 48px); }
.view.active { display: block; }
.chat-header, .section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: #147a72; letter-spacing: .12em; font-size: .72rem; font-weight: 800; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2 { letter-spacing: -.035em; color: #172c40; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 7px; }
h2 { font-size: 1.55rem; margin-bottom: 8px; }
h3 { font-size: 1rem; margin-bottom: 7px; }
.muted { color: #658092; line-height: 1.45; }
.messages { display: grid; gap: 14px; min-height: 320px; max-height: calc(100vh - 350px); overflow-y: auto; padding: 6px 4px 20px; scroll-behavior: smooth; }
.welcome-message, .chat-message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; max-width: 820px; }
.welcome-message { padding: 15px; background: #fff; border: 1px solid #e0eaee; border-radius: 12px; }
.welcome-message p { margin-bottom: 0; color: #526d7c; line-height: 1.5; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; }
.ceo-avatar, .chat-message.ceo::before { background: #d8f2ed; color: #0c756c; }
.chat-message::before { content: "A"; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #d8f2ed; color: #0c756c; font-size: .78rem; font-weight: 800; }
.chat-message.founder { grid-template-columns: minmax(0, 1fr) 32px; margin-left: auto; }
.chat-message.founder::before { order: 2; content: "Вы"; background: #dcecf9; color: #23567c; }
.message-meta { display: flex; gap: 8px; color: #5c7586; font-size: .78rem; font-weight: 700; margin: 0 0 5px; }
.message-meta time { font-weight: 500; }
.message-content { background: #fff; border: 1px solid #e0eaee; border-radius: 5px 13px 13px 13px; padding: 12px 14px; color: #24394b; line-height: 1.5; overflow-wrap: anywhere; }
.founder .message-content { background: #e7f3fb; border-color: #cfe4f2; border-radius: 13px 5px 13px 13px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content pre { overflow: auto; padding: 10px; border-radius: 8px; color: #e4f0f4; background: #173142; white-space: pre; }
.message-content code { padding: 1px 4px; border-radius: 4px; color: #0e665e; background: #e9f5f2; }
.message-content pre code { color: inherit; background: none; padding: 0; }
.markdown-list { margin: 7px 0; padding-left: 22px; }
.markdown-table { width: 100%; margin: 9px 0; border-collapse: collapse; font-size: .9em; }
.markdown-table th, .markdown-table td { padding: 6px 8px; border: 1px solid #d7e4e8; text-align: left; }
.markdown-table th { color: #28605d; background: #edf7f5; }
.retry-button { margin: 7px 0 0 42px; color: #176b66; background: transparent; text-decoration: underline; font-weight: 700; }
.inline-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 0 0 18px; }
.action-card, .system-card, .record-list > .action-card { background: #fff; border: 1px solid #dce7ec; border-radius: 11px; padding: 14px; box-shadow: 0 3px 10px rgb(37 76 91 / .04); }
.action-card p:last-child { margin-bottom: 0; }
.card-label { color: #15746d; font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 7px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.approve-button, .send-button { color: #fff; background: #147a72; border-radius: 8px; padding: 9px 12px; font-weight: 750; }
.composer { position: sticky; bottom: 0; padding: 12px 0 2px; background: linear-gradient(to bottom, rgb(245 248 252 / 0), #f5f8fc 20%); }
.composer textarea { display: block; width: 100%; resize: vertical; min-height: 86px; padding: 13px; line-height: 1.45; box-shadow: 0 5px 18px rgb(41 84 96 / .08); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.composer-tools { min-width: 0; display: flex; align-items: center; gap: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #d2e0e5; border-radius: 8px; color: #45667a; background: #fff; font-weight: 750; }
.send-button { min-width: 116px; }
.attachment-chip { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin: 0 0 7px; padding: 6px 8px; color: #396275; background: #e9f5f2; border-radius: 7px; font-size: .83rem; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { color: inherit; background: transparent; font-size: 1.1rem; }
.composer-status { font-size: .8rem; }
.record-list { display: grid; gap: 10px; max-width: 780px; }
.empty-state, .inline-error { padding: 16px; color: #627c8d; border: 1px dashed #cbdce3; border-radius: 10px; background: #fbfdfe; }
.system-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.system-card h3 { color: #1b3548; }
.admin-details { margin-top: 22px; padding: 14px; border: 1px solid #d9e5e9; border-radius: 10px; background: #fff; }
.admin-details summary { cursor: pointer; color: #426376; font-weight: 750; }
.admin-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.admin-forms form { display: grid; gap: 9px; padding: 14px; border: 1px solid #e0eaee; border-radius: 9px; }
.admin-forms button, .modal-form > button { color: #fff; background: #147a72; border-radius: 8px; padding: 10px 12px; font-weight: 750; }
dialog { width: min(480px, calc(100vw - 32px)); border: 0; border-radius: 13px; box-shadow: 0 18px 70px rgb(10 34 51 / .25); }
dialog::backdrop { background: rgb(10 34 51 / .42); }
.modal-form { display: grid; gap: 12px; }
.modal-form label, .system-card label { display: grid; gap: 5px; color: #436174; font-size: .83rem; font-weight: 700; }
.modal-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.modal-heading h2 { margin-bottom: 0; }
.optional { color: #7892a1; font-weight: 500; }
.mobile-only { display: none; }
@media (max-width: 800px) { .app-shell { display: block; } .sidebar { position: fixed; z-index: 6; inset: 0 auto 0 0; width: 245px; transform: translateX(-101%); transition: transform .2s ease; box-shadow: 12px 0 30px rgb(0 0 0 / .18); } body.nav-open .sidebar { transform: translateX(0); } .mobile-only { display: inline-grid; } .topbar { align-items: flex-start; } .context-switcher { flex: 1; } .topbar-actions, .token-control { display: none; } }
@media (max-width: 580px) { .topbar { padding: 10px 14px; } .context-switcher label { flex: 1; } .context-switcher select { width: 100%; } .text-button { padding: 8px; } .view { padding: 20px 14px; } .chat-header, .section-header { flex-direction: column; } .messages { max-height: none; min-height: 250px; } .chat-message, .chat-message.founder { max-width: 100%; } .composer-footer { align-items: flex-end; } .composer-status { max-width: 180px; } }
