/* JARVIS Nova — base: tokens, Higgsfield backdrop, boot, header, popover, sheets, toast,
   the shared composer and the shared markdown body. Chat and Work add their own files. */

:root {
  color-scheme: dark;
  --nv-bg: #04060c;
  --nv-ink: #eef2f9;
  --nv-ink-2: #aab4c8;
  --nv-ink-3: #6d788e;
  --nv-glass: rgba(10, 14, 24, .58);
  --nv-glass-2: rgba(14, 20, 33, .72);
  --nv-glass-3: rgba(255, 255, 255, .045);
  --nv-line: rgba(255, 255, 255, .085);
  --nv-line-2: rgba(255, 255, 255, .15);
  --nv-or: #ff7a1a;
  --nv-or-2: #ffa14d;
  --nv-or-3: #ff5b00;
  --nv-or-a: rgba(255, 122, 26, .16);
  --nv-or-glow: rgba(255, 122, 26, .38);
  --nv-ok: #34d399;
  --nv-ok-a: rgba(52, 211, 153, .14);
  --nv-bad: #ff5f6d;
  --nv-bad-a: rgba(255, 95, 109, .14);
  --nv-warn: #ffc247;
  --nv-info: #5ea9ff;
  --nv-violet: #8a7bff;
  --f-display: "Chakra Petch", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-card: 18px;
  --r-in: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --top-h: 54px;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body.nv {
  background: var(--nv-bg);
  color: var(--nv-ink);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
}
:where(.nv) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.nv) a { color: inherit; text-decoration: none; }
.nv [hidden] { display: none !important; }
.nv ::selection { background: rgba(255, 122, 26, .35); }
.nv :focus-visible { outline: 2px solid var(--nv-or-2); outline-offset: 2px; border-radius: 8px; }
/* The wrapper already shows focus (:focus-within). A second outline inside it is the orange box drawn
   around the text while typing, so the fields that live in a wrapper opt out. */
.nv .nv-comp textarea:focus-visible, .nv .nv-search input:focus-visible, .nv .nv-filter input:focus-visible { outline: 0; }
.nv .ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.nv .ic svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------ scrollbars
   One dark, thin style for every scroller. Without it Windows draws its stock light scrollbar with arrow
   buttons wherever anything overflows: under every wide code block, in the history list, in sheets. */
.nv *::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
.nv *::-webkit-scrollbar-track { background: transparent; }
.nv *::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border: 3px solid transparent; border-radius: 10px; background-clip: content-box; }
.nv *::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .34); background-clip: content-box; }
.nv *::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.nv *::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { .nv * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; } }

/* ------------------------------------------------------------------ backdrop */
.nv-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--nv-bg); }
.nv-bg__layer {
  position: absolute; inset: -2%;
  background-size: cover; background-position: center bottom; background-repeat: no-repeat;
  opacity: 0; transition: opacity .8s ease;
  animation: nvdrift 80s ease-in-out infinite alternate;
  will-change: transform;
}
.nv-bg__work { background-image: url(/img/work-m.94e751f9.webp); }
.nv-bg__chat { background-image: url(/img/chat-m.12a1f206.webp); }
@media (min-width: 900px), (orientation: landscape) and (min-width: 700px) {
  .nv-bg__work { background-image: url(/img/work-w.c146aadf.webp); }
  .nv-bg__chat { background-image: url(/img/chat-w.f938e5f2.webp); }
}
body[data-view="work"] .nv-bg__work, body[data-view="chat"] .nv-bg__chat { opacity: 1; }
.nv-bg__shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 55% at 50% 108%, rgba(255, 122, 26, .14), transparent 62%),
    linear-gradient(180deg, rgba(4, 6, 12, .74) 0%, rgba(4, 6, 12, .28) 26%, rgba(4, 6, 12, .20) 62%, rgba(4, 6, 12, .74) 100%);
}
@keyframes nvdrift { from { transform: scale(1.0) translate3d(0, 0, 0); } to { transform: scale(1.045) translate3d(0, -.6%, 0); } }

