/* Nnaico skin — free CSS (see skin.js). Colors come from skin.js variables.
   The style of nnaico.com: Inter + Instrument Sans, hairline cards (radius 14,
   soft shadow), amber primary buttons and eyebrows, the blue/amber hero glow. */

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

:root {
  --nn-shadow-s: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --nn-shadow-m: 0 2px 6px rgba(15, 23, 42, 0.06), 0 18px 40px rgba(15, 23, 42, 0.09);
}
html.dark {
  --nn-shadow-s: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  --nn-shadow-m: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 40px rgba(0, 0, 0, 0.4);
}

/* Actions are blue; the site's amber only for small accents (eyebrows, file
   icons), in the Nnaico scheme. Slate stays all blue and gray. */
:root {
  --nn-cta: var(--app-accent);
  --nn-cta-ink: #fff;
  --nn-cta-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.55);
  --nn-eyebrow: #64748b;
  --nn-bubble-shadow: none;
}
html.dark {
  --nn-eyebrow: #93a8cc;
}
html[data-scheme="nnaico"] {
  --nn-eyebrow: #ff7a1a;
}
html.dark[data-scheme="nnaico"] {
  --nn-bubble-shadow: 0 6px 18px -8px rgba(37, 99, 235, 0.45);
}

/* Normal style only: terminal keeps its mono font (everything else is shared) */
html:not(.terminal) body {
  font-feature-settings: 'ss01', 'cv11';
  letter-spacing: -0.005em;
}

/* --- User bubble: the scheme's color, flat bottom-right corner --- */
html .user-message .MuiPaper-root {
  background: var(--app-user-bubble-bg) !important;
  border: none !important;
  border-radius: 16px 16px 4px 16px !important;   /* the composer's 16 */
  box-shadow: var(--nn-bubble-shadow);
}
/* dark mode: white ink on the blue bubble, whatever the scheme's bubble text */
html.dark[data-scheme="nnaico"] .user-message .chat-user-text {
  color: #fff !important;
}
html .user-message .chat-user-text a {
  color: inherit;
  text-decoration: underline;
}

/* --- Input bar: a floating card instead of a full-width strip --- */
html .chat-input {
  border-top: none !important;
  background: transparent !important;
}
/* the composer box = the row holding the file input */
html #chatForm > div:has(> input[type="file"]) {
  border-radius: 16px;
  box-shadow: var(--nn-shadow-m);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
/* focus stays quiet: the same hairline, no colored ring */
html #chatForm > div:has(> input[type="file"]):focus-within {
  border-color: var(--app-separator) !important;
  box-shadow: var(--nn-shadow-m);
}
/* desktop: a two-row composer, the text on top, the controls below */
@media (min-width: 769px) {
  html #chatForm > div:has(> input[type="file"]) {
    flex-wrap: wrap;
    align-items: center;
    border-radius: 16px;
    padding: 12px 10px 8px;
    row-gap: 4px;
  }
  html #chatForm > div:has(> input[type="file"]) > div:has(> textarea) {
    order: -1;
    flex: 1 0 100%;
    padding-left: 8px;
    padding-right: 8px;
  }
  html #chatForm > div:has(> input[type="file"]) > .assistant-chip {
    margin-left: auto;
  }
  /* send sits in the corner's curve: the same gap on the right as below */
  html #chatForm #sendButton {
    margin-right: 0 !important;
  }
  html #chatForm > div:has(> input[type="file"]) {
    padding-right: 8px;
  }
}

/* Send button: a filled blue circle */
html #sendButton {
  background: var(--nn-cta) !important;
  color: var(--nn-cta-ink) !important;
  border-radius: 50% !important;
  box-shadow: var(--nn-cta-shadow);
}
html #sendButton:disabled {
  box-shadow: none;
  opacity: 0.45;
}

/* --- Layout: full page; the sidebar a white column on the tinted canvas --- */
html .app-container {
  background: var(--app-chat-bg, #f5f7fa);
}
@media (min-width: 769px) {
  html .app-container > #sidebar {
    border-right: 1px solid var(--app-separator) !important;
    box-shadow: 8px 0 28px -22px rgba(30, 58, 138, 0.35);
  }
}

/* --- Header: a full-width white bar over the tinted canvas --- */
html main > header.MuiPaper-root {
  background: color-mix(in srgb, var(--app-paper) 82%, transparent) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--app-separator) !important;
  box-shadow: none !important;
}

