/* Examples pages (/examples/). Tokens and chat bubbles follow assistant/app/public/modern.css; page chrome follows
   site/index.html. The build fingerprints this file (examples.<sha10>.css), so nginx serves it immutable. */
:root {
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 22px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #f3f5f8; --panel: #fff; --border: #dbe2ea; --border-strong: #c2cdd8;
  --text: #131922; --text-dim: #4f5d6c; --text-faint: #8593a3;
  --accent: #10b981; --accent-hover: #059669; --accent-subtle: rgba(16,185,129,.09);
  --brand-grad: linear-gradient(135deg,#10b981,#14b8a6 60%,#a3e635);
  --user-bubble: linear-gradient(135deg,#10b981,#14b8a6); --user-bubble-text: #fff;
  --ai-bubble: #fff; --ai-bubble-border: #dbe2ea; --code-bg: #f6f8fb; --hover: rgba(20,30,45,.045);
  --shadow: 0 20px 48px -18px rgba(18,25,38,.12), 0 1px 3px rgba(0,0,0,.04);
  --glow: rgba(16,185,129,.35);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); letter-spacing: -.012em; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background-image: linear-gradient(to right,var(--border) 1px,transparent 1px),linear-gradient(to bottom,var(--border) 1px,transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(circle at 68% 18%,#000,transparent 74%); opacity: .48; }
a { color: inherit; }
main { width: min(100% - 32px, 960px); margin: 0 auto; padding-bottom: 120px; }

/* Header and hero — same voice as the landing */
.feed-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 24px 0 18px; border-bottom: 1px solid var(--border); background: rgba(243,245,248,.94); color: var(--text-faint); font: 500 13px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; backdrop-filter: blur(12px); }
.feed-head::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.feed-head a { text-decoration: none; transition: color .15s; }
.feed-head a:hover { color: var(--accent); }
.feed-head span:last-child { margin-left: auto; color: var(--accent); }
.ex-hero { padding: clamp(40px,8vh,88px) 0 clamp(28px,5vh,48px); }
.meta { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; color: var(--text-faint); font: 500 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.meta b { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; }
.ico, .cat-ico { display: inline-flex; }
.ico svg { width: 14px; height: 14px; }
h1, h2, h3 { margin: 0; letter-spacing: -.05em; text-wrap: balance; }
h1 { font-size: clamp(44px,8vw,84px); font-weight: 650; line-height: .96; }
h1 em { color: var(--accent); font-style: normal; }
h1.chat-title { max-width: 22ch; font-size: clamp(32px,5.4vw,56px); line-height: 1.02; }
h2 { display: flex; align-items: center; gap: 14px; font-size: clamp(30px,5vw,52px); font-weight: 650; line-height: 1; }
.cat-ico { flex: none; width: 46px; height: 46px; padding: 11px; border-radius: 12px; background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px -10px var(--glow); }
.cat-ico svg { width: 100%; height: 100%; }
.lead { max-width: 560px; margin: 26px 0 0; color: var(--text-dim); font-size: clamp(18px,2.5vw,22px); line-height: 1.4; text-wrap: pretty; }
.copy { max-width: 60ch; margin: 18px 0 0; color: var(--text-faint); font-size: 15px; line-height: 1.55; }

/* Index: category chips, sections and cards */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text-dim); font-size: 14px; font-weight: 500; text-decoration: none; transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip b { color: var(--text-faint); font: 500 11px var(--mono); }
.ex-cat { padding: clamp(40px,7vh,72px) 0; border-top: 1px solid var(--border); scroll-margin-top: 70px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 14px; margin-top: 28px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel); text-decoration: none; box-shadow: 0 10px 26px -18px rgba(0,0,0,.12); transition: transform .2s ease, border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 18px 34px -18px rgba(16,185,129,.35); }
.card h3 { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.03em; }
.card p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.card-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.card-files li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--code-bg); color: var(--text-dim); font: 500 11.5px var(--mono); }
.card-files svg { width: 12px; height: 12px; }
.card-go { margin-top: auto; padding-top: 6px; color: var(--accent); font-size: 14px; font-weight: 600; }