/* ------------------------------------------------------------------ boot */
.nv-boot {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(80% 60% at 50% 55%, #0b1220 0%, #04060c 70%);
  transition: opacity .55s ease, visibility .55s;
}
body:not([data-booting]) .nv-boot { opacity: 0; visibility: hidden; pointer-events: none; }
.nv-boot__orb { width: min(46vw, 190px); aspect-ratio: 1; animation: nvbreathe 3.2s ease-in-out infinite; }
.nv-boot__word { font: 600 22px var(--f-display); letter-spacing: .5em; padding-left: .5em; }
.nv-boot__step { font: 500 11px var(--f-display); letter-spacing: .22em; text-transform: uppercase; color: var(--nv-ink-3); min-height: 14px; }
.nv-boot__bar { width: min(52vw, 200px); height: 2px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; }
.nv-boot__bar i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--nv-or-3), var(--nv-or-2)); box-shadow: 0 0 12px var(--nv-or-glow); transition: width .35s ease; }
@keyframes nvbreathe { 0%, 100% { transform: scale(.96); opacity: .86; } 50% { transform: scale(1.03); opacity: 1; } }

.nv-update { position: fixed; z-index: 150; top: calc(var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; border-radius: 999px; background: rgba(14, 20, 33, .92); border: 1px solid var(--nv-line-2); font-size: 13px; backdrop-filter: blur(16px); }
.nv-update button { height: 28px; padding: 0 12px; border-radius: 999px; background: var(--nv-or); color: #1a0b00; font-weight: 600; }

/* ------------------------------------------------------------------ app shell */
.nv-app {
  position: fixed; left: 0; right: 0; top: 0; z-index: 1;
  height: var(--vvh, 100dvh);
  display: flex; flex-direction: column;
}
.nv-app.is-shifted { transform: translateY(var(--vvt, 0px)); }
.nv-main { position: relative; flex: 1; min-height: 0; }
.nv-view { position: absolute; inset: 0; display: none; }
body[data-view="chat"] #viewChat, body[data-view="work"] #viewWork { display: flex; }

/* ------------------------------------------------------------------ header */
.nv-top {
  position: relative; z-index: 40; flex: none;
  display: flex; align-items: center; gap: 8px;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 12px 0;
  background: linear-gradient(180deg, rgba(4, 6, 12, .82), rgba(4, 6, 12, .0));
}
.nv-top__sp { flex: 1; min-width: 0; }
.nv-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.nv-brand__mark { width: 24px; height: 24px; flex: none; }
.nv-brand b { font: 600 14.5px var(--f-display); letter-spacing: .3em; padding-left: .02em; text-transform: uppercase; }
.nv-link { width: 7px; height: 7px; border-radius: 50%; background: var(--nv-warn); box-shadow: 0 0 8px rgba(255, 194, 71, .7); animation: nvpulse 1.6s ease-in-out infinite; flex: none; }
.nv-link.is-on { background: var(--nv-ok); box-shadow: 0 0 9px rgba(52, 211, 153, .75); animation: none; }
.nv-link.is-off { background: var(--nv-bad); box-shadow: 0 0 9px rgba(255, 95, 109, .75); animation: nvpulse 1.2s ease-in-out infinite; }
@keyframes nvpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.nv-ibtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--nv-glass); border: 1px solid var(--nv-line); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--nv-ink-2); transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.nv-ibtn:hover { color: var(--nv-ink); border-color: var(--nv-line-2); }
.nv-ibtn:active { transform: scale(.94); }
.nv-ibtn.is-on { color: var(--nv-or-2); border-color: rgba(255, 138, 43, .5); background: var(--nv-or-a); }