/* the page menu as one segmented pill control */
html header .MuiToolbar-root div:has(> a.MuiButton-root) {
  background: var(--app-paper, #fff);
  border: 1px solid var(--app-separator);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  box-shadow: var(--nn-shadow-s);
}
html header .MuiToolbar-root div:has(> a.MuiButton-root) > .MuiButton-root {
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 600;
}
html header .MuiToolbar-root div:has(> a.MuiButton-root) > a.MuiButton-root:hover {
  background: var(--app-accent-wash);
  color: var(--app-accent-text);
}

/* --- Answers: a quiet white sheet, no border or shadow, the bubble's radius --- */
html .assistant-message .chat-assistant-text {
  background: var(--app-paper, #fff) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 16px;
  padding: 18px 24px;
}
/* light mode: the page is white, so the answer is plain text, as on Meta AI */
html:not(.dark) .assistant-message .chat-assistant-text {
  background: transparent !important;
  padding: 2px 4px !important;
}
/* one turn saved as several messages (a file, then the text) reads as one
   sheet: the parts join, the tools show once, under the last part */
html .assistant-message:has(+ .assistant-message) .chat-assistant-text {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: 6px;
}
html .assistant-message:has(+ .assistant-message) .message-tools-container {
  display: none;
}
html .assistant-message + .assistant-message .chat-assistant-text {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding-top: 6px;
}

/* --- Filled buttons: blue pills --- */
html .MuiButton-containedPrimary {
  border-radius: 999px;
  box-shadow: none;
  font-weight: 600;
}
html .MuiButton-containedPrimary:hover {
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.55);
}

/* --- Answers: headings in the site's heading font (normal style; terminal stays mono) --- */
html:not(.terminal) .chat-assistant-text h1,
html:not(.terminal) .chat-assistant-text h2,
html:not(.terminal) .chat-assistant-text h3 {
  font-family: var(--app-heading-font) !important;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}


/* --- Sidebar: one surface with the canvas, a hairline apart; pill items --- */
@media (min-width: 769px) {
  html .app-container > #sidebar {
    box-shadow: none !important;
  }
}
html #sidebar > div {
  background: var(--app-chat-bg) !important;
}
/* light mode: a soft gray column beside the white page */
html:not(.dark) #sidebar > div {
  background: #f7f8fa !important;
}
html #sidebar .MuiButton-root {
  border-radius: 999px;
}
/* New Chat as the filled pill on top */
html #sidebar > div > div:nth-child(2) > .MuiButton-root {
  background: var(--app-accent-wash);
}
html #historyList .MuiListItemButton-root {
  border-radius: 12px;
}

/* --- Empty chat = a home: greeting and composer in the middle of the page --- */
html #chat-area:has(#chatContainer:empty):not(:has(#chatWelcome)) {
  justify-content: center;
  padding-bottom: 14vh;
}
/* the home on plain white (light mode): the brand is the only thing to see */
html:not(.dark) .app-container:has(#chatContainer:empty):not(:has(#chatWelcome)) main {
  background: #fff;
}
html #chat-area:has(#chatContainer:empty):not(:has(#chatWelcome)) > #chatScrollContainer {
  flex: 0 0 0;
  overflow: hidden;
}
html #chat-area:has(#chatContainer:empty):not(:has(#chatWelcome)) > .chat-starters {
  order: 3;
}
html #chat-area:has(#chatContainer:empty):not(:has(#chatWelcome)) .chat-disclaimer {
  visibility: hidden;
}

/* --- Assistant chip inside the input: plain text, like a model picker --- */
html #chatForm .assistant-chip {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--app-accent-text);
}
html #chatForm .assistant-chip:hover {
  background: var(--app-accent-wash) !important;
}

/* --- Answer tables, as on the site: small caps headers, hairline rows, no grid --- */
html .assistant-message table {
  border-collapse: collapse !important;
  border: none !important;
  background: transparent !important;
}
html .assistant-message th {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--app-separator) !important;
  text-transform: uppercase;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em;
  color: #64748b !important;
  padding: 8px 14px !important;
}
html .assistant-message td {
  border: none !important;
  border-bottom: 1px solid var(--app-separator) !important;
  padding: 10px 14px !important;
}
html .assistant-message tr:last-child td {
  border-bottom: none !important;
}
html .assistant-message tbody tr:hover td {
  background: var(--app-accent-wash);
}
html.dark .assistant-message th {
  color: #93a8cc !important;
}

/* --- Context labels ("How I got this") as the site's eyebrows: amber small caps --- */
html .activity-block > [role="button"] {
  text-transform: uppercase;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--nn-eyebrow) !important;
}
html .activity-block > [role="button"]:hover {
  color: var(--app-accent) !important;
}

