/* T112 «جواب فوری هوشمند»: the floating N chat. Phone first (a full-height sheet), a centred card on wide screens.
   Reads the shared --n-* tokens (noir-ui.css), so paper and dark follow the app theme. RTL by inheritance; logical properties only. */
.n-smart-layer{position:fixed;inset:0;z-index:110;display:flex;align-items:flex-end;justify-content:center;background:var(--n-scrim,rgba(23,23,27,.45));
  font-family:var(--n-font,Vazirmatn,Tahoma,sans-serif);direction:rtl}
.n-smart-panel{box-sizing:border-box;display:flex;flex-direction:column;width:100%;max-width:640px;height:min(100dvh,100%);max-height:100dvh;
  background:var(--n-paper,#F4F3F8);color:var(--n-ink,#17171B);border-radius:20px 20px 0 0;box-shadow:var(--n-shadow-raised,none);
  padding-block-start:max(10px,env(safe-area-inset-top));overflow:hidden}
@media (min-width:720px){.n-smart-layer{align-items:center;padding:24px}.n-smart-panel{height:min(760px,calc(100dvh - 48px));border-radius:20px;border:1px solid var(--n-line,#E3E0EA)}}
.n-smart-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:6px 16px 10px;border-block-end:1px solid var(--n-line,#E3E0EA)}
.n-smart-head h2{margin:0;font-size:17px;line-height:1.5;font-weight:800}
.n-smart-head p{margin:2px 0 0;font-size:12px;line-height:1.6;color:var(--n-muted,#6B6974)}
.n-smart-head-tools{display:flex;align-items:center;gap:6px;flex:none}
.n-smart-close{min-width:44px;height:44px;border:0;border-radius:22px;background:transparent;color:var(--n-ink,#17171B);font-size:26px;line-height:1;cursor:pointer}
.n-smart-btn{min-height:44px;padding:0 14px;border:1px solid var(--n-line,#E3E0EA);border-radius:22px;background:var(--n-surface,#fff);color:var(--n-ink,#17171B);
  font:700 13px/1.4 var(--n-font,Vazirmatn,sans-serif);cursor:pointer}
.n-smart-btn--gold{background:var(--n-primary,#0E0C14);border-color:var(--n-primary,#0E0C14);color:var(--n-on-primary,#FFFFFF)}
.n-smart-btn:disabled,.n-smart-send:disabled{opacity:.55;cursor:default}
.n-smart-log{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:14px 14px 8px;display:flex;flex-direction:column;gap:10px}
.n-smart-turn{display:flex;flex-direction:column;gap:10px}
.n-smart-msg{box-sizing:border-box;max-width:92%;border-radius:18px;padding:10px 14px;font-size:15px;line-height:1.85;overflow-wrap:anywhere}
.n-smart-msg p{margin:0}
.n-smart-msg--user{align-self:flex-start;background:var(--n-ink,#17171B);color:var(--n-on-ink,#fff);border-end-start-radius:6px}
.n-smart-msg--answer,.n-smart-msg--error{align-self:flex-end;background:var(--n-surface,#fff);border:1px solid var(--n-line,#E3E0EA);border-end-end-radius:6px;box-shadow:var(--n-shadow-card,none)}
.n-smart-msg--answer.is-ai{border-inline-start:3px solid var(--n-gold,#AA9CEC)}
.n-smart-msg--error{border-color:var(--n-danger-line,#F0C4C2);background:var(--n-danger-l,#FBE7E6)}
.n-smart-msg--error .n-smart-btn{margin-block-start:8px}
.n-smart-label{font-size:12px!important;font-weight:800;color:var(--n-gold-d,#6146E8);margin-block-end:4px!important}
.n-smart-text{white-space:pre-line}
.n-smart-privacy-note,.n-smart-quota{margin-block-start:6px!important;font-size:12px;color:var(--n-muted,#6B6974)}
.n-smart-sources{margin-block-start:8px;border-block-start:1px dashed var(--n-line,#E3E0EA);padding-block-start:6px}
.n-smart-sources summary{min-height:44px;display:flex;align-items:center;font-size:13px;font-weight:800;cursor:pointer;color:var(--n-ink2,#4C4A45)}
.n-smart-sources ol{margin:4px 0 0;padding-inline-start:18px;display:flex;flex-direction:column;gap:8px}
.n-smart-sources li{font-size:13px;line-height:1.8}
.n-smart-sources li strong{display:block;font-size:12px}
.n-smart-sources li small{display:block;font-size:11px;color:var(--n-muted,#6B6974)}
.n-smart-sources li[dir="ltr"]{text-align:left}
.n-smart-actions{display:flex;flex-wrap:wrap;gap:6px;margin-block-start:10px}
.n-smart-chip-action{min-height:44px;padding:0 14px;border:1px solid var(--n-gold,#AA9CEC);border-radius:22px;background:var(--n-gold-l,#EDE9F7);color:var(--n-ink,#17171B);
  font:700 13px/1.4 var(--n-font,Vazirmatn,sans-serif);cursor:pointer}
.n-smart-notice{margin-block-start:10px;padding:10px 12px;border-radius:14px;background:var(--n-soft-l,#F4ECF8);border:1px solid var(--n-soft-line,#9A6FAD);font-size:13px;line-height:1.8}
.n-smart-notice .n-smart-chip-action{margin-block-start:8px}
.n-smart-consent{margin-block-start:10px;padding:10px 12px;border-radius:14px;background:var(--n-surface,#fff);border:1px solid var(--n-line,#E3E0EA)}
.n-smart-consent h3{margin:0 0 4px;font-size:14px}
.n-smart-consent ul{margin:0;padding-inline-start:18px;font-size:12px;line-height:1.8}
.n-smart-row{display:flex;flex-wrap:wrap;gap:8px;margin-block-start:10px}
.n-smart-error{margin:6px 0 0;font-size:12px;color:var(--n-danger,#C9403F)}
.n-smart-typing{align-self:flex-end;display:flex;align-items:center;gap:8px;padding:8px 14px;border-radius:18px;background:var(--n-surface2,#EEEDF4);font-size:13px;color:var(--n-ink2,#4C4A45)}
.n-smart-dots{display:inline-flex;gap:3px}
.n-smart-dots i{width:6px;height:6px;border-radius:50%;background:var(--n-gold,#AA9CEC);animation:n-smart-dot 1s infinite ease-in-out}
.n-smart-dots i:nth-child(2){animation-delay:.15s}.n-smart-dots i:nth-child(3){animation-delay:.3s}
@keyframes n-smart-dot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.n-smart-empty{margin:auto 0;display:flex;flex-direction:column;gap:12px;text-align:center;color:var(--n-ink2,#4C4A45);font-size:14px;line-height:1.9}
.n-smart-empty p{margin:0}
/* T128: «۱۰ اعتراض رایج نتورک» at the top of the first screen (44px+ touch targets, solid gold, no motion) */
.n-smart-objections{display:flex;flex-direction:column;gap:10px;text-align:start}
.n-smart-objections-head{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:48px;width:100%;padding:8px 16px;border:1px solid var(--n-gold,#AA9CEC);border-radius:16px;background:var(--n-gold-l,#EDE9F7);color:var(--n-ink,#17171B);font:700 15px/1.6 var(--n-font,Vazirmatn,sans-serif);cursor:pointer;text-align:start}
.n-smart-objections-head small{font:500 12px/1.5 var(--n-font,Vazirmatn,sans-serif);color:var(--n-ink2,#4C4A45)}
.n-smart-objections-head[aria-expanded="true"]{border-width:2px;background:var(--n-gold-l,#F1EDFF)}
.n-smart-objections-body[hidden]{display:none}
.n-smart-objections-body{display:flex;flex-direction:column;gap:10px}
.n-smart-objections-body .n-smart-chips{justify-content:flex-start}
.n-smart-chip--objection{border-color:var(--n-gold,#AA9CEC)}
.n-smart-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.n-smart-chip{min-height:44px;padding:6px 14px;border:1px solid var(--n-line,#E3E0EA);border-radius:22px;background:var(--n-surface,#fff);color:var(--n-ink,#17171B);
  font:600 13px/1.6 var(--n-font,Vazirmatn,sans-serif);cursor:pointer;text-align:start}
.n-smart-composer{display:flex;align-items:flex-end;gap:8px;margin:0 12px;padding:6px 6px 6px 8px;border:1px solid var(--n-line,#E3E0EA);border-radius:24px;background:var(--n-surface,#fff)}
.n-smart-composer textarea{flex:1 1 auto;min-width:0;min-height:44px;max-height:132px;resize:none;border:0;background:transparent;color:var(--n-ink,#17171B);
  font:500 16px/1.7 var(--n-font,Vazirmatn,sans-serif);padding:9px 10px;outline:none}
.n-smart-composer:focus-within{border-color:var(--n-focus,#6146E8);box-shadow:0 0 0 2px color-mix(in srgb,var(--n-focus,#6146E8) 25%,transparent)}
.n-smart-send{flex:none;width:44px;height:44px;border:0;border-radius:22px;background:var(--n-ink,#17171B);color:var(--n-on-ink,#fff);font:800 20px/1 var(--n-font,sans-serif);cursor:pointer}
.n-smart-quick{display:flex;justify-content:center;margin:6px 12px 0}
.n-smart-link{min-height:44px;padding:0 12px;border:0;background:transparent;color:var(--n-gold-d,#6146E8);font:700 13px/1.4 var(--n-font,Vazirmatn,sans-serif);text-decoration:underline;text-underline-offset:4px;cursor:pointer}
.n-smart-foot{margin:2px 16px max(10px,env(safe-area-inset-bottom));font-size:11px;line-height:1.7;color:var(--n-muted,#6B6974);text-align:center}
.n-smart-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.n-smart-layer :focus-visible{outline:3px solid var(--n-focus,#6146E8);outline-offset:2px}
/* the rounded composer shows the focus ring (focus-within); the textarea inside it draws no second, square outline */
.n-smart-layer .n-smart-composer textarea:focus-visible{outline:none}
.n-smart-composer:focus-within{border-color:var(--n-focus,#6146E8);box-shadow:0 0 0 3px color-mix(in srgb,var(--n-focus,#6146E8) 30%,transparent)}
@media (prefers-reduced-motion:reduce){.n-smart-dots i{animation:none}}
/* T112 structural answer: numbered steps and the sentence for the contact */
.n-smart-steps{margin:0;padding-inline-start:1.4em;display:grid;gap:.35em;line-height:1.8}
.n-smart-say{margin:.5em 0 0;padding:.5em .7em;border-inline-start:3px solid currentColor;opacity:.92;line-height:1.8}
/* T178 «مربیِ انتخاب‌گر»: brain sentences shown verbatim, each with its source title */
.n-smart-intro{margin:0 0 .35em;line-height:1.8;opacity:.9}
.n-smart-quote{display:block;line-height:1.85}
.n-smart-quote-source{display:block;margin-top:.1em;font-size:.82em;line-height:1.6;opacity:.7}
/* T114 «کلید رایگان گوگل (روی همین گوشی)» on «هوش مصنوعی من»: phone first, 48px targets, 16px input (no iOS zoom), RTL with an LTR key field */
.device-gemini{display:grid;gap:10px;margin-block:14px;padding:16px;border:1px solid var(--n-line,#E3E0EA);border-radius:18px;font-family:var(--n-font,Vazirmatn,Tahoma,sans-serif)}
.device-gemini h2{margin:0;font-size:17px;line-height:1.6}
.device-gemini p{margin:0;line-height:1.9}
.device-gemini-steps{margin:0;padding-inline-start:1.4em;display:grid;gap:2px;line-height:1.9}
.device-gemini-steps a{display:inline-block;min-height:44px;line-height:44px;color:inherit;text-decoration:underline;text-underline-offset:3px}
.device-gemini-saved bdi{font-family:ui-monospace,Menlo,Consolas,monospace}
.device-gemini-form{display:grid;gap:8px}
.device-gemini-form input{box-sizing:border-box;width:100%;min-height:48px;padding:0 12px;border:1px solid var(--n-line,#E3E0EA);border-radius:14px;background:transparent;color:inherit;font-size:16px;text-align:left}
.device-gemini-form input:focus-visible{outline:3px solid color-mix(in srgb,var(--n-focus,#6146E8) 45%,transparent);outline-offset:1px}
.device-gemini-actions{display:flex;flex-wrap:wrap;gap:8px}
.device-gemini-actions button{flex:1 1 140px;width:auto;min-height:48px;margin:0}
.device-gemini-status:empty{display:none}
.device-gemini-consent{display:flex;align-items:flex-start;gap:10px;min-height:48px;padding:8px 0;line-height:1.9;cursor:pointer}
.device-gemini-consent input{flex:none;width:24px;height:24px;margin:4px 0 0}
.device-gemini-consent-given{font-size:13px;color:var(--n-muted,#6B6974)}
.n-smart-device-failed{margin-block:4px 6px!important;font-size:12px;color:var(--n-muted,#6B6974)}
/* T170 ledger B02: the member's own saved turns above the new ones, and the «پاک کردن گفت‌وگو» note. */
.n-smart-restored{display:flex;flex-direction:column;gap:12px;padding-block-end:12px;margin-block-end:4px;border-block-end:1px dashed var(--n-line,#E3E0EA)}
.n-smart-restored-head{margin:0;font-size:.82rem;font-weight:800;color:var(--n-ink2,#4C4A45)}
.n-smart-cleared{margin:0 0 8px;font-size:.86rem;color:var(--n-ink2,#4C4A45)}
.n-smart-head-tools [data-smart-clear][data-confirm="true"]{border-color:var(--n-danger,#B3261E);color:var(--n-danger,#B3261E)}
/* T176 keyboard-safe layout: while the keyboard is up the chat keeps only the log and the input bar (install-gate.js sets html.nexa-kb-open). */
html.nexa-kb-open .n-smart-layer :is(.n-smart-quick,.n-smart-foot,.n-smart-head p){display:none!important}
html.nexa-kb-open .n-smart-layer .n-smart-composer{margin-block-end:8px}
html.nexa-kb-open .n-smart-layer .n-smart-panel{padding-block-end:0}
/* T179 «سؤال‌های تأییدشدهٔ مشابه»: the approved questions listed under an answer; each one is a full-width button (44px, wraps long questions) */
.n-smart-suggest{display:flex;flex-direction:column;gap:6px;margin-block-start:8px;padding:10px 12px;border:1px dashed var(--n-line,#E3E0EA);border-radius:14px;background:var(--n-paper,#FFFFFF)}
.n-smart-suggest-head{margin:0;font-size:.82rem;font-weight:800;color:var(--n-ink2,#4C4A45)}
.n-smart-suggest-item{min-height:44px;padding:8px 12px;border:1px solid var(--n-gold,#AA9CEC);border-radius:12px;background:var(--n-gold-l,#EDE9F7);color:var(--n-ink,#17171B);font:inherit;font-size:.92rem;line-height:1.6;text-align:start;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
.n-smart-suggest-item:focus-visible{outline:2px solid var(--n-ink,#17171B);outline-offset:2px}
/* T180 «مربی»: each approved card under «پاسخ به: <the card's own question>», always the approved text; the member's layout (no AI): «بیشتر» folds the
   steps after the second (SHORT), the source titles one per line (DETAIL) and the fixed opening/closing lines once the Owner approved them */
.n-smart-card{display:flex;flex-direction:column;gap:6px}.n-smart-card+.n-smart-card{margin-block-start:10px;padding-block-start:10px;border-top:1px solid var(--n-line,#E3E0EA)}
.n-smart-card-head{margin:0;font-size:.86rem;font-weight:800;color:var(--n-ink2,#4C4A45);overflow-wrap:anywhere}
.n-smart-more summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700}
.n-smart-more summary:focus-visible{outline:2px solid var(--n-ink,#17171B);outline-offset:2px}
.n-smart-source-list{margin:2px 0 0;padding-inline-start:18px;display:grid;gap:2px;overflow-wrap:anywhere}
.n-smart-frame{margin:0;font-size:.92rem;line-height:1.7;color:var(--n-ink2,#4C4A45);overflow-wrap:anywhere}
/* T180 «مثل خودت روان + دکمهٔ متن اصلی»: the fluent answer, and the card text word for word under «متن اصلی آموزش» */
.n-smart-composed{white-space:pre-wrap;line-height:1.9}
.n-smart-original{border:1px dashed var(--n-line,#E3E0EA);border-radius:12px;padding:6px 10px}.n-smart-original summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700}
.n-smart-original summary:focus-visible{outline:2px solid var(--n-ink,#17171B);outline-offset:2px}
/* T182 «N باهوش»: the coach answer, «متن اصلی» passages and the free-question counter */
.n-smart-coach{white-space:pre-wrap;line-height:1.9}
.n-smart-passage{border-block-start:1px solid var(--n-line,#E3E0EA);padding-block:6px}.n-smart-passage .n-smart-quote{white-space:pre-wrap}
.n-smart-free{margin-block-start:6px!important;font-size:12px;font-weight:700;color:var(--n-muted,#6B6974)}
/* T193 «N مثل ستون وسط NotebookLM»: the notebook answer from the safe formatter (small headings, bullets, bold); the panel's own text colour and theme tokens */
.n-smart-notebook{line-height:1.9;overflow-wrap:anywhere}
.n-smart-msg .n-smart-notebook>*+*{margin-block-start:6px}
.n-smart-msg .n-smart-nb-head{margin:10px 0 2px;font-size:.95rem;font-weight:800;line-height:1.6;color:inherit}
.n-smart-msg .n-smart-nb-head:first-child{margin-block-start:0}
.n-smart-nb-list{margin:0;padding-inline-start:1.4em;display:grid;gap:.3em}
ol.n-smart-nb-list{list-style:persian}
.n-smart-notebook strong{font-weight:800}