.nv-mode, .nv-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 999px; flex: none;
  background: var(--nv-glass); border: 1px solid var(--nv-line); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  font: 500 12.5px var(--f-display); letter-spacing: .02em; color: var(--nv-ink);
  transition: border-color .15s, background .15s;
}
.nv-mode:hover, .nv-chip:hover { border-color: var(--nv-line-2); }
.nv-mode .ic { width: 14px; height: 14px; color: var(--nv-ink-3); transition: transform .2s; }
.nv-mode[aria-expanded="true"] .ic { transform: rotate(180deg); }
.nv-mode[aria-expanded="true"] { border-color: rgba(255, 138, 43, .5); }
.nv-chip { max-width: 34vw; min-width: 0; color: var(--nv-ink-2); }
.nv-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nv-chip .ic { width: 14px; height: 14px; color: var(--nv-or-2); }
@media (max-width: 430px) {
  .nv-top { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .nv-brand__mark { display: none; }
  .nv-brand b { letter-spacing: .24em; font-size: 14px; }
  .nv-mode { padding: 0 9px; }
  .nv-chip { max-width: 30vw; padding: 0 9px; }
}
@media (max-width: 370px) { .nv-brand b { letter-spacing: .14em; } .nv-chip .ic { display: none; } }

/* ------------------------------------------------------------------ popover */
.nv-pop {
  position: fixed; z-index: 70; min-width: 260px; max-width: calc(100vw - 20px); padding: 6px;
  border-radius: 16px; background: rgba(10, 14, 24, .9); border: 1px solid var(--nv-line-2);
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: nvrise .16s ease-out;
}
.nv-pop > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 11px; text-align: left; }
.nv-pop > button:hover { background: var(--nv-glass-3); }
.nv-pop > button.is-on { background: var(--nv-or-a); }
.nv-pop > button .ic { color: var(--nv-ink-3); }
.nv-pop > button.is-on .ic { color: var(--nv-or-2); }
.nv-pop > button b { display: block; font: 600 14px var(--f-display); letter-spacing: .03em; }
.nv-pop > button small { display: block; color: var(--nv-ink-3); font-size: 12px; line-height: 1.3; margin-top: 1px; }
@keyframes nvrise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ buttons */
.nv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; flex: none;
  background: var(--nv-glass-3); border: 1px solid var(--nv-line); color: var(--nv-ink); font: 500 13.5px var(--f-body);
  transition: background .15s, border-color .15s, transform .12s, opacity .15s;
}
.nv-btn:hover { background: rgba(255, 255, 255, .08); border-color: var(--nv-line-2); }
.nv-btn:active { transform: scale(.97); }
.nv-btn:disabled { opacity: .45; pointer-events: none; }
.nv-btn .ic { width: 16px; height: 16px; }
.nv-btn--or { background: linear-gradient(180deg, #ff9440, #ff6a0a); border-color: rgba(255, 175, 100, .6); color: #1d0c00; font-weight: 600; box-shadow: 0 6px 20px rgba(255, 106, 10, .35); }
.nv-btn--or:hover { background: linear-gradient(180deg, #ffa052, #ff7416); border-color: rgba(255, 190, 120, .75); }
.nv-btn--bad { background: var(--nv-bad-a); border-color: rgba(255, 95, 109, .4); color: #ff9aa4; }
.nv-btn--sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.nv-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--nv-line); }
.nv-seg button { height: 30px; padding: 0 14px; border-radius: 999px; font: 500 12.5px var(--f-display); letter-spacing: .03em; color: var(--nv-ink-3); transition: color .15s, background .15s; }
.nv-seg button[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: var(--nv-ink); box-shadow: inset 0 0 0 1px var(--nv-line-2); }

/* ------------------------------------------------------------------ sheet */
.nv-sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.nv-sheet__scrim { position: absolute; inset: 0; background: rgba(2, 4, 8, .62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: nvfade .2s; }
.nv-sheet__panel {
  position: relative; width: min(100%, 680px); max-height: calc(var(--vvh, 100dvh) - 36px - var(--safe-t)); display: flex; flex-direction: column;
  border-radius: 22px 22px 0 0; background: rgba(9, 13, 22, .9); border: 1px solid var(--nv-line-2); border-bottom: 0;
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 -22px 70px rgba(0, 0, 0, .55); animation: nvsheet .3s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: var(--safe-b);
}
.nv-sheet--tall .nv-sheet__panel { height: calc(var(--vvh, 100dvh) - 36px - var(--safe-t)); }
.nv-sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); margin: 8px auto 0; flex: none; }
.nv-sheet__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px 8px 18px; flex: none; }
.nv-sheet__head h2 { flex: 1; margin: 0; font: 600 16px var(--f-display); letter-spacing: .06em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-sheet__tools { display: inline-flex; gap: 6px; align-items: center; }
.nv-sheet__body { flex: 1; min-height: 0; overflow: auto; padding: 4px 18px 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (min-width: 900px) {
  .nv-sheet { align-items: center; }
  .nv-sheet__panel { border-radius: 22px; border-bottom: 1px solid var(--nv-line-2); max-height: min(780px, calc(var(--vvh, 100dvh) - 80px)); }
  .nv-sheet--tall .nv-sheet__panel { height: min(780px, calc(var(--vvh, 100dvh) - 80px)); width: min(100%, 860px); }
  .nv-sheet__grab { display: none; }
}
@keyframes nvsheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nvfade { from { opacity: 0; } to { opacity: 1; } }

/* list rows inside sheets */
.nv-rows { display: flex; flex-direction: column; gap: 6px; }
.nv-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--nv-glass-3); border: 1px solid var(--nv-line); text-align: left; width: 100%; transition: border-color .15s, background .15s; }
button.nv-row:hover { border-color: var(--nv-line-2); background: rgba(255, 255, 255, .07); }
.nv-row.is-on { border-color: rgba(255, 138, 43, .55); background: var(--nv-or-a); }
.nv-row__main { flex: 1; min-width: 0; }
.nv-row__main b { display: block; font: 600 14.5px var(--f-body); }
.nv-row__main small { display: block; color: var(--nv-ink-3); font-size: 12.5px; margin-top: 2px; }
.nv-row__end { color: var(--nv-ink-3); font: 500 12px var(--f-display); flex: none; display: inline-flex; align-items: center; gap: 6px; }
.nv-sec { margin: 16px 2px 8px; font: 600 11px var(--f-display); letter-spacing: .2em; text-transform: uppercase; color: var(--nv-ink-3); }
.nv-sec:first-child { margin-top: 4px; }
.nv-switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid var(--nv-line-2); transition: background .2s; }
.nv-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.nv-switch[aria-checked="true"] { background: var(--nv-or); border-color: var(--nv-or-2); }
.nv-switch[aria-checked="true"]::after { transform: translateX(18px); }
.nv-note { color: var(--nv-ink-3); font-size: 12.5px; line-height: 1.5; margin: 8px 2px; }
.nv-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font: 600 10.5px var(--f-display); letter-spacing: .12em; text-transform: uppercase; background: var(--nv-glass-3); border: 1px solid var(--nv-line); color: var(--nv-ink-2); }
.nv-pill--ok { background: var(--nv-ok-a); border-color: rgba(52, 211, 153, .35); color: var(--nv-ok); }
.nv-pill--or { background: var(--nv-or-a); border-color: rgba(255, 138, 43, .4); color: var(--nv-or-2); }
.nv-pill--bad { background: var(--nv-bad-a); border-color: rgba(255, 95, 109, .4); color: var(--nv-bad); }