/* --- File cards: outlined only (hairline, no fill, no shadow), so they never
       read as the user's filled bubbles; a line file icon instead of the emoji --- */
html .file-card {
  border-radius: 14px !important;
  box-shadow: none !important;
  border: 1px solid var(--app-separator) !important;
  background: transparent !important;
  padding: 10px 14px !important;
}
html .file-card-icon {
  font-size: 0 !important;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: var(--nn-eyebrow);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* a file card says what its file is: the kind as a badge (data-kind, set by
   the app from the file's extension), in the color people know it by */
html .file-card-icon[data-kind] {
  width: auto;
  height: auto;
  min-width: 40px;
  -webkit-mask: none;
  mask: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html .file-card-icon[data-kind]::after {
  content: attr(data-kind);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 6px;
  border-radius: 6px;
  color: #fff;
  background: var(--nn-eyebrow);
}
html .file-card-icon[data-kind="PDF"]::after { background: #d93025; }
html .file-card-icon[data-kind="DOCX"]::after,
html .file-card-icon[data-kind="DOC"]::after { background: #2b579a; }
html .file-card-icon[data-kind="XLSX"]::after,
html .file-card-icon[data-kind="XLSM"]::after,
html .file-card-icon[data-kind="CSV"]::after { background: #217346; }
html .file-card-icon[data-kind="PPTX"]::after { background: #d24726; }
html .file-card .MuiButton-root,
html .file-card button {
  border-radius: 999px !important;
}
html .assistant-message div:has(> table) {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
html .assistant-message tr {
  background: transparent !important;
}

/* --- No mic in the input on desktop (it stays on phones) --- */
@media (min-width: 769px) {
  #chatForm div:has(> span > .MuiIconButton-root > svg.lucide-mic) {
    display: none !important;
  }
}
/* without the mic the chip would touch the send button */
#chatForm .assistant-chip {
  margin-right: 10px;
}

/* --- Empty chat: the company's name/logo, large, over the composer --- */
html #chat-area:has(#chatContainer:empty):not(:has(#chatWelcome)) > #chat-input {
  display: flex;
  flex-direction: column;
}
html #chat-area:has(#chatContainer:empty):not(:has(#chatWelcome)) .chat-input-content {
  width: 100%;
  box-sizing: border-box;
}
html #chat-area:has(#chatContainer:empty):not(:has(#chatWelcome)) .chat-home-brand {
  order: -1;
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.chat-home-brand img {
  max-height: 84px;
  max-width: min(420px, 80%);
  object-fit: contain;
}
.chat-home-brand span {
  font-family: var(--app-heading-font);
  font-size: clamp(36px, 4.2vw, 58px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
}

/* --- Menu in the sidebar (navigation 'sidebar'): on desktop the header holds
       only Share and floats over the chat (Header.jsx): translucent, the
       messages scroll under it, no line --- */
@media (min-width: 900px) {
  html .app-container:has(.sidebar-brand) main > header.MuiPaper-root {
    background: color-mix(in srgb, var(--app-chat-bg) 35%, transparent) !important;
    backdrop-filter: blur(8px);
    border-bottom: none !important;
  }
}
/* the company's name is a name, not a heading: Inter, not the heading font */
header .MuiTypography-h6 {
  font-family: var(--app-font) !important;
}

/* --- Share in the palette's blue instead of the default orange --- */
html header .MuiButton-root:has(svg.lucide-share-2),
html header .MuiIconButton-root:has(svg.lucide-share-2) {
  color: var(--app-accent) !important;
  border-color: var(--app-accent) !important;
  background: transparent !important;
}
html header .MuiButton-root:has(svg.lucide-users),
html header .MuiIconButton-root:has(svg.lucide-users) {
  color: #fff !important;
  border-color: var(--app-accent) !important;
  background: var(--app-accent) !important;
}

/* --- Terminal style: the same skin with square corners --- */
html.terminal .user-message .MuiPaper-root,
html.terminal #chatForm > div:has(> input[type="file"]),
html.terminal #sendButton,
html.terminal .assistant-message .chat-assistant-text,
html.terminal .MuiButton-containedPrimary,
html.terminal #sidebar .MuiButton-root,
html.terminal #historyList .MuiListItemButton-root,
html.terminal header .MuiToolbar-root div:has(> a.MuiButton-root),
html.terminal header .MuiToolbar-root div:has(> a.MuiButton-root) > .MuiButton-root,
html.terminal .file-card,
html.terminal .file-card .MuiButton-root,
html.terminal .file-card button,
html.terminal .file-card-icon[data-kind]::after {
  border-radius: 0 !important;
}
