/* Nour, the AI assistant on every screen (decision 104, phase 2; js/nour.js).
   The button sits at the reading side's end: bottom-left in Arabic, bottom-right in
   English (inset-inline-end). The panel opens above it; on a phone it fills the width. */
.nour-launch {
  position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 19990;
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px;
  border: 0; border-radius: 999px; color: #fff;
  background: var(--navy-700, #16324F); box-shadow: 0 6px 20px rgb(16 38 61 / .28);
  font-weight: 600; font-size: .9rem; cursor: pointer;
}
[dir="rtl"] .nour-launch { padding: 4px 4px 4px 14px; }
.nour-launch:hover { filter: brightness(1.08); }
.nour-launch:focus-visible { outline: 3px solid #f0b37e; outline-offset: 2px; }
.nour-launch .nour-face { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #c8834a; object-fit: cover; }
.nour-launch .nour-ai { letter-spacing: .02em; }
.nour-launch.small { padding: 6px 12px; bottom: 10px; font-size: .8rem; opacity: .85; }
.nour-launch[hidden], .nour-panel[hidden] { display: none !important; }

.nour-panel {
  position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 19995;
  width: min(390px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 36px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: #1d2733; border-radius: 16px;
  box-shadow: 0 18px 48px rgb(16 38 61 / .32); border: 1px solid rgb(16 38 61 / .08);
}
.nour-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px;
  color: #fff; background: linear-gradient(135deg, var(--navy-700, #16324F), #0d2238);
}
.nour-face-lg { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #c8834a; object-fit: cover; flex: none; }
.nour-sub { opacity: .8; }
.nour-badge { display: inline-block; margin-inline-start: 4px; padding: 0 6px; border-radius: 6px; font-size: .7rem;
  background: #c8834a; color: #fff; vertical-align: middle; }
.nour-x { color: #fff !important; opacity: .8; padding: 2px 6px; }
.nour-x:hover { opacity: 1; }
.nour-tabs { display: flex; border-bottom: 1px solid #e6eaf0; background: #f6f8fb; }
.nour-tabbtn { flex: 1; border: 0; background: none; padding: 9px 4px; font-size: .82rem; color: #4a5868; border-bottom: 2px solid transparent; }
.nour-tabbtn.on { color: var(--navy-700, #16324F); font-weight: 700; border-bottom-color: #c8834a; }
.nour-body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.nour-notice { background: #fff7ec; border: 1px solid #f1d6b8; border-radius: 10px; padding: 8px 10px; color: #6b4a2b; }
.nour-log { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 300px; }
.nour-msg { max-width: 92%; padding: 8px 11px; border-radius: 12px; line-height: 1.55; font-size: .9rem; white-space: normal; }
.nour-msg.it { align-self: flex-start; background: #eef2f7; }
.nour-msg.me { align-self: flex-end; background: var(--navy-700, #16324F); color: #fff; }
.nour-msg.wait { opacity: .7; font-style: italic; }
.nour-gos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nour-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nour-chip { border: 1px solid #d6dde6; background: #fff; border-radius: 999px; padding: 4px 10px; font-size: .78rem; color: #2a3b4d; }
.nour-chip:hover { border-color: #c8834a; }
.nour-form { display: flex; gap: 6px; align-items: flex-end; }
.nour-form textarea { resize: none; font-size: .9rem; }
.nour-done { font-weight: 600; }
.nour-mine li { padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.nour-mine li:last-child { border-bottom: 0; }

@media (max-width: 575.98px) {
  .nour-launch { inset-inline-end: 12px; bottom: 12px; }
  .nour-launch .nour-face { width: 38px; height: 38px; }
  .nour-panel { inset-inline: 8px; bottom: 8px; width: auto; max-height: calc(100vh - 16px); }
}
@media print { .nour-launch, .nour-panel { display: none !important; } }

/* «AI» marks on the AI tools, and the Home «Celvo AI» card (decision 104). */
.ai-chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px;
  font-size: .72em; font-weight: 700; line-height: 1.5; vertical-align: middle; white-space: nowrap;
  color: #fff; background: linear-gradient(135deg, #c8834a, #8a4fd6);
}
.btn .ai-chip { margin-inline-start: 6px; }
.home-ai { border: 1px solid rgb(200 131 74 / .35); background: linear-gradient(160deg, rgb(200 131 74 / .08), rgb(138 79 214 / .06)); }
.ai-home-head { display: flex; gap: 12px; align-items: flex-start; }
.ai-home-head h2 { font-size: 1.05rem; margin: 0 0 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ai-home-head p { font-size: .85rem; margin: 0; opacity: .8; }
.ai-home-face { width: 52px; height: 52px; border-radius: 50%; border: 2px solid #c8834a; object-fit: cover; flex: none; }
.ai-home-meter { margin: 12px 0 4px; font-size: .82rem; }
.ai-home-bar { height: 6px; border-radius: 999px; background: rgb(16 38 61 / .1); overflow: hidden; margin: 6px 0 4px; }
.ai-home-bar span { display: block; height: 100%; background: linear-gradient(90deg, #c8834a, #8a4fd6); }
.ai-home-left { opacity: .75; }
.ai-home-tools { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.ai-home-tool {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: start;
  border: 1px solid rgb(16 38 61 / .1); border-radius: 10px; background: rgb(255 255 255 / .7); color: inherit; font-size: .86rem;
}
.ai-home-tool:hover { border-color: #c8834a; }
.ai-home-tool > span { flex: 1; }
.ai-home-go { opacity: .5; }
[dir="rtl"] .ai-home-go { transform: scaleX(-1); }
