/* Естественный интеллект — /ni/. Стилистика «чат с ии»: белая страница, системный шрифт, круглое поле ввода. */
:root { --fg: #0d0d0d; --muted: #8a8a8a; --line: #e6e6e6; --soft: #f4f4f4; --accent: #0d0d0d; --bad: #c0392b; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--fg); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ni-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* реклама */
.ni-ads { max-width: 900px; margin: 0 auto; padding: 14px 18px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ni-ad { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; font-size: 13px; line-height: 1.35; transition: background 0.15s ease; }
.ni-ad:hover { background: var(--soft); }
.ni-ad b { font-weight: 600; }
.ni-ad span { color: var(--muted); }
.ni-ad small { margin-top: 2px; font-size: 11px; color: var(--muted); }
.ni-ad--empty { border-style: dashed; align-items: center; text-align: center; }

.ni-main { max-width: 900px; margin: 0 auto; padding: 0 18px 40px; }
.ni-logo { display: block; width: 60px; margin: clamp(40px, 11vh, 120px) auto 26px; transition: transform 0.2s ease; }
.ni-logo:hover { transform: rotate(-6deg) scale(1.06); }
.ni-logo img { display: block; width: 100%; height: auto; }

.ni-banner { max-width: 640px; margin: 0 auto 12px; padding: 9px 16px; border-radius: 14px; background: var(--soft); font-size: 14px; text-align: center; }
.ni-banner--ok { background: #e8f6ec; }
.ni-banner--bad { background: #fdecea; }

/* поле ввода */
.ni-composer { max-width: 640px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px; border: 1px solid var(--line); border-radius: 28px; padding: 9px 9px 9px 22px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.ni-composer:focus-within { border-color: #c9c9c9; box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1); }
.ni-composer textarea { flex: 1; min-width: 0; min-height: 38px; max-height: 200px; padding: 6px 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 17px; line-height: 1.5; }
textarea::placeholder, input::placeholder { color: #a3a3a3; }
.ni-send { flex: 0 0 34px; width: 34px; height: 34px; margin-bottom: 2px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; transition: opacity 0.15s ease; }
.ni-send:hover { opacity: 0.8; }
.ni-send:disabled { opacity: 0.3; cursor: default; }
.ni-btn { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: opacity 0.15s ease; }
.ni-btn:hover { opacity: 0.85; }
.ni-btn:disabled { opacity: 0.35; cursor: default; }
.ni-btn--ghost { background: #fff; color: var(--fg); border: 1px solid var(--line); }
.ni-btn--ghost:hover { background: var(--soft); opacity: 1; }
.ni-error { max-width: 640px; margin: 10px auto 0; color: var(--bad); font-size: 14px; text-align: center; }

/* лента плитками */
.ni-feed { margin-top: 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ni-empty { grid-column: 1 / -1; margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.ni-q { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 16px; scroll-margin-top: 20px; }
.ni-q.is-target { border-color: var(--fg); }
.ni-q-text { margin: 0; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ni-a { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.45; color: #444; white-space: pre-wrap; overflow-wrap: anywhere; }
.ni-acts { margin-top: auto; white-space: nowrap; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; font-size: 12px; color: var(--muted); }
.ni-open { height: 22px; padding: 0 9px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ni-open:hover { opacity: 0.85; }
.ni-open:disabled { opacity: 0.35; }
.ni-think::after { content: "…"; display: inline-block; width: 1.2em; text-align: left; animation: ni-dots 1.4s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes ni-dots { 0% { width: 0; } 100% { width: 1.2em; } }
@media (prefers-reduced-motion: reduce) { .ni-think::after { animation: none; } }
.ni-link { margin-left: auto; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.ni-link:hover { color: var(--fg); }

/* попап */
.ni-dlg { width: min(400px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); color: var(--fg); }
.ni-dlg::backdrop { background: rgba(0, 0, 0, 0.35); }
.ni-dlg form { display: flex; flex-direction: column; gap: 12px; }
.ni-dlg h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.ni-dlg-q { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.ni-dlg input, .ni-dlg textarea { width: 100%; padding: 11px 16px; border: 1px solid var(--line); border-radius: 16px; outline: 0; background: #fff; font-size: 16px; }
.ni-dlg input { height: 46px; border-radius: 999px; }
.ni-dlg textarea { min-height: 110px; max-height: 260px; resize: none; }
.ni-dlg input:focus, .ni-dlg textarea:focus { border-color: #b5b5b5; }
.ni-dlg .is-bad { border-color: var(--bad); }
.ni-dlg .ni-error { margin: 0; text-align: left; }
.ni-dlg-acts { display: flex; justify-content: flex-end; gap: 8px; }
.ni-dlg-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }

.ni-foot { max-width: 900px; margin: 0 auto; padding: 26px 18px 34px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--muted); }
.ni-foot p { margin: 0; }

/* плашка cookie (общий /cookie.js) */
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 620px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1); font-size: 13px; line-height: 1.4; }
.cookie-bar p { margin: 0; flex: 1; }
.cookie-bar button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--fg); color: #fff; cursor: pointer; }


@media (max-width: 600px) {
  .ni-ads { grid-template-columns: 1fr; }
  .ni-ad--empty:not(:first-child) { display: none; }
  .ni-feed { grid-template-columns: 1fr 1fr; }
  .ni-q { padding: 12px 12px 10px; }
  .ni-q-text { font-size: 14px; }
  .ni-acts, .ni-link { font-size: 11px; }
  .ni-acts { gap: 4px; }
}
@media (max-width: 340px) {
  .ni-feed { grid-template-columns: 1fr; }
}
