/* Assistant: a prompt rises from the bottom over a gradient blur; the conversation continues in a panel on the right. */
.ask { position: fixed; inset: auto 0 0 0; z-index: 75; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; padding: 0 16px 28px; pointer-events: none; }
.ask[hidden] { display: none; }
.ask-blur {
  position: absolute; inset: auto 0 0 0; height: min(48vh, 440px); pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--paper) 82%, transparent) 0%, color-mix(in srgb, var(--paper) 46%, transparent) 46%, transparent 100%);
  -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3);
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 38%, #0008 68%, transparent 100%); mask-image: linear-gradient(to top, #000 0%, #000 38%, #0008 68%, transparent 100%);
  animation: ask-fade .5s ease both;
}
.ask-suggest { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; pointer-events: auto; animation: ask-rise .6s cubic-bezier(.16, 1, .3, 1) .06s both; }
.ask-suggest button { min-height: 38px; padding: 8px 16px; font-size: 14px; line-height: 20px; color: var(--text); background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); border-radius: 999px; transition: background-color .2s, color .2s; }
.ask-suggest button:hover { background: var(--text); color: var(--paper); text-decoration: none; }
.ask-bar { position: relative; display: flex; align-items: center; gap: 14px; width: min(760px, 100%); min-height: 64px; padding: 8px 8px 8px 22px; pointer-events: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 20px 70px #00000026; animation: ask-rise .55s cubic-bezier(.16, 1, .3, 1) both; }
.ask-mark { flex: 0 0 auto; width: 38px; height: auto; fill: currentColor; filter: none; animation: none; }
.ask-bar input, .ask-panel-form input { flex: 1; min-width: 0; height: 46px; padding: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 18px; line-height: 26px; }
.ask-bar input::placeholder, .ask-panel-form input::placeholder { color: var(--secondary); }
.ask-send { min-height: 46px; padding: 0 22px; font-size: 15px; background: var(--text); color: var(--paper); border-radius: 999px; transition: background-color .2s, color .2s; }
.ask-send:hover { background: var(--accent); color: var(--on-accent, #fff); text-decoration: none; }
.ask-close { width: 46px; height: 46px; display: grid; place-items: center; color: var(--secondary); border-radius: 50%; }
.ask-close svg { width: 14px; height: 14px; }
.ask-close:hover { color: var(--text); background: var(--paper); text-decoration: none; }
html[data-ask=bar] .edition-dock { visibility: hidden; }
.ask-open { display: inline-flex; align-items: center; padding: 6px 4px; border-radius: 8px; }
.ask-open:hover { color: var(--accent-text, var(--accent)); }
.ask-open .edition-glyph { margin: 0 4px; }
.footer-ask { display: none; }
@media (max-width: 1023px) { .footer-ask { display: inline; } }

.ask-panel { position: fixed; z-index: 76; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--surface); color: var(--text); border-left: 1px solid var(--line); box-shadow: -24px 0 80px #0000001a; animation: ask-slide .55s cubic-bezier(.16, 1, .3, 1) both; }
.ask-panel[hidden] { display: none; }
.ask-panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 12px 22px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.ask-panel-head p { flex: 1; margin: 0; font-weight: 500; }
.ask-panel-head [data-ask-clear] { color: var(--secondary); font-size: 13px; padding: 8px; }
.ask-panel-head [data-ask-clear]:hover { color: var(--text); text-decoration: none; }
.ask-note { margin: 0; padding: 10px 22px; font-size: 12px; line-height: 17px; color: var(--secondary); border-bottom: 1px solid var(--line); }
.ask-thread { overflow-y: auto; overscroll-behavior: contain; padding: 22px; display: grid; gap: 14px; align-content: start; }
.ask-question { justify-self: end; max-width: 86%; margin: 6px 0 0; padding: 10px 16px; font-size: 16px; line-height: 22px; background: var(--text); color: var(--paper); border-radius: 18px 18px 4px 18px; animation: ask-rise .45s cubic-bezier(.16, 1, .3, 1) both; }
.ask-reply { display: grid; gap: 10px; animation: ask-rise .6s cubic-bezier(.16, 1, .3, 1) .12s both; }
.ask-text { margin: 0; font-size: 16px; line-height: 23px; }
.ask-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; padding: 10px; color: inherit; background: var(--paper); border-radius: 14px; transition: background-color .2s; }
.ask-card:hover { text-decoration: none; background: color-mix(in srgb, var(--text) 8%, var(--paper)); }
.ask-card img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; }
.ask-card-body { display: grid; gap: 3px; align-content: start; }
.ask-card-meta { font-size: 11px; line-height: 15px; color: var(--secondary); }
.ask-card-title { font-family: 'ONY Lavr', Arial, sans-serif; font-size: 17px; line-height: 1.15; }
.ask-card-excerpt { font-size: 13px; line-height: 18px; color: var(--secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ask-all { justify-self: start; min-height: 42px; display: inline-flex; align-items: center; padding: 8px 18px; background: var(--text); color: var(--paper); border-radius: 999px; font-size: 14px; }
.ask-all:hover { background: var(--accent); color: var(--on-accent, #fff); text-decoration: none; }
.ask-panel-form { display: flex; align-items: center; gap: 10px; margin: 12px; padding: 6px 6px 6px 18px; background: var(--paper); border-radius: 999px; }
html[data-font]:not([data-font=ony]) .ask-card-title { font-family: inherit; }
/* On wide screens the page makes room for the conversation instead of hiding under it. */
@media (min-width: 1280px) {
  body { transition: margin-right .55s cubic-bezier(.16, 1, .3, 1); }
  html[data-ask=panel] body { margin-right: 440px; }
  html[data-ask=panel] .site-chrome { right: 440px; }
}
html[data-immersive] :is(.ask, .ask-panel) { display: none; }
@keyframes ask-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes ask-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ask-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) { .ask-bar { min-height: 56px; padding-left: 16px; gap: 10px; } .ask-mark { width: 30px; } .ask-bar input { font-size: 16px; } .ask-send { padding: 0 16px; } .ask-suggest { display: none; } }
@media (prefers-reduced-motion: reduce) { .ask-bar, .ask-suggest, .ask-blur, .ask-panel, .ask-question, .ask-reply { animation: none; } body { transition: none; } }
@media print { .ask, .ask-panel { display: none !important; } }

/* The bridge mark is wide and low: it takes more width than the old mark did. */
html body svg.ask-mark[data-mark-variant=bridge] { width: 62px; aspect-ratio: 507 / 94; }
@media (max-width: 640px) { html body svg.ask-mark[data-mark-variant=bridge] { width: 48px; } }

/* The assistant is the logo «Мост» itself (public/ask-fold.js), in the prompt, the panel and every reply. */
.ask-avatar { display: block; flex: 0 0 auto; overflow: visible; color: var(--text); fill: currentColor; height: auto; aspect-ratio: 507 / 94; }
.ask-avatar-bar { width: 52px; }
.ask-avatar-head { width: 46px; }
.ask-avatar-reply { width: 36px; margin-bottom: 4px; animation: ask-avatar-in .7s cubic-bezier(.16, 1, .3, 1) both; }
/* thinking: the arch lifts off the frame and settles again, like a lid breathing */
.ask-panel[data-thinking] .ask-avatar [data-part=arch] path { animation: ask-lift 1.15s cubic-bezier(.45, 0, .25, 1) infinite; }
.ask-pending { display: flex; align-items: center; gap: 12px; }
.ask-dots { display: inline-flex; gap: 5px; }
.ask-dots::before, .ask-dots::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--secondary); animation: ask-dot 1s ease-in-out infinite; }
.ask-dots::after { animation-delay: .2s; }
@keyframes ask-lift { 0%, 100% { transform: translateY(0); } 42% { transform: translateY(-22px); } 64% { transform: translateY(1.5px); } }
@keyframes ask-avatar-in { from { opacity: 0; transform: translateY(6px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes ask-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ask-avatar path, .ask-avatar-reply, .ask-dots::before, .ask-dots::after { animation: none; } }

/* Answers from the model: paragraphs as they stream in, a quiet hint under them, the story a question was about. */
.ask-answer { display: grid; gap: 10px; }
.ask-hint { margin: 0; font-size: 13px; line-height: 18px; color: var(--secondary); }
.ask-about { justify-self: end; margin: 8px 0 -8px; font-size: 12px; line-height: 16px; color: var(--secondary); max-width: 86%; text-align: right; }
.ask-note [data-ask-left]:empty { display: none; }
.ask-context { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 22px; font-size: 13px; line-height: 18px; border-bottom: 1px solid var(--line); }
.ask-context[hidden] { display: none; }
/* Fixed rows: the story chip may be hidden, the thread and the form keep their places. */
.ask-panel > .ask-context { grid-row: 2; }
.ask-panel > .ask-thread { grid-row: 3; }
.ask-panel > .ask-panel-form { grid-row: 4; }
.ask-context > span { flex: 1; min-width: 0; }
.ask-context button { flex: 0 0 auto; color: var(--accent-text, var(--accent)); font-size: 13px; }
.ask-context.is-bar { position: relative; pointer-events: auto; width: min(760px, 100%); padding: 10px 18px; background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line); border-radius: 18px; animation: ask-rise .6s cubic-bezier(.16, 1, .3, 1) .03s both; }
.ask-suggest[hidden] { display: none; }
@media (max-width: 640px) { .ask-context.is-bar { font-size: 12px; } }

/* The field that asks the journal (2026-11-13, Max): it waits at the bottom of every page instead of the mark in the masthead.
   It carries the logo «Мост». Scrolling down shrinks it to a small capsule around the logo; scrolling up, the top of the page
   or a pointer over it opens it again with a little overshoot. */
.ask-pill {
  --open: min(330px, calc(100vw - 32px)); --mark: 44px;
  position: fixed; z-index: 61; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0;
  width: var(--open); height: 52px; padding: 0 6px 0 16px; display: flex; align-items: center; gap: 10px; overflow: hidden;
  color: var(--text); background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 12px 44px #0000001f, 0 1px 3px #00000012;
  font-family: 'ONY One', Arial, sans-serif; font-size: 15px; line-height: 20px; text-align: left; white-space: nowrap; cursor: text;
  transition: width .72s cubic-bezier(.34, 1.42, .5, 1), padding .72s cubic-bezier(.34, 1.42, .5, 1), translate .5s cubic-bezier(.16, 1, .3, 1), opacity .3s, box-shadow .4s, background-color .3s, color .3s;
}
.ask-pill:hover { text-decoration: none; box-shadow: 0 16px 52px #0000002b, 0 1px 3px #00000012; }
.ask-pill-mark { flex: 0 0 var(--mark); display: grid; place-items: center; }
html body .ask-pill .ask-pill-mark svg:not([data-mark-variant=bridge]) { display: none !important; }
html body .ask-pill .ask-pill-mark svg { display: block; width: var(--mark); height: auto; aspect-ratio: 507 / 94; fill: currentColor; transition: scale .6s cubic-bezier(.34, 1.42, .5, 1); }
.ask-pill-text { flex: 1; min-width: 0; color: var(--secondary); transition: opacity .35s .12s, translate .55s cubic-bezier(.16, 1, .3, 1) .08s, filter .4s .1s; }
.ask-pill-go {
  flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--text); color: var(--paper);
  transition: opacity .3s .16s, scale .55s cubic-bezier(.34, 1.5, .5, 1) .14s, background-color .2s, color .2s;
}
.ask-pill-go svg { width: 16px; height: 16px; }
.ask-pill:hover .ask-pill-go { background: var(--accent); color: var(--on-accent, #fff); }
/* Small: a capsule just around the logo. */
.ask-pill.is-small { width: calc(var(--mark) + 30px); padding-left: 14px; cursor: pointer; transition: width .5s cubic-bezier(.7, 0, .25, 1), padding .5s cubic-bezier(.7, 0, .25, 1), translate .5s cubic-bezier(.16, 1, .3, 1), opacity .3s, box-shadow .4s, background-color .3s; }
.ask-pill.is-small :is(.ask-pill-text, .ask-pill-go) { opacity: 0; translate: -14px 0; filter: blur(6px); scale: .6; transition-delay: 0s; transition-duration: .22s; }
@media (hover: hover) and (pointer: fine) {
  .ask-pill.is-small:hover { width: var(--open); padding-left: 16px; transition: width .72s cubic-bezier(.34, 1.42, .5, 1), padding .72s cubic-bezier(.34, 1.42, .5, 1), box-shadow .4s; }
  .ask-pill.is-small:hover :is(.ask-pill-text, .ask-pill-go) { opacity: 1; translate: 0 0; filter: none; scale: 1; transition-duration: .35s; transition-delay: .12s; }
}
html[data-ask] .ask-pill { opacity: 0; translate: -50% 24px; pointer-events: none; }
:is(body.flip-page, .desk-page) .ask-pill, html:is([data-immersive], [data-under]) .ask-pill { display: none; }
@media print { .ask-pill { display: none; } }
@media (prefers-reduced-motion: reduce) { .ask-pill, .ask-pill * { transition-duration: .01s !important; transition-delay: 0s !important; } }
.footer-ask { display: none !important; }
/* the pill stands in the middle; the footer keeps room for it */
.site-footer { padding-bottom: max(88px, var(--footer-bottom, 0px)); }

/* The dock keeps one button: theme and type. */
.edition-switch .setup-toggle { display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0; color: var(--secondary); }
.edition-switch .setup-toggle svg { width: 18px; height: 18px; }
.edition-switch .setup-toggle:hover, .edition-switch .setup-toggle[aria-expanded=true] { color: var(--text); }
.edition-switch .setup-toggle::after { display: none; }
.edition-switch:has(.setup-toggle) { padding: 2px; border-radius: 999px; }
@media (max-width: 520px) {
  .ask { padding-inline: 10px; }
  .ask-bar { gap: 8px; padding-left: 12px; }
  .ask-send { padding: 0 14px; }
  .ask-close { width: 38px; }
}

/* Quick commands on a story (2026-11-16): above the prompt they look like the other suggestions and stay on phones as one
   sideways row; in the panel a row of small capsules sits just above the field. */
.ask-commands { display: flex; gap: 6px; padding: 8px 16px 0; overflow-x: auto; scrollbar-width: none; }
.ask-commands::-webkit-scrollbar { display: none; }
.ask-commands[hidden] { display: none; }
.ask-commands button { flex: none; min-height: 30px; padding: 5px 12px; font-size: 13px; line-height: 20px; color: var(--text); background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: background-color .2s, color .2s; }
.ask-commands button:hover { background: var(--text); color: var(--paper); }
@media (max-width: 640px) {
  .ask-suggest.is-commands:not([hidden]) { display: flex; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 0 2px; }
  .ask-suggest.is-commands button { flex: none; min-height: 34px; padding: 6px 14px; font-size: 13px; }
}

/* Sources under a model answer (2026-11-17). */
.ask-sources { margin: 6px 0 -2px; font-size: 12px; letter-spacing: .02em; opacity: .55; }

/* Above the phone keyboard (public/ask.js sets --ask-kb from the visual viewport). */
html body .ask { bottom: var(--ask-kb, 0px); }
html[data-ask-keyboard] body .ask { padding-bottom: 10px; }
html[data-ask-keyboard] body .ask-suggest { display: none; }
html body .ask-panel { bottom: var(--ask-kb, 0px); }
