@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:   #080808;
  --sf:   #0f0f0f;
  --bd:   #1c1c1c;
  --bd2:  #282828;
  --tx:   #b0b0b0;
  --tm:   #505050;
  --td:   #383838;
  --wh:   #efefef;
  --ink:  #efefef;
  --blue: #3e6ae1;
  --blue2:#2a52c4;
}

html, body { height: 100%; background: var(--bg); color: var(--tx); font-family: 'Inter', sans-serif; overflow: hidden; }

/* ── Shell ─────────────────────────────────────────── */
.nova-shell { display: flex; flex-direction: column; height: 100vh; }

/* ── Header ─────────────────────────────────────────── */
.nova-hdr {
  display: flex; align-items: center; gap: 9px;
  padding: 0 28px; height: 50px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0; background: var(--bg);
}
.nova-atom { width: 20px; height: 20px; flex-shrink: 0; }
.nova-logo-text {
  font-size: 11px; font-weight: 500; letter-spacing: 3.5px;
  text-transform: uppercase; color: var(--ink);
  font-family: 'Inter', monospace;
}

/* ── Chat / welcome ─────────────────────────────────── */
.nova-chat {
  flex: 1; overflow-y: auto;
  padding: 40px 28px 24px;
  display: flex; flex-direction: column; gap: 20px;
  scroll-behavior: smooth;
}
.nova-chat::-webkit-scrollbar { width: 2px; }
.nova-chat::-webkit-scrollbar-thumb { background: var(--bd2); }

/* ── Welcome — centred search layout ─────────────────── */
.nova-welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  animation: nfi .45s cubic-bezier(.16,1,.3,1);
  padding-bottom: 60px;
}
@keyframes nfi { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.nova-w-h1 {
  font-size: 38px; font-weight: 300;
  letter-spacing: -1.5px; color: var(--ink); line-height: 1.05;
  margin-bottom: 2px;
}
.nova-w-h1 em { font-style: italic; color: var(--tm); font-weight: 300; }

.nova-tagline {
  font-size: 13px; color: var(--tm);
  line-height: 1.6; margin-bottom: 28px;
  font-weight: 300; min-height: 20px;
}

/* Search bar — centred, wide */
.nova-search-wrap {
  width: 100%; max-width: 580px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.nova-input-box {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: var(--sf);
  border: 1px solid var(--bd2);
  border-radius: 12px;
  padding: 8px 8px 8px 18px;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.nova-input-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(62,106,225,.09);
}
#nova-inp, #nova-inp-b {
  flex: 1; background: transparent; border: none;
  color: var(--ink); font-family: 'Inter', sans-serif;
  font-size: 14px; resize: none; outline: none;
  height: 24px; max-height: 120px; line-height: 1.6; padding: 0;
  overflow: hidden;
}
#nova-inp::placeholder, #nova-inp-b::placeholder { color: var(--td); }
.nova-send {
  width: 36px; height: 36px; min-width: 36px; background: var(--blue);
  border: none; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .12s, transform .1s;
}
.nova-send:hover { background: var(--blue2); }
.nova-send:active { transform: scale(.95); }
.nova-send svg { width: 13px; height: 13px; color: #fff; display: block; }

/* Pill quick-action chips */
.nova-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
}
.nova-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--sf); border: 1px solid var(--bd);
  border-radius: 8px; padding: 5px 11px;
  font-size: 11px; color: var(--tm);
  font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all .13s;
  white-space: nowrap;
}
.nova-chip svg { width: 11px; height: 11px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nova-chip:hover { border-color: var(--blue); color: var(--blue); background: rgba(62,106,225,.04); }

/* ── Messages ─────────────────────────────────────────── */
.nova-msg-wrap {
  display: flex; flex-direction: column; gap: 4px;
  max-width: 680px; animation: nfi .2s ease;
}
.nova-msg-wrap.user { align-self: flex-end; align-items: flex-end; max-width: 520px; }
.nova-msg-label {
  font-size: 9px; font-weight: 500; letter-spacing: 2px;
  color: var(--tm); text-transform: uppercase; padding: 0 2px;
  font-family: 'Inter', monospace;
}
.nova-bubble { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; line-height: 1.8; }
.nova-msg-wrap.nova .nova-bubble {
  background: var(--sf); border: 1px solid var(--bd);
  color: var(--tx); border-radius: 2px 10px 10px 10px;
}
.nova-msg-wrap.user .nova-bubble {
  background: var(--blue); color: #fff;
  border-radius: 10px 2px 10px 10px;
}

/* ── Input bar (post-chat) ──────────────────────────── */
.nova-input-area {
  padding: 12px 28px 16px;
  border-top: 1px solid var(--bd);
  background: var(--bg); flex-shrink: 0;
}
.nova-input-area .nova-input-box { max-width: 100%; }
.nova-input-foot {
  display: flex; justify-content: space-between;
  margin-top: 7px; font-size: 10px; color: var(--tm);
  padding: 0 2px; font-family: 'Inter', monospace;
}
.nova-input-foot a { color: var(--td); text-decoration: none; }
.nova-input-foot a:hover { color: var(--tm); }

/* Footer */
.nova-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 28px;
  font-size: 10px; color: var(--tm);
  font-family: 'Inter', monospace;
  border-top: 1px solid var(--bd);
  flex-shrink: 0;
}
.nova-footer a { color: var(--tm); text-decoration: none; transition: color .12s; }
.nova-footer a:hover { color: var(--tx); }
.nova-footer-sep { color: var(--td); }

