:root {
  color-scheme: light;
  --u: clamp(1px, .0390625vw, 1.5px);
  --rail: calc(64 * var(--u));
  --sidebar: calc(270 * var(--u));
  --page: #fcfcfc;
  --panel: #fff;
  --text: #202123;
  --muted: #818286;
  --line: #ebebed;
  --soft: #f7f8fa;
  --blue: #1450dc;
  --focus: #4e7aee;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font-size: calc(14 * var(--u)); }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button, a, summary { touch-action: manipulation; }
button { border: 0; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
button svg, a svg, label svg, .sidebar-search-panel > svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 80px; background: var(--blue); color: white; padding: 12px 18px; border-radius: 10px; z-index: 100; }
.skip-link:focus { top: 12px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: calc(32 * var(--u)); height: calc(32 * var(--u)); padding: 0; background: transparent; border-radius: calc(8 * var(--u)); transition: background .16s, color .16s; }
.icon-button:hover { background: var(--soft); }
.rail { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--rail); display: flex; flex-direction: column; align-items: center; padding: calc(35 * var(--u)) 0 calc(30 * var(--u)); }
.brand-mark { width: calc(34 * var(--u)); height: calc(30 * var(--u)); display: flex; align-items: center; }
.brand-mark img { display: block; width: 100%; height: auto; object-fit: contain; }
.rail-top { display: grid; justify-items: center; gap: calc(12 * var(--u)); margin-top: calc(27 * var(--u)); }
.rail-new { display: grid; place-items: center; width: calc(36 * var(--u)); height: calc(36 * var(--u)); background: var(--blue); color: white; border-radius: 50%; padding: 0; transition: background .15s, transform .15s; }
.rail-new svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); stroke-width: 1.8; }
.rail-new:hover, .new-chat-button:hover { background: #0d43c5; }
.rail-new:active { transform: scale(.95); }
.rail-search svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); }
.rail-bottom { margin-top: auto; display: grid; justify-items: center; gap: calc(14 * var(--u)); }
.collapse-rail { color: var(--muted); }
.theme-toggle svg { width: calc(23 * var(--u)); height: calc(23 * var(--u)); }
.profile-link { background: var(--panel); border-radius: 50%; width: calc(38 * var(--u)); height: calc(38 * var(--u)); }
.profile-link svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); }
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); margin: calc(12 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u)) var(--rail); min-height: calc(100svh - 24 * var(--u)); border: 1px solid var(--line); border-radius: calc(28 * var(--u)); overflow: clip; }
.sidebar { min-width: 0; padding: calc(23 * var(--u)) calc(16 * var(--u)); background: var(--panel); border-right: 1px solid var(--line); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; min-height: calc(28 * var(--u)); gap: calc(12 * var(--u)); }
.sidebar-header h2 { margin: 0; font-size: calc(16 * var(--u)); font-weight: 600; }
.sidebar-header-actions { display: flex; gap: calc(7 * var(--u)); }
.chat-modes { display: flex; margin-top: calc(18 * var(--u)); padding: calc(4 * var(--u)); border-radius: calc(14 * var(--u)); background: var(--soft); min-height: calc(40 * var(--u)); white-space: nowrap; }
.mode-tab { padding: calc(7 * var(--u)) calc(10 * var(--u)); background: transparent; border-radius: calc(10 * var(--u)); color: var(--muted); flex: 1; font-size: calc(14 * var(--u)); }
.mode-tab.is-active { color: var(--text); background: var(--panel); box-shadow: 0 2px 4px #10182810; }
.new-chat-button { background: var(--blue); color: #fff; border-radius: calc(12 * var(--u)); display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--u)); min-height: calc(36 * var(--u)); width: 100%; margin-top: calc(12 * var(--u)); padding: calc(8 * var(--u)) calc(12 * var(--u)); font-weight: 600; transition: background .15s; }
.new-chat-button svg { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
.topics { margin-top: calc(24 * var(--u)); padding: 0 calc(8 * var(--u)); color: var(--muted); }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.topics summary, .prompt-ideas summary { display: flex; align-items: center; gap: calc(6 * var(--u)); min-height: calc(24 * var(--u)); }
.topics summary::before, .prompt-ideas summary::before { content: ''; width: 0; height: 0; border-top: calc(4.5 * var(--u)) solid transparent; border-bottom: calc(4.5 * var(--u)) solid transparent; border-left: calc(7 * var(--u)) solid currentColor; transform-origin: center; }
details[open] > summary::before { transform: rotate(90deg); }
.topic-links { display: grid; gap: calc(5 * var(--u)); margin-top: calc(10 * var(--u)); }
.topic-links button { background: transparent; text-align: left; padding: calc(8 * var(--u)); border-radius: 6px; font-size: calc(13 * var(--u)); }
.topic-links button:hover { background: var(--soft); color: var(--text); }
.projects { margin-top: calc(31 * var(--u)); padding-left: calc(8 * var(--u)); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: calc(8 * var(--u)); }
.section-heading h3, .recent h3 { color: var(--muted); font-size: calc(14 * var(--u)); font-weight: 400; margin: 0; }
.section-heading .icon-button { width: calc(30 * var(--u)); height: calc(28 * var(--u)); color: var(--muted); }
.section-heading svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); stroke-width: 1.4; }
.recent { margin-top: calc(35 * var(--u)); }
.empty-state { color: var(--muted); margin: calc(24 * var(--u)) 0 0; line-height: 1.5; }
.sidebar-search-panel { margin-top: 15px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 9px; }
.sidebar-search-panel svg { width: 15px; height: 15px; color: var(--muted); }
.sidebar-search-panel input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: calc(12 * var(--u)); outline: 0; }
.project-list { padding: 0; margin: 0; list-style: none; }
.project-list button { background: transparent; display: flex; align-items: center; gap: 8px; padding: 10px 0; width: 100%; text-align: left; overflow-wrap: anywhere; }
.project-list button:hover { color: var(--blue); }
.project-list svg { width: 16px; height: 16px; }
.workspace { min-width: 0; display: grid; place-items: center; position: relative; }
.welcome { width: min(calc(880 * var(--u)), calc(100% - 64 * var(--u))); padding: calc(44 * var(--u)) 0; text-align: center; }
h1 { font-size: calc(32 * var(--u)); line-height: 1.2; letter-spacing: -.027em; margin: 0 0 calc(26 * var(--u)); font-weight: 600; }
.welcome-heading { display: flex; align-items: center; justify-content: center; gap: calc(12 * var(--u)); font-size: calc(24 * var(--u)); line-height: 1.3; letter-spacing: -.02em; }
.welcome-heading img { display: block; width: calc(34 * var(--u)); height: auto; flex-shrink: 0; }
.welcome-heading span { min-width: 0; text-align: left; }
.composer { background: var(--panel); border: 1px solid var(--line); border-radius: calc(24 * var(--u)); padding: calc(20 * var(--u)) calc(24 * var(--u)); box-shadow: 0 calc(10 * var(--u)) calc(28 * var(--u)) #18202e0a; transition: border-color .18s, box-shadow .18s; text-align: left; }
.composer:focus-within { border-color: #becdf1; box-shadow: 0 calc(10 * var(--u)) calc(28 * var(--u)) #18202e0c; }
.composer textarea { display: block; padding: 0; width: 100%; border: 0; outline: 0; resize: none; min-height: calc(64 * var(--u)); height: calc(64 * var(--u)); max-height: calc(180 * var(--u)); line-height: 1.5; font-size: calc(16 * var(--u)); color: var(--text); background: transparent; }
.composer textarea::placeholder { color: var(--muted); opacity: 1; }
.composer textarea:focus-visible { outline: none; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--u)); margin-top: calc(10 * var(--u)); }
.composer-tools { display: flex; align-items: center; min-width: 0; gap: calc(16 * var(--u)); }
.attach-button { position: relative; background: var(--soft); width: calc(36 * var(--u)); height: calc(36 * var(--u)); flex-shrink: 0; cursor: pointer; }
.attach-button svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); stroke-width: 1.8; }
.attach-button input { position: absolute; opacity: 0; inset: 0; width: 100%; cursor: pointer; }
.attach-button:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.model-picker { position: relative; min-width: 0; }
.model-trigger { display: flex; align-items: center; gap: calc(8 * var(--u)); border-radius: 8px; padding: calc(6 * var(--u)) calc(4 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 500; background: transparent; max-width: 100%; }
.model-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-trigger svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); stroke-width: 1.4; color: #4f5460; }
.model-options { position: absolute; z-index: 15; width: calc(248 * var(--u)); bottom: calc(100% + 12px); left: 0; padding: calc(6 * var(--u)); border: 1px solid var(--line); background: var(--panel); box-shadow: 0 12px 40px #1018281a; border-radius: calc(14 * var(--u)); }
.model-options button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: transparent; border-radius: 9px; padding: calc(10 * var(--u)); }
.model-options button:hover, .model-options button:focus { background: var(--soft); }
.model-options strong { display: block; font-weight: 500; font-size: calc(14 * var(--u)); }
.model-options small { display: block; margin-top: 4px; color: var(--muted); font-size: calc(12 * var(--u)); }
.model-options button[aria-selected="false"] svg { visibility: hidden; }
.model-options svg { color: var(--blue); width: calc(16 * var(--u)); height: calc(16 * var(--u)); }
.send-button { display: grid; place-items: center; width: calc(36 * var(--u)); height: calc(36 * var(--u)); flex-shrink: 0; border-radius: calc(12 * var(--u)); background: var(--blue); color: white; padding: 0; transition: background .15s, transform .15s; }
.send-button svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); stroke-width: 1.8; }
.send-button:disabled { background: #a3bdf4; }
.send-button:not(:disabled):hover { background: #0d43c5; transform: translateY(-1px); }
.prompt-help { display: flex; justify-content: center; gap: calc(16 * var(--u)); color: var(--muted); font-size: calc(12 * var(--u)); line-height: 1.5; margin: calc(16 * var(--u)) 0 0; }
.prompt-error { margin: 12px 0 0; color: #bc3434; text-align: left; line-height: 1.5; }
.quick-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(8 * var(--u)); max-width: calc(760 * var(--u)); margin: calc(48 * var(--u)) auto 0; }
.quick-action { display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--u)); min-height: calc(32 * var(--u)); padding: calc(7 * var(--u)) calc(10 * var(--u)); border-radius: calc(12 * var(--u)); border: 1px solid var(--chip-border); color: var(--chip-color); background: var(--chip-bg); line-height: 1.2; font-size: calc(14 * var(--u)); white-space: nowrap; transition: transform .15s, filter .15s; }
.quick-action svg { width: calc(15 * var(--u)); height: calc(15 * var(--u)); stroke-width: 1.6; }
.quick-action:hover { transform: translateY(-2px); filter: saturate(1.2); }
.presentation { --chip-color: #ff7619; --chip-bg: #fff7f1; --chip-border: #ffdfc8; }
.document { --chip-color: #6289ff; --chip-bg: #f5f8ff; --chip-border: #dbe5ff; }
.table { --chip-color: #00b990; --chip-bg: #f1fbf8; --chip-border: #c6eee3; }
.image { --chip-color: #ff37b1; --chip-bg: #fff3fb; --chip-border: #ffccec; }
.video { --chip-color: #a17aff; --chip-bg: #faf6ff; --chip-border: #eadcff; }
.audio { --chip-color: #79cad4; --chip-bg: #f6fbfc; --chip-border: #e0f0f3; }
.social { --chip-color: #addb8a; --chip-bg: #f9fcf6; --chip-border: #ecf3e6; }
.prompt-ideas { color: var(--muted); margin: calc(20 * var(--u)) auto 0; max-width: calc(620 * var(--u)); }
.prompt-ideas summary { justify-content: center; font-size: calc(13 * var(--u)); }
.prompt-ideas summary::before { border-top-width: calc(4 * var(--u)); border-bottom-width: calc(4 * var(--u)); border-left-width: calc(6 * var(--u)); }
.idea-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.idea-list button { font-size: calc(12 * var(--u)); line-height: 1.5; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.idea-list button:hover { color: var(--text); border-color: #b9c8ef; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.attachment { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.attachment > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.attachment button { background: transparent; display: grid; place-items: center; padding: 2px; }
.attachment svg { width: 14px; height: 14px; }
.mobile-menu { display: none; }
.sidebar-collapsed .app-shell { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding: 0; visibility: hidden; overflow: hidden; }
.sidebar-collapsed .collapse-rail svg { transform: rotate(180deg); }
.site-footer { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: calc(48 * var(--u)); background: #15161a; color: #fff; margin: calc(24 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u)) var(--rail); padding: calc(54 * var(--u)) max(calc(30 * var(--u)), calc((100vw - var(--rail) - 1152 * var(--u)) / 2)); border-radius: calc(24 * var(--u)); }
.site-footer > div { display: flex; flex-direction: column; align-items: flex-start; gap: calc(12 * var(--u)); }
.site-footer .footer-brand { font-size: calc(21 * var(--u)); font-weight: 800; letter-spacing: -.04em; }
.site-footer h2 { margin: 0 0 calc(8 * var(--u)); color: #9599a3; font-size: calc(13 * var(--u)); text-transform: uppercase; letter-spacing: .08em; line-height: 1.5; }
.site-footer p, .site-footer span { margin: 0; color: #9599a3; font-size: calc(14 * var(--u)); line-height: 1.6; }
.site-footer a:not(.footer-brand) { color: #d7d8dd; font-size: calc(14 * var(--u)); line-height: 1.5; transition: color .2s; }
.site-footer a:hover { color: white; text-decoration: underline; text-underline-offset: 3px; }
.project-dialog { padding: 26px; border: 1px solid var(--line); border-radius: 20px; width: min(420px, calc(100% - 32px)); background: var(--panel); color: var(--text); box-shadow: 0 25px 80px #0002; }
.project-dialog::backdrop { background: #11182755; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.project-dialog label { display: block; font-size: 14px; margin-bottom: 10px; }
.project-dialog input { width: 100%; padding: 13px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--page); color: var(--text); }
.project-dialog p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 12px 0 22px; }
.toast { position: fixed; z-index: 50; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--text); color: var(--panel); border-radius: 12px; padding: 12px 20px; box-shadow: 0 8px 30px #0002; font-size: 14px; line-height: 1.5; }
:root[data-theme="dark"] { color-scheme: dark; --page: #1b1c20; --panel: #222329; --text: #f0f0f3; --muted: #9fa1aa; --line: #34353d; --soft: #2b2d34; --blue: #3c70e8; }
[data-theme="dark"] .quick-action { background: color-mix(in srgb, var(--chip-color) 7%, #222329); border-color: color-mix(in srgb, var(--chip-color) 25%, #222329); }
[data-theme="dark"] .social { --chip-color: #addb8a; }
[data-theme="dark"] .model-trigger svg { color: var(--muted); }

@media (max-width: 1200px) {
  :root { --sidebar: 244px; }
  .sidebar { padding-inline: 12px; }
  .mode-tab { font-size: 12px; padding-inline: 8px; }
  .welcome { width: calc(100% - 48px); }
  .quick-actions { max-width: 640px; }
  .quick-action { font-size: 12px; gap: 6px; }
  .site-footer { grid-template-columns: 1.3fr 1fr; padding: 40px; gap: 36px; }
}
@media (max-width: 760px) {
  :root { --rail: 56px; --sidebar: 270px; }
  .rail { padding-top: 24px; padding-bottom: 20px; }
  .brand-mark { width: 30px; height: 27px; }
  .rail-top { margin-top: 28px; gap: 14px; }
  .rail-new { width: 34px; height: 34px; }
  .rail-bottom { gap: 12px; }
  .app-shell, .sidebar-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); margin-top: 8px; margin-right: 8px; margin-bottom: 8px; min-height: calc(100svh - 16px); border-radius: 22px; }
  .sidebar, .sidebar-collapsed .sidebar { position: fixed; z-index: 25; top: 8px; bottom: 8px; left: var(--rail); width: min(280px, calc(100vw - var(--rail) - 16px)); padding: 20px 16px; border: 1px solid var(--line); border-radius: 22px; box-shadow: 20px 0 60px #0002; visibility: hidden; transform: translateX(-130%); overflow-y: auto; transition: transform .2s, visibility .2s; }
  .sidebar-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop { position: fixed; z-index: 24; inset: 0 0 0 var(--rail); background: #15203933; backdrop-filter: blur(2px); }
  .mode-tab { font-size: 14px; }
  .mobile-menu { display: inline-flex; position: absolute; top: 16px; left: 16px; }
  .welcome { width: calc(100% - 32px); padding: 76px 0 48px; }
  h1 { font-size: 29px; margin-bottom: 24px; }
  .welcome-heading { font-size: 22px; gap: 10px; }
  .welcome-heading img { width: 30px; }
  .composer { padding: 18px 16px; border-radius: 22px; }
  .composer textarea { font-size: 15px; height: 90px; min-height: 90px; }
  .composer-toolbar { gap: 8px; }
  .composer-tools { gap: 9px; }
  .model-trigger { font-size: 12px; gap: 5px; padding-inline: 0; }
  .model-options { left: -48px; width: 225px; }
  .prompt-help { font-size: 10px; gap: 8px; flex-wrap: wrap; }
  .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 32px; }
  .quick-action { white-space: normal; min-height: 42px; font-size: 12px; padding: 8px; text-align: left; justify-content: flex-start; }
  .quick-action.social { grid-column: 1 / -1; justify-content: center; }
  .prompt-ideas { margin-top: 20px; }
  .prompt-ideas summary { font-size: 12px; }
  .idea-list { display: grid; }
  .idea-list button { text-align: left; }
  .site-footer { margin-right: 8px; margin-bottom: 8px; margin-top: 20px; padding: 30px 24px; border-radius: 22px; }
}
@media (max-width: 520px) {
  .site-footer { grid-template-columns: 1fr; gap: 32px; }
  .site-footer > div { gap: 10px; }
  .site-footer h2 { margin-bottom: 2px; }
  .prompt-help { gap: 5px; font-size: 9px; }
  h1 { font-size: 26px; }
  .welcome-heading { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* pp.ru footer; shared menu styles remain isolated from layout typography. */
.site-footer { grid-template-columns: 1.3fr 1fr 1.2fr; }
.site-footer .ai-network { margin-top: 12px; }
.site-footer .ai-network > summary span { color: inherit; font: inherit; }
.quick-action { text-decoration: none; }
.topic-links a { display: block; padding: 10px 12px; text-decoration: none; color: inherit; font-size: 14px; border-radius: 8px; }
.topic-links a:hover { background: var(--hover); }
.send-button[data-empty="true"] { background: #a3bdf4; }
@media (max-width: 1000px) { .site-footer { grid-template-columns: 1fr 1fr; } .site-footer .footer-intro { grid-column: 1 / -1; } }
@media (max-width: 560px) { .site-footer { grid-template-columns: 1fr; } }