/* Summary as «Запрос пользователя / Трактовка эксперта»: the request is the headline under a pale quote watermark,
   the topic shrinks to a caption, the expert's reading is a list on an accent panel */
.card.quote { position: relative; overflow: hidden; }
.card.quote::before { content: "\201C"; position: absolute; right: 12px; top: -30px; font: 800 170px/1 var(--font); color: rgba(16,185,129,.11); pointer-events: none; }
.card.quote > * { position: relative; }
.card.quote h3, .card .card-tags { max-width: 82%; color: var(--accent); font: 500 11px/1.45 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.card .card-tags { margin: 0; font-size: 12px; letter-spacing: .02em; text-transform: none; }
.card-tags span { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brief-ask { margin: 0; color: var(--text); font-size: 22px; font-weight: 650; line-height: 1.22; letter-spacing: -.03em; text-wrap: balance; }
.card .brief-ask { color: var(--text); font-size: 22px; line-height: 1.22; }
.brief-pro { padding: 10px 12px 11px; border: 1px solid rgba(16,185,129,.25); border-radius: var(--radius-sm); background: var(--accent-subtle); }
.brief-label { display: block; margin-bottom: 6px; color: var(--accent-hover); font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.brief-pro ul { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.brief-pro li { position: relative; padding-left: 14px; color: var(--text); font-size: 13.5px; line-height: 1.45; text-wrap: pretty; }
.brief-pro li::before { content: ""; position: absolute; left: 1px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ex-hero .brief { position: relative; display: flex; flex-direction: column; gap: 18px; max-width: 68ch; margin-top: 26px; }
.ex-hero .brief::before { content: "\201C"; position: absolute; left: -10px; top: -58px; font: 800 170px/1 var(--font); color: rgba(16,185,129,.11); pointer-events: none; }
.ex-hero .brief > * { position: relative; }
.ex-hero .brief-ask { font-size: clamp(22px,3vw,30px); }
.ex-hero .brief-pro { padding: 14px 16px; }
.ex-hero .brief-pro li { font-size: 15px; }
.ex-hero:has(.brief) h1.chat-title { max-width: none; color: var(--accent); font: 500 13px/1.45 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

/* Chat — the assistant's .messages/.msg/.bubble, read-only */
.chat { display: flex; flex-direction: column; gap: 22px; padding: clamp(18px,4vw,36px) clamp(12px,4vw,44px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(255,255,255,.72); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.msg { display: flex; gap: 14px; width: 100%; max-width: 820px; margin-inline: auto; }
.msg.user { flex-direction: row-reverse; }
.msg > :not(.m-avatar) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.msg.ai > :not(.m-avatar) { align-items: flex-start; }
.msg.user > :not(.m-avatar) { align-items: flex-end; }
.m-avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-top: 2px; border-radius: 9px; color: #fff; font: 700 12px var(--mono); }
.msg.ai .m-avatar { background: var(--brand-grad); box-shadow: 0 4px 12px -4px var(--glow); }
.msg.user .m-avatar { background: linear-gradient(135deg,#22c1a6,#0b8f86); }
.bubble { position: relative; max-width: min(740px,100%); padding: 16px 20px; border-radius: var(--radius-md); font-size: 14px; line-height: 1.62; text-wrap: pretty; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.msg.user .bubble { max-width: min(740px,86%); }
.msg.ai .bubble { background: var(--ai-bubble); border: 1px solid var(--ai-bubble-border); border-top-left-radius: 4px; box-shadow: 0 10px 26px -16px rgba(0,0,0,.08); }
.msg.user .bubble { background: var(--user-bubble); color: var(--user-bubble-text); border-top-right-radius: 4px; }
.msg.ai .bubble::before, .msg.ai .bubble::after, .msg.user .bubble::after { content: ""; position: absolute; width: 0; height: 0; }
.msg.ai .bubble::before { top: 5px; left: -7px; border: 7px solid transparent; border-left: 0; border-right-color: var(--ai-bubble-border); }
.msg.ai .bubble::after { top: 6px; left: -6px; border: 6px solid transparent; border-left: 0; border-right-color: var(--ai-bubble); }
.msg.user .bubble::after { top: 6px; right: -6px; border: 6px solid transparent; border-right: 0; border-left-color: #12b3a0; }
.bubble p { margin: 0 0 10px; max-width: 68ch; }
.bubble > :last-child { margin-bottom: 0; }
.bubble > :first-child { margin-top: 0; }
.bubble strong { font-weight: 650; }
.bubble h3, .bubble h4, .bubble h5 { margin: 18px 0 8px; letter-spacing: -.02em; line-height: 1.25; }
.bubble h3 { font-size: 19px; font-weight: 650; }
.bubble h4 { font-size: 16px; font-weight: 650; }
.bubble h5 { font-size: 14px; font-weight: 650; color: var(--text-dim); }
.bubble hr { margin: 16px 0; border: 0; border-top: 1px solid var(--border); }
.bubble ul, .bubble ol { display: flex; flex-direction: column; gap: 5px; max-width: 68ch; margin: 8px 0 12px 20px; padding: 0; }
.bubble li::marker { color: var(--accent); }
.bubble code.inline { padding: 1.5px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--code-bg); font: 12px var(--mono); }
.bubble pre { overflow-x: auto; margin: 10px 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--code-bg); font: 12.5px/1.55 var(--mono); }
.bubble .table-wrap { overflow-x: auto; max-width: 100%; margin: 10px 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--panel); }
.bubble table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bubble th { padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--hover); color: var(--text-dim); font-size: 11px; font-weight: 650; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.bubble td { padding: 8px 12px; border-top: 1px solid var(--border); }
.bubble tr:hover td { background: var(--hover); }
.bubble a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.bubble a:hover { text-decoration: none; }
.bubble a.ws-link { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-subtle); font-weight: 600; text-decoration: none; }
.bubble a.ws-link::before { content: "⬇"; font-size: .9em; opacity: .8; }
/* Hover deepens the tint instead of inverting: file names inside are often `code`, unreadable on a solid fill. */
.bubble a.ws-link:hover { background: rgba(16,185,129,.18); border-color: var(--accent-hover); color: var(--accent-hover); }
.bubble a.ws-link code.inline { padding: 0; border: 0; background: none; color: inherit; }
.attach-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-bottom: 8px; }
.attach-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--code-bg); font-size: 11.5px; font-weight: 550; text-decoration: none; transition: border-color .12s, color .12s; }
a.attach-pill:hover { border-color: var(--accent); color: var(--accent); }
.attach-pill svg { width: 12px; height: 12px; }

/* Bottom CTA — same as the landing */
.cta-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 48px max(16px,env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); pointer-events: none; background: linear-gradient(to top,var(--bg) 56%,rgba(243,245,248,0)); }
.cta-inner { display: flex; justify-content: flex-end; gap: 10px; width: min(100%,960px); margin: 0 auto; }
.cta { display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 15px 22px; border-radius: 8px; background: var(--brand-grad); color: #fff; font: 600 15px var(--font); text-decoration: none; pointer-events: auto; box-shadow: 0 12px 28px -12px rgba(16,185,129,.45); transition: transform .2s ease, box-shadow .2s ease; }
.cta.secondary { background: #131922; box-shadow: 0 12px 28px -14px rgba(19,25,34,.42); }
.cta:hover { transform: translateY(-2px); }
.cta:focus-visible, .card:focus-visible, .chip:focus-visible { outline: 3px solid var(--accent-subtle); outline-offset: 4px; }

@media (max-width: 560px) {
  main { width: min(100% - 24px, 960px); }
  .chat { padding: 16px 10px; border-radius: var(--radius-md); }
  .msg { gap: 8px; }
  .m-avatar { width: 26px; height: 26px; font-size: 11px; }
  .bubble { padding: 12px 14px; }
  .msg.user .bubble { max-width: 92%; }
  .cta-inner { justify-content: stretch; }
  .cta { width: 100%; padding-inline: 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
