/* NightShift AI: guide bot (guide.js) and privacy notice (privacy-notice.js).
   Uses the site tokens, so both follow the light/dark theme. */

.ns-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Guide bot ───────────────────────────────────────── */
.ns-guide { position: fixed; right: 20px; bottom: 20px; z-index: 90; font-family: var(--font-body, 'DM Sans', sans-serif); }
.ns-guide-launch {
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 18px 12px 15px; border-radius: 999px;
  background: var(--accent, #4f8cff); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow, 0 18px 48px rgba(0,0,0,.45));
  transition: transform .15s, opacity .15s;
}
.ns-guide-launch:hover { transform: translateY(-1px); }
.ns-guide-launch:focus-visible { outline: 2px solid var(--text, #f0f4ff); outline-offset: 3px; }
.ns-guide-launch svg { width: 20px; height: 20px; flex-shrink: 0; }
.ns-guide.is-open .ns-guide-launch { display: none; }

.ns-guide-panel {
  display: flex; flex-direction: column;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 100px));
  background: var(--surface, #0d1117); color: var(--text, #f0f4ff);
  border: 1px solid var(--border2, rgba(255,255,255,.13)); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow, 0 18px 48px rgba(0,0,0,.45));
}
.ns-guide-panel[hidden] { display: none; }
.ns-guide-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.ns-guide-title { font-family: var(--font-display, 'Syne', sans-serif); font-weight: 700; font-size: 15px; letter-spacing: -.01em; margin: 0; }
.ns-guide-sub { font-size: 12px; color: var(--text3, rgba(240,244,255,.48)); margin: 2px 0 0; }
.ns-guide-actions { display: flex; gap: 4px; }
.ns-guide-icon {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  background: none; border: 0; color: var(--text2, rgba(240,244,255,.65)); cursor: pointer;
}
.ns-guide-icon:hover { background: rgba(var(--tint, 255,255,255), .07); color: var(--text, #f0f4ff); }
.ns-guide-icon:focus-visible, .ns-chip:focus-visible, .ns-guide-send:focus-visible { outline: 2px solid var(--accent, #4f8cff); outline-offset: 2px; }
.ns-guide-icon svg { width: 16px; height: 16px; }

.ns-guide-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.ns-msg { max-width: 88%; font-size: 14px; line-height: 1.55; border-radius: 14px; padding: 10px 13px; }
.ns-msg p { margin: 0; }
.ns-bot { align-self: flex-start; background: var(--surface2, #131920); border: 1px solid var(--border, rgba(255,255,255,.08)); border-bottom-left-radius: 4px; }
.ns-bot strong { font-weight: 600; color: var(--text, #f0f4ff); }
.ns-bot a { color: var(--accent-ink, #8cb8ff); }
.ns-me { align-self: flex-end; background: var(--accent, #4f8cff); color: #fff; border-bottom-right-radius: 4px; }
.ns-links { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ns-links a {
  display: block; padding: 8px 11px; border-radius: 9px; font-size: 13px; font-weight: 500; text-decoration: none;
  background: rgba(79,140,255,.10); border: 1px solid rgba(79,140,255,.22);
}
.ns-links a:hover { background: rgba(79,140,255,.16); }
.ns-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ns-chip {
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--text, #f0f4ff); text-align: left;
  background: transparent; border: 1px solid var(--border2, rgba(255,255,255,.13));
  transition: background .15s, border-color .15s;
}
.ns-chip:hover { background: rgba(var(--tint, 255,255,255), .06); border-color: rgba(79,140,255,.45); }

.ns-guide-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border, rgba(255,255,255,.08)); }
.ns-guide-input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px;
  font: inherit; font-size: 16px; color: var(--text, #f0f4ff);
  background: var(--bg, #06080f); border: 1px solid var(--border2, rgba(255,255,255,.13));
}
.ns-guide-input::placeholder { color: var(--text3, rgba(240,244,255,.48)); }
.ns-guide-input:focus { outline: none; border-color: var(--accent, #4f8cff); }
.ns-guide-send {
  width: 42px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent, #4f8cff); color: #fff;
}
.ns-guide-send svg { width: 16px; height: 16px; }

@media (max-width: 600px) {
  .ns-guide { right: 12px; bottom: calc(12px + var(--ns-notice-h, 0px)); }
  .ns-guide-launch { padding: 13px; }
  .ns-guide-launch-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ns-guide.is-open { left: 8px; right: 8px; bottom: 8px; }
  .ns-guide-panel { width: 100%; height: min(600px, calc(100dvh - 16px)); }
}
@media (prefers-reduced-motion: reduce) { .ns-guide-launch { transition: none; } }
@media print { .ns-guide, .ns-privacy { display: none !important; } }

/* ── Privacy notice ──────────────────────────────────── */
.ns-privacy {
  position: fixed; left: 20px; bottom: 20px; z-index: 95; width: min(380px, calc(100vw - 32px));
  padding: 16px 18px; border-radius: 14px;
  background: var(--surface, #0d1117); color: var(--text, #f0f4ff);
  border: 1px solid var(--border2, rgba(255,255,255,.13));
  box-shadow: var(--shadow, 0 18px 48px rgba(0,0,0,.45));
  font-family: var(--font-body, 'DM Sans', sans-serif);
}
.ns-privacy-title { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.ns-privacy-text { font-size: 13px; line-height: 1.55; color: var(--text2, rgba(240,244,255,.65)); margin: 0; }
.ns-privacy-text a { color: var(--accent-ink, #8cb8ff); }
.ns-privacy-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.ns-privacy-ok {
  padding: 8px 18px; border-radius: 9px; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; background: var(--accent, #4f8cff); color: #fff;
}
.ns-privacy-ok:focus-visible { outline: 2px solid var(--text, #f0f4ff); outline-offset: 2px; }
:root:not([data-theme="light"]) :is(.ns-privacy-ok, .ns-guide-launch, .ns-guide-send, .ns-me) { color: #06080f; }
@media (max-width: 600px) {
  .ns-privacy { left: 0; right: 0; bottom: 0; width: auto; border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
}