/* ------------------------------------------------------------------ toast */
.nv-toast {
  position: fixed; z-index: 120; left: 50%; bottom: calc(112px + var(--safe-b)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 460px); padding: 10px 16px; border-radius: 14px; font-size: 13.5px; text-align: center;
  background: rgba(14, 20, 33, .94); border: 1px solid var(--nv-line-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  transition: opacity .22s, transform .22s;
}
.nv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.nv-toast.is-bad { border-color: rgba(255, 95, 109, .5); color: #ffb3ba; }
.nv-toast.is-ok { border-color: rgba(52, 211, 153, .45); }

/* ------------------------------------------------------------------ shared composer */
.nv-comp { width: min(100%, 820px); margin: 0 auto; padding: 6px 12px calc(10px + var(--safe-b)); }
.nv-comp__box {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 8px; border-radius: 24px;
  background: rgba(9, 13, 22, .68); border: 1px solid var(--nv-line-2);
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 12px 44px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: border-color .18s, box-shadow .18s;
}
.nv-comp__box:focus-within { border-color: rgba(255, 138, 43, .6); box-shadow: 0 0 0 3px rgba(255, 122, 26, .14), 0 12px 44px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06); }
.nv-comp textarea {
  display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent; color: var(--nv-ink);
  font: 16px/24px var(--f-body); padding: 6px 8px 4px; min-height: 34px; max-height: 34dvh; overflow-y: hidden;
}
.nv-comp textarea::placeholder { color: var(--nv-ink-3); }
.nv-comp__row { display: flex; align-items: center; gap: 6px; }
.nv-comp__row .grow { flex: 1; min-width: 0; }
.nv-comp__tool { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--nv-ink-2); transition: background .15s, color .15s; flex: none; }
.nv-comp__tool:hover { background: rgba(255, 255, 255, .07); color: var(--nv-ink); }
.nv-comp__tool.is-on { color: var(--nv-or-2); background: var(--nv-or-a); }
.nv-comp__tool.is-live { color: #1d0c00; background: var(--nv-or); animation: nvpulse 1s ease-in-out infinite; }
.nv-modelpill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px; min-width: 0; max-width: 100%;
  background: var(--nv-glass-3); border: 1px solid var(--nv-line); font: 500 12.5px var(--f-display); letter-spacing: .02em; color: var(--nv-ink-2);
}
.nv-modelpill:hover { border-color: var(--nv-line-2); color: var(--nv-ink); }
.nv-modelpill span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-modelpill .ic { width: 13px; height: 13px; color: var(--nv-ink-3); }
.nv-send {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; color: #1d0c00;
  background: linear-gradient(180deg, #ff9a45, #ff6a0a); box-shadow: 0 0 0 1px rgba(255, 180, 110, .55) inset, 0 6px 22px rgba(255, 106, 10, .45);
  transition: transform .12s, filter .2s, box-shadow .2s;
}
.nv-send:active { transform: scale(.92); }
.nv-send:disabled { opacity: .4; filter: saturate(.7); box-shadow: none; cursor: default; }
.nv-send .ic { width: 19px; height: 19px; }
.nv-comp__hint { text-align: center; color: var(--nv-ink-3); font-size: 11.5px; padding: 5px 10px 0; }
.nv-attached { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 6px 0; }
.nv-attached span { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--nv-or-a); border: 1px solid rgba(255, 138, 43, .35); font: 500 12px var(--f-mono); max-width: 100%; }
.nv-attached span b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.nv-attached button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--nv-ink-2); }
.nv-attached button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nv-attached .ic { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ markdown body (shared by both views) */
.nv-md { font-size: 15px; line-height: 1.62; overflow-wrap: anywhere; word-break: break-word; }
.nv-md > :first-child { margin-top: 0; }
.nv-md > :last-child { margin-bottom: 0; }
.nv-md p { margin: 0 0 .75em; }
.nv-md h1, .nv-md h2, .nv-md h3, .nv-md h4 { font-family: var(--f-display); letter-spacing: .02em; line-height: 1.25; margin: 1.1em 0 .45em; }
.nv-md h1 { font-size: 1.35em; } .nv-md h2 { font-size: 1.2em; } .nv-md h3 { font-size: 1.07em; } .nv-md h4 { font-size: 1em; color: var(--nv-ink-2); }
.nv-md ul, .nv-md ol { margin: 0 0 .8em; padding-left: 1.35em; }
.nv-md li { margin: .25em 0; }
.nv-md li::marker { color: var(--nv-or-2); }
.nv-md a { color: var(--nv-or-2); text-decoration: underline; text-decoration-color: rgba(255, 161, 77, .4); text-underline-offset: 2px; }
.nv-md blockquote { margin: .8em 0; padding: .1em 0 .1em 14px; border-left: 3px solid rgba(255, 138, 43, .55); color: var(--nv-ink-2); }
.nv-md hr { border: 0; border-top: 1px solid var(--nv-line-2); margin: 1.2em 0; }
.nv-md :not(pre) > code { font: .86em var(--f-mono); padding: .14em .42em; border-radius: 6px; background: rgba(255, 255, 255, .09); color: #ffd7b3; }
.nv-md strong { color: #fff; font-weight: 650; }
.nv-md img { max-width: 100%; border-radius: 10px; }
.md-table-wrap { overflow-x: auto; margin: .8em 0; border: 1px solid var(--nv-line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.md-table-wrap table { border-collapse: collapse; width: 100%; font-size: .93em; }
.md-table-wrap th, .md-table-wrap td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--nv-line); white-space: nowrap; }
.md-table-wrap th { font: 600 .82em var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--nv-ink-2); background: rgba(255, 255, 255, .04); }
.md-table-wrap tr:last-child td { border-bottom: 0; }
.md-code-block { margin: .85em 0; border-radius: 14px; overflow: hidden; background: rgba(3, 5, 10, .72); border: 1px solid var(--nv-line); }
.md-code-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 14px; background: rgba(255, 255, 255, .045); border-bottom: 1px solid var(--nv-line); }
.md-code-lang { font: 600 11px var(--f-mono); letter-spacing: .08em; text-transform: lowercase; color: var(--nv-ink-3); }
.md-code-actions { display: inline-flex; gap: 2px; }
.md-code-actions button { height: 26px; padding: 0 10px; border-radius: 8px; font: 500 12px var(--f-body); color: var(--nv-ink-2); }
.md-code-actions button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.md-code-actions button.copied { color: var(--nv-ok); }
.md-code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.md-code-block pre code.hljs { display: block; padding: 0; background: transparent; font: 12.6px/1.6 var(--f-mono); }
.is-streaming .nv-md > :last-child::after, .is-streaming .nv-md:empty::after {
  content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 3px; vertical-align: -2px; border-radius: 1px; background: var(--nv-or); animation: nvblink 1s steps(2) infinite;
}
@keyframes nvblink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .nv *, .nv *::before, .nv *::after { animation: none !important; transition-duration: .01ms !important; }
}