/* Message actions */
.nova-msg-actions {
  display: flex; align-items: center; gap: 2px;
  opacity: 0; transition: opacity .15s;
  padding: 3px 2px 0;
}
.nova-msg-wrap.nova:hover .nova-msg-actions { opacity: 1; }
.nova-msg-act {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  border: none; background: transparent; cursor: pointer;
  color: var(--tm); transition: color .12s, background .12s; padding: 0;
}
.nova-msg-act:hover { color: var(--tx); background: var(--bd); }
.nova-msg-act.active-good { color: #4caf50; }
.nova-msg-act.active-bad  { color: #e05252; }
.nova-msg-act.active-copy { color: var(--blue); }
.nova-msg-act svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Typing ─────────────────────────────────────────── */
.nova-typing {
  display: flex; gap: 5px; padding: 12px 15px;
  background: var(--sf); border: 1px solid var(--bd);
  border-radius: 2px 10px 10px 10px; width: fit-content;
}
.nova-td { width: 4px; height: 4px; background: var(--bd2); border-radius: 50%; animation: ntb 1.4s infinite; }
.nova-td:nth-child(2) { animation-delay: .18s; }
.nova-td:nth-child(3) { animation-delay: .36s; }
@keyframes ntb { 0%,80%,100%{transform:translateY(0);opacity:.25} 40%{transform:translateY(-5px);opacity:1} }

.nova-cursor { display: inline-block; animation: nblink .65s steps(1) infinite; color: var(--blue); }
@keyframes nblink { 0%,100%{opacity:1} 50%{opacity:0} }

sup.nova-cite {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bd); color: var(--tm); border-radius: 3px;
  font-size: 9px; font-weight: 600; padding: 0 4px;
  min-width: 14px; height: 14px; line-height: 1; margin: 0 1px;
  vertical-align: super; font-family: 'Inter', monospace;
}
.nova-sources { display:flex; flex-wrap:wrap; gap:5px; margin-top:10px; padding-top:8px; border-top:1px solid var(--bd); }
.nova-src-pill { font-size:9px; color:var(--tm); background:var(--bg); border:1px solid var(--bd); border-radius:3px; padding:2px 6px; font-family:'Inter',monospace; }

.nova-calc { background:var(--bg); border:1px solid var(--bd); border-radius:8px; padding:14px 16px; margin-top:12px; font-size:12px; }
.nova-calc-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.nova-calc-title { font-size:10px; font-weight:500; color:var(--tx); letter-spacing:.5px; text-transform:uppercase; font-family:'Inter',monospace; }
.nova-calc-ratio { font-size:11px; color:var(--ink); background:var(--bd); border-radius:4px; padding:2px 8px; font-family:'Inter',monospace; }
.nova-calc-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.nova-calc-row label { font-size:10px; color:var(--tm); text-transform:uppercase; letter-spacing:.5px; flex-shrink:0; }
.nova-calc-controls { display:flex; align-items:center; gap:8px; flex:1; }
.nova-calc-slider { flex:1; accent-color:var(--blue); cursor:pointer; height:3px; }
.nova-calc-vol { font-size:12px; color:var(--ink); min-width:36px; text-align:right; font-family:'Inter',monospace; }
.nova-calc-result { display:flex; align-items:baseline; gap:8px; padding:10px 0 8px; border-top:1px solid var(--bd); border-bottom:1px solid var(--bd); margin-bottom:8px; }
.nova-calc-num { font-size:24px; font-weight:300; color:var(--ink); line-height:1; font-family:'Inter',monospace; }
.nova-calc-sub { font-size:11px; color:var(--tm); }
.nova-calc-water { color:var(--tx); }
.nova-calc-meta { font-size:10px; color:var(--tm); }
.nova-calc-meta strong { color:var(--tx); }
/* ══════════════════════════════════════════════════════
   LAYOUT VARIANTS
   ══════════════════════════════════════════════════════ */

/* ── Compact ─────────────────────────────────────── */
.nova-layout-compact .nova-shell { border-radius: 10px; overflow: hidden; border: 1px solid var(--bd); }
.nova-layout-compact .nova-chat  { padding: 20px 18px 16px; }
.nova-layout-compact .nova-welcome.nova-compact-welcome { align-items: flex-start; text-align: left; justify-content: flex-start; padding-bottom: 0; flex: unset; }
.nova-layout-compact .nova-input-area { padding: 8px 14px 12px; }
.nova-layout-compact .nova-msg-wrap { max-width: 100%; }

/* ── Chatbar ─────────────────────────────────────── */
.nova-layout-chatbar { background: transparent !important; }
.nova-chatbar-shell  { background: transparent; border: none; display: block; }
.nova-chatbar-responses {
  background: var(--bg); border: 1px solid var(--bd); border-radius: 10px;
  max-height: 320px; overflow-y: auto; padding: 16px;
  margin-bottom: 8px; display: flex; flex-direction: column; gap: 14px;
}
.nova-chatbar-responses::-webkit-scrollbar { width: 2px; }
.nova-chatbar-responses::-webkit-scrollbar-thumb { background: var(--bd2); }
.nova-chatbar-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--sf); border: 1px solid var(--bd2);
  border-radius: 12px; padding: 6px 6px 6px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.nova-chatbar-box { border: none !important; border-radius: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; flex: 1; }
