@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url('vendor/InterVariable.woff2') format('woff2'); }
:root { --font: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; --text: #202124; --muted: #73777c; --line: #e5e7e9; --accent: #13836b; --danger: #b64242; }
* { letter-spacing: 0; }
[hidden] { display: none !important; }
html, body { color: var(--text); }
button, input, textarea { font: inherit; }
button, summary, label.mode-toggle { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app, .main { height: 100dvh; }
.main { min-width: 0; }
.sidebar { flex-shrink: 0; }
.sidebar .header { justify-content: space-between; padding-left: 60px; }
.sidebar .header span { margin-left: 0; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 16px; font-size: 13px; }
.sidebar-footer > a { min-width: 0; color: var(--text); text-decoration: none; }
.sidebar-footer > a span, .sidebar-footer > a small { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer > a small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.sidebar.collapsed .sidebar-footer, .sidebar.collapsed .chat-filter, .sidebar.collapsed .space-nav, .sidebar.collapsed .section-label { display: none; }
.space-nav {
  width: calc(100% - 24px);
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.space-nav:hover, .space-nav.active { background: var(--new-chat-bg-hover, #e7e8e9); }
.space-nav.active { font-weight: 600; }
.space-nav-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); background: var(--bg-main); }
.space-nav small { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--text) 7%, transparent); font-size: 10px; text-align: center; }
.section-label { font-size: 12px; color: var(--muted); padding: 20px 20px 8px; }
.chat-filter { margin: 12px 16px 0; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.chat-filter input { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--text); padding: 6px 0; font-size: 13px; }
.chat-item { width: calc(100% - 24px); border: 0; background: transparent; color: var(--text); text-align: left; min-height: 40px; font-size: 14px; }
.chat-item .label { display: block; }
.chat-select { display: block; flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; text-align: left; padding: 0; cursor: pointer; font-weight: inherit; }
.chat-item.active .chat-actions { visibility: visible; opacity: 1; }
#chatContextMenu { position: fixed; top: auto; right: auto; z-index: 4000; }
.model-btn { font-size: 16px; font-weight: 500; gap: 8px; padding: 8px 12px; }
.model-menu { width: 240px; max-width: calc(100vw - 80px); }
.model-item { display: block; width: 100%; border: 0; color: var(--text); text-align: left; background: transparent; cursor: pointer; }
.model-item .label { display: flex; align-items: center; justify-content: space-between; }
.model-item .desc { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.chat-empty { color: var(--muted); font-size: 13px; padding: 16px 20px; }
.main > .header { flex: 0 0 60px; border-bottom-color: var(--line); gap: 8px; }
.model-name { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; flex-shrink: 0; }
.model-name img { border-radius: 6px; }
.model-version { font-size: 11px; color: var(--muted); font-weight: 400; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main .title { color: var(--muted); font-size: 13px; min-width: 0; }
.controls { gap: 4px; flex-shrink: 0; }
.icon-btn, .toggle-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn { color: var(--muted); }
.service-bar { min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 8px 22px; font-size: 12px; color: var(--muted); flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.service-status { display: inline-flex; align-items: center; gap: 7px; }
.space-view { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 34px max(22px, calc((100% - 1040px) / 2)) 60px; background: var(--bg-main); }
.space-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.space-eyebrow { color: var(--accent); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.space-heading h1 { margin: 4px 0 5px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.space-heading p { color: var(--muted); font-size: 13px; }
.space-summary { display: grid; flex: 0 0 auto; gap: 2px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; text-align: right; }
.space-summary strong { font-size: 12px; }
.space-summary span { color: var(--muted); font-size: 10px; }
.space-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 20px; }
.space-search { width: min(330px, 100%); min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--bg-main); }
.space-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.space-filters { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.space-filters button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; cursor: pointer; }
.space-filters button:hover { color: var(--text); }
.space-filters button[aria-pressed='true'] { color: #fff; background: var(--text); }
.space-status { min-height: 18px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.space-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-main); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.space-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 12px 30px #10151310; }
.space-preview { height: 142px; display: grid; place-items: center; overflow: hidden; color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--bg-main)); font-size: 34px; }
.space-preview img { width: 100%; height: 100%; object-fit: cover; }
.space-preview.document { color: #54736c; background: #eef5f2; }
.space-preview.audio { color: #705d8c; background: #f4f0f8; }
.space-card-body { padding: 12px; }
.space-card-name { display: block; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.space-card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.space-card-origin { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.space-card-origin span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-card-origin i { color: var(--accent); }
.space-card-actions { display: flex; gap: 6px; margin-top: 11px; }
.space-card-actions a, .space-card-actions button { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: transparent; font-size: 10px; text-decoration: none; cursor: pointer; }
.space-card-actions a:hover, .space-card-actions button:hover { border-color: var(--accent); color: var(--accent); }
.space-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 7px; padding: 70px 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.space-empty i { color: var(--accent); font-size: 30px; }
.space-empty strong { color: var(--text); font-size: 14px; }
.space-empty span { max-width: 360px; font-size: 12px; }
.schedule-view { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 34px max(22px, calc((100% - 920px) / 2)) 64px; background: var(--bg-main); }
.schedule-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.schedule-heading h1 { margin: 4px 0 5px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.schedule-heading p { max-width: 560px; color: var(--muted); font-size: 13px; }
.schedule-new { flex: 0 0 auto; }
.schedule-new[hidden], .schedule-telegram[hidden], .schedule-list[hidden] { display: none; }
.schedule-tabs { width: fit-content; display: flex; gap: 4px; margin: 18px 0 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; }
.schedule-tabs button { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.schedule-tabs button[aria-selected='true'] { color: var(--bg-main); background: var(--text); }
.schedule-tabs small { min-width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 999px; color: inherit; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 9px; }
.schedule-telegram { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; margin: 22px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.schedule-telegram-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #259cd8; font-size: 18px; }
.schedule-telegram > div { min-width: 0; display: grid; gap: 2px; }
.schedule-telegram strong { font-size: 13px; }
.schedule-telegram span:not(.schedule-telegram-icon) { color: var(--muted); font-size: 11px; line-height: 1.4; }
.secondary-btn { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: transparent; font-size: 12px; cursor: pointer; }
.secondary-btn:hover { border-color: var(--accent); color: var(--accent); }
.secondary-btn:disabled { opacity: .45; cursor: not-allowed; }
.schedule-status { min-height: 18px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.schedule-list { display: grid; gap: 10px; }
.schedule-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-main); }
.schedule-card[data-state='draft'] { border-style: dashed; }
.schedule-card[data-state='waiting_time'], .schedule-card[data-state='waiting_user'] { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.schedule-card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--bg-main)); font-size: 18px; }
.schedule-card-main { min-width: 0; }
.schedule-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.schedule-card-title strong { font-size: 14px; }
.schedule-badge { padding: 2px 7px; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--text) 7%, transparent); font-size: 9px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; }
.schedule-badge.active { color: #087258; background: #e7f6f1; }
.schedule-badge.waiting_time, .schedule-badge.waiting_user { color: #6c5814; background: #fff7d8; }
.schedule-badge.paused { color: #667078; background: #eef0f2; }
.schedule-badge.completed { color: #087258; background: #e7f6f1; }
.schedule-badge.error { color: var(--danger); background: #fff0f0; }
.schedule-origin-badge { padding: 2px 7px; border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); font-size: 9px; font-weight: 650; }
.schedule-card-instructions { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.schedule-card-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 10px; }
.schedule-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.schedule-last-run { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.4; }
.schedule-last-run.error { color: var(--danger); }
.schedule-card-actions { display: flex; gap: 5px; }
.schedule-card-actions button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.schedule-card-actions button:hover { border-color: var(--accent); color: var(--accent); }
.schedule-card-actions .danger:hover { border-color: var(--danger); color: var(--danger); }
.schedule-empty { display: grid; justify-items: center; gap: 7px; padding: 70px 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.schedule-empty i { color: var(--accent); font-size: 30px; }
.schedule-empty strong { color: var(--text); font-size: 14px; }
.schedule-empty span { max-width: 420px; font-size: 12px; }
.schedule-dialog { width: min(620px, calc(100% - 28px)); }
.schedule-dialog select { width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--bg-main); font-size: 14px; }
.schedule-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.schedule-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.schedule-options .mode-toggle { margin-top: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; }
.schedule-hint { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.telegram-code-dialog { width: min(470px, calc(100% - 28px)); }
.telegram-code-intro { display: grid; grid-template-columns: 42px 1fr; gap: 13px; align-items: center; margin-top: 18px; }
.telegram-code-intro p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.telegram-code-intro strong { color: var(--text); }
.telegram-code-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #259cd8; font-size: 19px; }
.telegram-link-code { width: 100%; margin-top: 20px; padding: 18px 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 10px; color: var(--text); background: color-mix(in srgb, var(--accent) 5%, var(--bg-main)); font: 650 clamp(22px, 7vw, 30px)/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; text-align: center; cursor: copy; }
.telegram-link-code:hover { border-color: var(--accent); }
.telegram-code-hint { margin: 11px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.telegram-code-hint code { color: var(--text); background: none; }
.telegram-code-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.telegram-code-actions .secondary-btn, .telegram-code-actions .primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.march-usage {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid #cfe8dd;
  border-radius: 999px;
  color: #0d745a;
  background: #eef9f4;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.march-usage.warning { color: #8a5a12; border-color: #ead8b8; background: #fff8ea; }
.march-usage.exhausted { color: var(--danger); border-color: #eccccc; background: #fff2f2; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #8e9398; }
[data-state='ready'] .status-dot { background: var(--accent); }
[data-state='busy'] .status-dot, [data-state='loading'] .status-dot { background: #bb9b31; }
[data-state='error'] .status-dot, [data-state='offline'] .status-dot { background: var(--danger); }
.chat { padding: 26px max(22px, calc((100% - 800px) / 2)) 24px; gap: 22px; min-height: 0; }
.march-access-notice {
  width: 95%;
  max-width: 768px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  margin: 8px auto 4px;
  padding: 13px 14px;
  border: 1px solid #e7c9b3;
  border-radius: 12px;
  color: #39261d;
  background: #fff7ef;
}
.march-access-notice.limit { border-color: #ead8b8; background: #fff9eb; }
.march-access-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #9d4c25;
  background: #ffe5d5;
}
.march-access-notice.limit .march-access-icon { color: #8a5a12; background: #f8e7bd; }
.march-access-copy { min-width: 0; display: grid; gap: 2px; }
.march-access-copy strong { font-size: 13px; }
.march-access-copy span { color: #745c50; font-size: 11px; line-height: 1.35; }
.march-access-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 8px;
  color: #fff;
  background: #202124;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.march-access-action:hover { background: var(--accent); }
.input-area.access-locked { box-shadow: none; }
.input-area.access-locked textarea { color: var(--muted); }
.message { max-width: 100%; width: auto; margin: 0; padding: 0; line-height: 1.65; font-size: 15px; overflow-wrap: anywhere; flex-shrink: 0; }
.message.user { background: #10a37f; color: #fff; max-width: 85%; padding: 10px 16px; border-radius: 8px 8px 0 8px; white-space: pre-wrap; }
.message.user .icon-btn { color: inherit; }
.message.bot { color: var(--text); width: 100%; }
.message .bot-content { min-width: 0; }
.message h1, .message h2, .message h3 { font-size: 18px; margin: 16px 0 8px; }
.message a { color: var(--accent); text-decoration: underline; }
.message table { display: block; overflow-x: auto; width: 100%; }
.message pre { max-width: 100%; white-space: pre; overflow-x: auto; padding: 16px; border-radius: 8px; }
.message pre::before { display: none; }
.message pre code { font-size: 13px; line-height: 1.6; }
.copy-answer { width: 28px; height: 28px; font-size: 13px; margin-top: 8px; }
.message-actions { display: flex; gap: 4px; align-items: center; }
.message.user .message-actions { justify-content: flex-end; margin-top: 4px; }
.message.user .copy-answer { margin-top: 0; }
.message-actions .icon-btn { width: 28px; height: 28px; font-size: 13px; }
.message-media { display: grid; gap: 8px; width: min(100%, 560px); margin: 0 0 10px; }
.message-media img { display: block; width: 100%; max-width: 100%; max-height: 520px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-main); }
.message.user .message-media { width: min(100%, 360px); }
.message-audio {
  width: min(100%, 390px);
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-main));
}
.message-audio-element { display: none; }
.message-audio-play {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 21px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.message-audio-play:hover { transform: scale(1.04); background: #0f755f; }
.message-audio-play:disabled { cursor: wait; }
.message-audio.playing .message-audio-play { background: #202124; }
.message-audio-body { min-width: 0; display: grid; gap: 8px; }
.message-audio-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; line-height: 1.2; }
.message-audio-top strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.message-audio-top span { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.message-audio-progress {
  --audio-progress: 0%;
  width: 100%;
  height: 14px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.message-audio-progress::-webkit-slider-runnable-track { height: 3px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--audio-progress), color-mix(in srgb, var(--text) 14%, transparent) var(--audio-progress)); }
.message-audio-progress::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; border: 2px solid var(--bg-main); border-radius: 50%; appearance: none; -webkit-appearance: none; background: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.message-audio-progress::-moz-range-track { height: 3px; border-radius: 999px; background: color-mix(in srgb, var(--text) 14%, transparent); }
.message-audio-progress::-moz-range-progress { height: 3px; border-radius: 999px; background: var(--accent); }
.message-audio-progress::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid var(--bg-main); border-radius: 50%; background: var(--accent); }
.message-audio.unavailable { opacity: .58; }
.message-document {
  width: min(100%, 390px);
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text) !important;
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-main));
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.message-document:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--bg-main)); }
.message-document-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--bg-main)); font-size: 20px; }
.message-document-body { min-width: 0; display: grid; gap: 3px; line-height: 1.25; }
.message-document-body strong { overflow: hidden; color: inherit; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.message-document-body > span { color: var(--muted); font-size: 10px; }
.message-document-action { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); text-decoration: none; }
.message-document:hover .message-document-action { color: #fff; border-color: var(--accent); background: var(--accent); }
.message-document.unavailable { opacity: .58; pointer-events: none; }
.message.user .message-audio, .message.user .message-document { border-color: #ffffff35; color: #fff !important; background: #ffffff13; }
.message.user .message-audio-play { color: var(--accent); background: #fff; }
.message.user .message-audio-top span, .message.user .message-document-body > span { color: #ffffffe0; }
.message.user .message-audio-progress::-webkit-slider-runnable-track { background: linear-gradient(to right, #fff var(--audio-progress), #ffffff55 var(--audio-progress)); }
.message.user .message-audio-progress::-webkit-slider-thumb { border-color: #10a37f; background: #fff; }
.message.user .message-document-icon { color: #fff; background: #ffffff20; }
.message.user .message-document-action { color: #fff; border-color: #ffffff45; }
.message.user .message-document:hover .message-document-action { color: var(--accent); border-color: #fff; background: #fff; }
.document-viewer {
  flex: 0 0 clamp(420px, 46vw, 720px);
  width: clamp(420px, 46vw, 720px);
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg-main);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 34px #0000000c;
  overflow: hidden;
  z-index: 1200;
}
.document-viewer[hidden] { display: none; }
.document-viewer-header {
  flex: 0 0 60px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px 9px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-main) 97%, var(--accent));
}
.document-viewer-heading { min-width: 0; display: grid; gap: 2px; }
.document-viewer-heading strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.document-viewer-kind { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.document-viewer-actions { display: flex; gap: 6px; }
.document-viewer-actions a, .document-viewer-actions button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}
.document-viewer-actions a:hover, .document-viewer-actions button:hover { border-color: var(--line); background: var(--new-chat-bg-hover); }
.document-viewer-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.document-viewer-loading, .document-viewer-empty {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}
.document-viewer-empty > i { color: var(--accent); font-size: 34px; }
.document-viewer-empty strong { color: var(--text); font-size: 15px; }
.document-viewer-empty span { max-width: 330px; font-size: 12px; line-height: 1.5; }
.document-viewer-markdown { max-width: 760px; margin: 0 auto; padding: 48px clamp(28px, 6vw, 64px) 80px; font-size: 15px; line-height: 1.72; }
.document-viewer-markdown > :first-child { margin-top: 0; }
.document-viewer-markdown h1 { margin: 0 0 24px; font-size: clamp(27px, 3vw, 36px); line-height: 1.15; letter-spacing: -.025em; }
.document-viewer-markdown h2 { margin: 34px 0 14px; font-size: 22px; line-height: 1.25; }
.document-viewer-markdown h3 { margin: 26px 0 10px; font-size: 17px; }
.document-viewer-markdown p, .document-viewer-markdown ul, .document-viewer-markdown ol, .document-viewer-markdown table, .document-viewer-markdown pre { margin: 0 0 17px; }
.document-viewer-markdown table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; font-size: 13px; }
.document-viewer-markdown th, .document-viewer-markdown td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.document-viewer-markdown a { color: var(--accent); }
.document-viewer-markdown pre, .document-viewer-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.document-viewer-text { min-height: 100%; margin: 0; padding: 40px clamp(24px, 5vw, 56px) 70px; color: var(--text); background: transparent; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.document-viewer-frame { width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.live-content { white-space: pre-wrap; }
.edit-warning { font-size: 12px; color: var(--muted); margin-top: 10px; }
.reasoning { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.reasoning summary { cursor: pointer; padding: 4px 0; width: fit-content; }
.reasoning-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 10px; border-left: 2px solid var(--line); padding-left: 14px; line-height: 1.6; }
.interrupted-checkpoint { width: fit-content; display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; padding: 6px 9px; border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--accent) 6%, var(--bg-main)); font-size: 12px; line-height: 1; }
.interrupted-checkpoint i { color: var(--accent); }
.interrupted-checkpoint.failed { border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); background: color-mix(in srgb, var(--danger) 6%, var(--bg-main)); }
.interrupted-checkpoint.failed i { color: var(--danger); }
.message.bot.interrupted .bot-content { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.pending-message { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 4px 0; }
.spinner { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.input-area { position: relative; flex: 0 0 auto; bottom: auto; left: auto; transform: none; margin: 6px auto max(20px, env(safe-area-inset-bottom)); }
.input-inner { position: relative; }
.input-area textarea { width: 100%; min-width: 0; color: var(--text); }
.input-area textarea:focus-visible { outline: none; }
.input-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-actions { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; }
.input-area .voice-btn { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.input-area .voice-btn:hover { background: var(--bg-hover, #eef0f2); color: var(--text); }
.input-area .voice-btn:not(:disabled) i { color: #fff !important; }
.input-area .voice-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; }
.input-area .voice-btn.recording i { color: #fff !important; }
.pending-media { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; }
.pending-media-item { position: relative; flex: 0 0 72px; width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg-main); }
.pending-media-item img { width: 100%; height: 100%; object-fit: cover; }
.pending-media-item button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #17191cdd; color: #fff; cursor: pointer; }
.mode-controls { display: flex; align-items: center; gap: 18px; }
.mode-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.mode-toggle input { accent-color: var(--accent); width: 13px; height: 13px; }
.mode-toggle:has(input:checked) { color: var(--accent); }
.input-area .send-btn { background: #10a37f; }
.input-area .send-btn:hover { background: var(--accent); }
.input-area .send-btn.voice-mode-action {
  background: #10a37f; color: #fff; border: 0; box-shadow: none;
}
.input-area .send-btn.voice-mode-action:hover { background: #0d8a68; color: #fff; }
.minimal-wave { display: inline-flex; align-items: center; justify-content: center; gap: 2px; height: 16px; }
.minimal-wave i { display: block; width: 2px; border-radius: 999px; background: #fff; }
.minimal-wave i:nth-child(1), .minimal-wave i:nth-child(4) { height: 6px; }
.minimal-wave i:nth-child(2) { height: 13px; }
.minimal-wave i:nth-child(3) { height: 9px; }
.input-area .send-btn.voice-mode-action.active { box-shadow: 0 0 0 2px var(--accent); }
.input-area .send-btn.stop-action { background: #161916; color: #fff; }
.input-area .send-btn.stop-action:hover { background: #303630; }
.input-area .send-btn:disabled { opacity: .45; cursor: not-allowed; }
.composer-status { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.composer-status:empty { display: none; }
.slash-menu { position: absolute; z-index: 40; left: 0; right: 0; bottom: calc(100% + 10px); padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-main); box-shadow: 0 12px 34px #1015131c; }
.slash-menu[hidden] { display: none; }
.slash-menu button { width: 100%; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 9px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.slash-menu button:hover, .slash-menu button:focus-visible { outline: 0; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.slash-menu button > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.slash-menu button span { min-width: 0; display: grid; gap: 2px; }
.slash-menu strong { font-size: 12px; }
.slash-menu small { color: var(--muted); font-size: 10px; }
.goal-composer-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--accent) 5%, var(--bg-main)); }
.composer-mode-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.composer-mode-chips[hidden] { display: none; }
.composer-mode-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; width: fit-content; padding: 4px 5px 4px 9px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 999px; color: var(--text); background: color-mix(in srgb, var(--accent) 5%, var(--bg-main)); font-size: 11px; line-height: 1; }
.composer-mode-chip > i { color: var(--accent); font-size: 12px; }
.composer-mode-chip button { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.composer-mode-chip button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.composer-mode-chip button i { font-size: 9px; }
.goal-composer-card[hidden] { display: none; }
.goal-card-main { min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.goal-card-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--accent); }
.goal-card-copy { min-width: 0; display: grid; gap: 2px; }
.goal-card-copy strong, .goal-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-card-copy strong { font-size: 12px; font-weight: 650; }
.goal-card-copy small { color: var(--muted); font-size: 10px; }
.goal-card-actions { display: flex; gap: 4px; }
.goal-card-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.goal-card-actions button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.goal-card-actions button[hidden], .goal-dialog-actions button[hidden] { display: none; }
.goal-dialog { width: min(650px, calc(100% - 28px)); }
.goal-dialog-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }
.goal-dialog-status span { color: var(--accent); font-weight: 650; }
.goal-dialog section { margin-top: 16px; }
.goal-dialog section h3 { margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.goal-dialog section p { max-height: 210px; overflow: auto; padding: 12px; border-radius: 9px; color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.goal-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.goal-dialog-actions .secondary-btn { display: inline-flex; align-items: center; gap: 6px; }
.empty-state { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; width: calc(100% - 48px); height: auto; color: var(--text); }
.empty-state p { font-size: 24px; font-weight: 500; margin-top: 14px; }
.empty-content img { border-radius: 8px; }
.login-view { min-height: 100dvh; display: grid; place-items: center; background: var(--bg-main); padding: 24px; }
.login-form { width: min(100%, 340px); display: flex; flex-direction: column; gap: 10px; }
.login-form img { border-radius: 8px; margin: 0 auto; }
.login-form h1 { text-align: center; font-size: 28px; font-weight: 600; margin: 4px 0 24px; }
.login-form label, .settings-dialog label { font-size: 13px; font-weight: 500; margin-top: 8px; display: block; }
.login-form input, .settings-dialog input, .settings-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; color: var(--text); background: var(--bg-main); font-size: 15px; }
.primary-btn { border: 0; background: var(--text); color: var(--bg-main); padding: 11px 18px; border-radius: 6px; font-size: 14px; cursor: pointer; display: inline-flex; gap: 10px; align-items: center; justify-content: center; }
.primary-btn:hover { background: var(--accent); color: #fff; }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; overflow-wrap: anywhere; }
.settings-dialog { margin: auto; width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-main); color: var(--text); padding: 22px; }
.settings-dialog::backdrop { background: #0005; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dialog-header h2 { font-size: 18px; font-weight: 600; }
.settings-dialog textarea { resize: vertical; margin-top: 7px; line-height: 1.6; }
.settings-dialog input { margin-top: 7px; }
.settings-dialog .mode-toggle { display: flex; margin-top: 14px; }
.settings-dialog .mode-toggle input { flex: 0 0 14px; width: 14px; height: 14px; padding: 0; margin: 0; }
.dialog-actions { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.microphone-dialog { width: min(430px, calc(100% - 28px)); }
.microphone-permission-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 2px auto 16px; border-radius: 50%; background: #10a37f; color: #fff; font-size: 24px; }
.microphone-dialog > p { color: var(--muted); font-size: 14px; line-height: 1.55; text-align: center; }
.microphone-recovery { display: grid; gap: 8px; margin: 18px 0 0; padding-left: 24px; color: var(--text); font-size: 14px; line-height: 1.45; }
.microphone-android-hint { margin-top: 14px; font-size: 12px !important; }
.microphone-dialog-actions { justify-content: center; margin-top: 22px; }
.microphone-dialog-actions .primary-btn { min-width: 220px; }
.danger { color: var(--danger); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(460px, calc(100% - 32px)); max-height: min(180px, 40dvh); overflow: auto; background: var(--text); color: var(--bg-main); border-radius: 10px; padding: 12px 16px; z-index: 10000; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; box-shadow: 0 4px 20px #0002; }
.dark-theme { --bg-main: #222426; --bg-sidebar: #191b1d; --bg-chat: #191b1d; --text: #e9ebed; --muted: #a0a6ac; --line: #393d41; --accent: #68bca3; --sidebar-text-color: #e9ebed; --new-chat-bg-hover: #303437; --toggle-btn-color: #a0a6ac; --danger: #ee9696; }
.dark-theme .input-area { background: #282b2e; border-color: var(--line); }
.dark-theme .message.user { background: #303c38; color: #e0eee8; }
.dark-theme .input-area .send-btn { background: #10a37f; color: #fff; }
.dark-theme .input-area .send-btn.stop-action { background: #e7ece7; color: #161916; }
.dark-theme .input-area .send-btn.stop-action:hover { background: #fff; }
.dark-theme .input-area .send-btn.voice-mode-action { background: #10a37f; color: #fff; }
.dark-theme .input-area .send-btn.voice-mode-action:hover { background: #0d8a68; }
.dark-theme .input-area .voice-btn { background: transparent; color: var(--muted); border-color: var(--line); }
.dark-theme .input-area .voice-btn.recording { background: var(--danger); color: #fff; }
.dark-theme .march-usage { color: #a3dccb; border-color: #3f675b; background: #263d36; }
.dark-theme .march-usage.warning { color: #e8ca8c; border-color: #66583c; background: #3d382b; }
.dark-theme .march-usage.exhausted { color: #f0adad; border-color: #704949; background: #422f2f; }
.dark-theme .march-access-notice { color: #f2ddd2; border-color: #674b3e; background: #382d28; }
.dark-theme .march-access-notice.limit { color: #efe2c5; border-color: #685b3e; background: #3a3529; }
.dark-theme .march-access-copy span { color: #c8b2a7; }
.dark-theme .march-access-icon { color: #f0b28e; background: #593b2d; }
.dark-theme .march-access-notice.limit .march-access-icon { color: #f0d190; background: #584a2d; }
.dark-theme .march-access-action { color: #202124; background: #e9ebed; }
.dark-theme .space-nav-icon { background: #242729; }
.dark-theme .space-preview.document { color: #a3c6bc; background: #27332f; }
.dark-theme .space-preview.audio { color: #c0acd9; background: #332e3a; }
.dark-theme .space-filters button[aria-pressed='true'] { color: #202124; background: #e9ebed; }
.toolbar-btn { min-height: 36px; white-space: nowrap; }
.toolbar-btn.active { border: 1px solid transparent; }
.toolbar-btn[disabled] { opacity: .5; }
.cancel-job {
  margin-left: 6px; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 9px; color: var(--danger); background: transparent;
  font: inherit; font-size: 12px; cursor: pointer;
}
.cancel-job:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.cancel-job:disabled { opacity: .55; cursor: wait; }
.resource-status { color: var(--muted); font-size: 11px; }
@media (max-width: 520px) { .resource-status { display: none; } }
.agent-actions { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.agent-actions summary { cursor: pointer; }
.agent-actions-list { display: grid; gap: 8px; margin-top: 8px; }
.agent-action { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.agent-action pre { margin: 6px 0 0; max-height: 180px; overflow: auto; white-space: pre-wrap; font: inherit; }
.agent-blocks { display: grid; gap: 8px; margin: 0 0 12px; }
.agent-block {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; align-items: start;
  padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent));
  border-radius: 12px; background: color-mix(in srgb, var(--surface) 95%, var(--accent));
  color: var(--text); font-size: 13px; line-height: 1.45;
}
.agent-block > i { color: var(--accent); font-size: 15px; margin-top: 1px; }
.agent-block strong { display: block; font-weight: 650; }
.agent-block p { margin: 3px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-block.artifact { background: var(--surface); }
.live-agent-blocks:empty { display: none; }
.input-toolbar-2 { flex-wrap: nowrap; align-items: center; width: 100%; }
.input-toolbar-2-wrapper { min-width: 0; flex: 1 1 auto; }
.toolbar-spacer { flex: 1 1 auto; min-width: 6px; }
.tooltip-custom { top: auto; bottom: calc(100% + 8px); max-width: 260px; white-space: normal; width: max-content; text-align: center; }
.btn-with-tooltip:hover > .tooltip-custom { opacity: 1; visibility: visible; transition-delay: 0s; }
.tooltip-custom::after {
  content: "";
  position: absolute;
  inset: auto auto -4px 50%;
  width: 8px;
  height: 8px;
  border: 0;
  background-color: inherit;
  transform: translateX(-50%) rotate(45deg);
}
input[hidden] { display: none !important; }
.tool-menu { position: relative; display: inline-flex; }
.compact-chevron { font-size: 10px; }
.tool-popover {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 10020;
  transform: translateX(-50%); width: 220px; padding: 6px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-main);
  box-shadow: 0 10px 32px #0003;
}
.tool-popover[hidden] { display: none; }
.tool-popover button {
  display: flex; flex-direction: column; width: 100%; gap: 2px; border: 0;
  border-radius: 7px; padding: 8px 10px; text-align: left; color: var(--text);
  background: transparent; cursor: pointer;
}
.tool-popover button:hover, .tool-popover button.active { background: var(--new-chat-bg-hover); }
.tool-popover small { color: var(--muted); font-size: 11px; }
.context-meter {
  --context-value: 0%; position: relative; display: grid; place-items: center;
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  background: conic-gradient(#10a37f var(--context-value), var(--line) 0);
  color: var(--text); font-size: 9px; font-variant-numeric: tabular-nums;
}
.context-meter::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg-main); }
.context-meter > span:first-child { position: relative; z-index: 1; }
.context-meter.compressed { background: conic-gradient(#d99614 var(--context-value), var(--line) 0); }
.pending-media-item.document { width: auto; min-width: 180px; max-width: 320px; height: 58px; padding: 8px 36px 8px 10px; display: flex; gap: 8px; align-items: center; }
.pending-media-item.document .document-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.dark-theme .toolbar-btn { color: var(--text); border-color: var(--line); }
.dark-theme .toolbar-btn.active { background: #3b4145; }
.dark-theme .toolbar-btn:hover { background: #383d40; }
.composer-tool-menu { position: relative; display: inline-flex; }
.dropdown-content {
  display: none; position: absolute; left: 0; right: auto; bottom: calc(100% + 10px);
  width: min(430px, calc(100vw - 32px)); min-width: 300px; max-height: min(470px, calc(100dvh - 160px));
  overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-main); box-shadow: 0 16px 44px #0003; z-index: 10030;
}
.dropdown-content.show { display: grid; gap: 2px; }
.composer-menu-item {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 10px;
  border: 0; border-radius: 10px; color: var(--text); background: transparent;
  text-align: left; cursor: pointer;
}
.composer-menu-item[hidden] { display: none; }
.composer-menu-item:hover, .composer-menu-item.active { background: var(--new-chat-bg-hover, #eef0f2); }
.composer-menu-item.active::after { content: '\2713'; color: var(--accent); font-weight: 700; text-align: center; }
.composer-menu-item > i { color: var(--muted); font-size: 17px; text-align: center; }
.composer-menu-item.active > i { color: var(--accent); }
.composer-menu-item .menu-copy { display: grid; gap: 3px; min-width: 0; }
.composer-menu-item .menu-copy strong { font-size: 14px; font-weight: 500; }
.composer-menu-item .menu-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.composer-menu-item:disabled { cursor: not-allowed; }
.drop-overlay {
  position: fixed; inset: 12px; z-index: 20000; pointer-events: none;
  display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 18px;
  background: color-mix(in srgb, var(--bg-main) 90%, var(--accent)); backdrop-filter: blur(4px);
}
.drop-overlay > div { display: grid; justify-items: center; gap: 8px; color: var(--text); }
.drop-overlay i { color: var(--accent); font-size: 34px; }
.drop-overlay strong { font-size: 18px; }
.drop-overlay span { color: var(--muted); font-size: 13px; }
.voice-overlay {
  position: absolute; inset: 0; z-index: 2600; display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto; gap: 18px;
  padding: max(22px, env(safe-area-inset-top)) clamp(18px, 4vw, 52px) max(24px, env(safe-area-inset-bottom));
  color: var(--text); overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, #10a37f17 0, #10a37f08 27%, transparent 56%),
    var(--bg-main);
}
.voice-overlay[hidden] { display: none; }
.voice-overlay::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: linear-gradient(#10a37f08 1px, transparent 1px), linear-gradient(90deg, #10a37f08 1px, transparent 1px);
  background-size: 42px 42px; mask-image: radial-gradient(circle, #000, transparent 78%);
}
.voice-overlay-header { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; }
.voice-overlay-header > div { display: grid; gap: 4px; }
.voice-overlay-header strong { font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.voice-overlay-header span { color: var(--muted); font-size: 13px; }
.voice-overlay-close {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg-main); color: var(--text); cursor: pointer;
}
.voice-overlay-close:hover { background: var(--new-chat-bg-hover, #eef0f2); }
.voice-stage { position: relative; z-index: 1; display: grid; place-items: center; min-height: 180px; }
.jarvis-visualizer {
  --voice-color: #7b8991; --voice-soft: #dce3e6; --voice-glow: #7b899170;
  position: relative; width: min(44vmin, 290px); aspect-ratio: 1; display: grid; place-items: center;
}
.jarvis-visualizer[data-state="listening"] { --voice-color: #10a37f; --voice-soft: #67ead2; --voice-glow: #21b99580; }
.jarvis-visualizer[data-state="processing"] { --voice-color: #d18b16; --voice-soft: #ffd784; --voice-glow: #e5a32d80; }
.jarvis-visualizer[data-state="thinking"] { --voice-color: #725bd8; --voice-soft: #b8aaff; --voice-glow: #806ce680; }
.jarvis-visualizer[data-state="speaking"] { --voice-color: #168aad; --voice-soft: #70d6f0; --voice-glow: #1ca5cb80; }
.jarvis-visualizer::before {
  content: ''; position: absolute; inset: 21%; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 4%, var(--voice-soft) 10%, var(--voice-color) 36%, color-mix(in srgb, var(--voice-color) 72%, #092f2a) 58%, transparent 70%);
  filter: drop-shadow(0 0 18px var(--voice-glow)); animation: jarvis-breathe 2.8s ease-in-out infinite;
  transition: background .3s ease, filter .3s ease;
}
.jarvis-ring { position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--voice-color) 46%, transparent); transition: border-color .3s ease; }
.ring-one { inset: 5%; border-width: 2px 1px 1px 2px; animation: jarvis-spin 8s linear infinite; }
.ring-two { inset: 14%; border-style: dashed; opacity: .62; animation: jarvis-spin 12s linear infinite reverse; }
.ring-three { inset: 28%; box-shadow: 0 0 22px color-mix(in srgb, var(--voice-color) 25%, transparent) inset; animation: jarvis-pulse 2.2s ease-in-out infinite; }
.jarvis-core { position: relative; z-index: 2; display: grid; place-items: center; width: 26%; aspect-ratio: 1; border-radius: 50%; color: #fff; font-size: clamp(24px, 5vmin, 42px); }
.jarvis-wave { height: 30px; gap: 4px; }
.jarvis-wave i { width: 3px; }
.jarvis-wave i:nth-child(1), .jarvis-wave i:nth-child(4) { height: 11px; }
.jarvis-wave i:nth-child(2) { height: 27px; }
.jarvis-wave i:nth-child(3) { height: 19px; }
.voice-bars { position: absolute; z-index: 3; bottom: 13%; display: flex; align-items: center; gap: 5px; height: 30px; }
.voice-bars i { display: block; width: 3px; height: 7px; border-radius: 9px; background: var(--voice-color); box-shadow: 0 0 6px var(--voice-glow); transition: background .3s ease; }
.jarvis-visualizer[data-state="listening"] .voice-bars i,
.jarvis-visualizer[data-state="speaking"] .voice-bars i { animation: voice-bar 1s ease-in-out infinite; }
.voice-bars i:nth-child(2) { animation-delay: -.7s !important; }
.voice-bars i:nth-child(3), .voice-bars i:nth-child(5) { animation-delay: -.35s !important; }
.voice-bars i:nth-child(4) { animation-delay: -.85s !important; }
.jarvis-visualizer[data-state="thinking"] .ring-two,
.jarvis-visualizer[data-state="processing"] .ring-two { animation-duration: 2.8s; opacity: 1; }
@keyframes jarvis-spin { to { transform: rotate(360deg); } }
@keyframes jarvis-breathe { 50% { transform: scale(1.08); filter: drop-shadow(0 0 30px var(--voice-glow)); } }
@keyframes jarvis-pulse { 50% { transform: scale(.94); opacity: .55; } }
@keyframes voice-bar { 0%, 100% { height: 6px; opacity: .55; } 50% { height: 26px; opacity: 1; } }
.voice-transcript-wrap {
  position: relative; z-index: 2; width: min(760px, 100%); margin: 0 auto;
  border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--bg-main) 94%, #10a37f);
  box-shadow: 0 16px 42px #00000012; backdrop-filter: blur(18px); overflow: hidden;
}
.voice-transcript-heading { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px 8px; color: var(--text); font-size: 12px; }
.voice-transcript-heading span { color: var(--muted); }
.voice-transcript { min-height: 76px; max-height: min(24vh, 190px); padding: 0 16px 14px; overflow-y: auto; scroll-behavior: smooth; }
.voice-transcript-empty { color: var(--muted); font-size: 14px; line-height: 1.5; }
.voice-transcript-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.voice-transcript-row strong { color: #0d8a68; font-size: 12px; }
.voice-transcript-row.assistant strong { color: var(--text); }
.voice-transcript-row p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.48; white-space: pre-wrap; }
.voice-transcript-row.assistant.queued { opacity: .58; }
.voice-transcript-row.assistant.speaking { margin-inline: -8px; padding-inline: 8px; border-radius: 9px; background: color-mix(in srgb, #168aad 9%, transparent); }
.voice-transcript-row.assistant.speaking strong { color: #168aad; }
.voice-transcript-row.assistant.interrupted { opacity: .48; }
.voice-transcript-row.assistant.interrupted p { text-decoration: line-through; text-decoration-thickness: 1px; }
.voice-listening-dots { display: flex; align-items: center; gap: 5px; min-height: 21px; }
.voice-listening-dots i { width: 6px; height: 6px; border-radius: 50%; background: #10a37f; animation: voice-listening-dot 1.1s ease-in-out infinite; }
.voice-listening-dots i:nth-child(2) { animation-delay: .16s; }
.voice-listening-dots i:nth-child(3) { animation-delay: .32s; }
.processing-speech p { color: #b4740d; }
@keyframes voice-listening-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
.voice-overlay-actions { position: relative; z-index: 2; display: flex; justify-content: center; }
.voice-overlay-mic {
  display: grid; place-items: center; width: 58px; height: 58px; padding: 0;
  border: 1px solid #81ffe86b; border-radius: 50%; background: #10a37f; color: #fff;
  font-size: 23px; box-shadow: 0 0 0 8px #10a37f1f, 0 8px 28px #0008; cursor: pointer;
}
.voice-overlay-mic:hover { background: #16b78f; }
.voice-overlay-mic.recording { background: #e25555; border-color: #ffb1b1; animation: mic-pulse 1.5s ease-in-out infinite; }
.voice-overlay-mic:disabled { opacity: .45; cursor: wait; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 15px #e2555526, 0 8px 28px #0008; } }
.dark-theme .icon-btn, .dark-theme .input-area textarea { color: var(--text); }
.dark-theme .empty-state, .dark-theme .message.bot { color: var(--text); }
.sidebar-backdrop { display: none; }
@media (max-width: 760px) {
  .toolbar-btn { padding: 6px 9px; font-size: 12px; gap: 5px; }
  .context-meter { flex-basis: 32px; width: 32px; height: 32px; }
  .input-toolbar-2 { gap: 6px; }
  .toolbar-btn.add-doc { width: 32px; height: 32px; min-height: 32px; }
  .mobile-hidden { display: none; }
  .dropdown-content { min-width: 0; width: min(380px, calc(100vw - 48px)); }
  .sidebar .chat-actions { visibility: visible; opacity: 1; }
  .model-version { display: none; }
  .main .title { display: none; }
  .main > .header { padding-left: 60px; }
  .sidebar { position: fixed; top: 0; left: 0; width: 260px; height: 100dvh; z-index: 1500; }
  .sidebar.collapsed { width: 260px; transform: translateX(-100%); }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; border: 0; background: #0005; z-index: 1400; }
  .chat { padding: 20px 16px; }
  .message { font-size: 15px; }
  .input-area { width: calc(100% - 24px); margin-bottom: max(12px, env(safe-area-inset-bottom)); }
  .march-access-notice {
    width: calc(100% - 24px);
    grid-template-columns: auto 1fr;
    margin-top: 6px;
    padding: 12px;
  }
  .march-access-action { grid-column: 1 / -1; justify-content: center; }
  .mode-controls { gap: 12px; }
  .service-bar { padding: 8px 16px; gap: 8px; }
  .space-view { padding: 24px 14px 42px; }
  .schedule-view { padding: 24px 14px 42px; }
  .schedule-heading { align-items: flex-start; }
  .schedule-heading h1 { font-size: 31px; }
  .schedule-card { grid-template-columns: 38px minmax(0, 1fr); gap: 11px; }
  .schedule-card-icon { width: 38px; height: 38px; }
  .schedule-card-actions { grid-column: 2; }
  .schedule-telegram { grid-template-columns: auto 1fr; }
  .schedule-telegram .secondary-btn { grid-column: 1 / -1; }
  .schedule-form-grid, .schedule-options { grid-template-columns: 1fr; }
  .telegram-code-actions { display: grid; grid-template-columns: 1fr; }
  .telegram-code-actions .primary-btn { grid-row: 1; }
  .space-heading { align-items: flex-start; }
  .space-heading h1 { font-size: 31px; }
  .space-heading p { max-width: 230px; }
  .space-tools { align-items: stretch; flex-direction: column; gap: 10px; margin-top: 16px; }
  .space-search { width: 100%; }
  .space-filters { width: 100%; }
  .space-filters button { flex: 1 0 auto; }
  .space-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .space-preview { height: 118px; }
  .space-card-actions { flex-direction: column; }
  .march-usage { order: 3; margin-left: 0; }
  .message.user { max-width: 92%; }
  .message-media img { max-height: 360px; }
  .voice-overlay { gap: 12px; padding-inline: 16px; }
  .jarvis-visualizer { width: min(62vmin, 250px); }
  .voice-transcript-heading span { display: none; }
  .document-viewer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 30000;
    border: 0;
    box-shadow: none;
  }
  .document-viewer-header { padding-top: max(9px, env(safe-area-inset-top)); min-height: calc(60px + env(safe-area-inset-top)); }
  .document-viewer-markdown { padding: 34px 30px max(64px, env(safe-area-inset-bottom)); font-size: 15px; }
}
@media (max-width: 430px) {
  .space-summary { padding: 8px 10px; }
  .space-heading p { font-size: 11px; }
  .space-grid { grid-template-columns: 1fr; }
  .space-preview { height: 165px; }
  .space-card-actions { flex-direction: row; }
}
@media (max-width: 350px) {
  .input-toolbar #contextMeter { display: none; }
  .input-toolbar-2 { gap: 3px; }
  #agentButton, #thinkingButton { padding-inline: 8px; }
}
@media (max-width: 360px) {
  .input-toolbar { gap: 6px; }
  .input-toolbar-2 { gap: 4px; }
  .toolbar-btn { padding: 6px; }
  .toolbar-btn.add-doc { width: 28px; height: 28px; min-height: 28px; flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