.nova-chatbar-box:focus-within { box-shadow: none !important; }
.nova-layout-chatbar #nova-inp { height: 22px; }
.nova-chatbar-responses .nova-msg-wrap { max-width: 100%; }

/* ── Inline ──────────────────────────────────────── */
.nova-layout-inline { background: transparent !important; }
.nova-inline-shell  { background: transparent; }
.nova-inline-chat   { padding: 0 0 16px; }
.nova-inline-chat .nova-msg-wrap { max-width: 100%; }

/* ── Popup ───────────────────────────────────────── */
.nova-popup-root    { position: fixed; bottom: 24px; right: 24px; z-index: 99999; }

.nova-popup-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--blue); border: none; border-radius: 50px;
  padding: 10px 18px 10px 12px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(62,106,225,.35);
  transition: all .2s; color: #fff;
}
.nova-popup-btn:hover { background: var(--blue2); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(62,106,225,.45); }
.nova-popup-label { font-size: 12px; font-weight: 500; letter-spacing: 1px; font-family: 'Inter', monospace; }
.nova-popup-close { font-size: 11px; opacity: 0; transition: opacity .15s; margin-left: 4px; line-height: 1; }
.nova-popup-open .nova-popup-close { opacity: .7; }
.nova-popup-open .nova-popup-label { display: none; }
.nova-popup-open .nova-atom        { display: none; }

.nova-popup-panel {
  position: absolute; bottom: 56px; right: 0;
  width: 360px; height: 520px;
  background: var(--bg); border-radius: 16px;
  border: 1px solid var(--bd);
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(12px) scale(.97);
  pointer-events: none;
  transition: all .25s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
.nova-popup-open .nova-popup-panel {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: all;
}
.nova-layout-popup .nova-chat  { padding: 20px; }
.nova-layout-popup .nova-input-area { padding: 10px 16px 14px; }
.nova-layout-popup .nova-msg-wrap { max-width: 100%; }
