/* Inco AI page. Same colors and fonts as styles.css. */
:root {
  --bg: #0e0e0e;
  --surface: #161616;
  --raised: #1a1a1a;
  --border: #2a2a2a;
  --hover: #2a2a2a;
  --text: #ececec;
  --muted: #888888;
  --accent: #e6c07b;
  --accent-deep: #b0893e;
  --danger: #f28b82;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

.app { display: flex; height: 100vh; height: 100dvh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Sidebar, logged in only */
.sidebar {
  width: 260px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px; gap: 8px;
}
.chat-groups { flex: 1; overflow-y: auto; margin: 4px -4px; padding: 0 4px; }
.group-title { font-size: 12px; color: var(--muted); margin: 14px 8px 4px; }
.chat-item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.chat-item:hover, .chat-item:focus-within { background: var(--hover); }
.chat-item.active { background: var(--raised); }
.chat-open {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 9px 10px;
  border-radius: 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px;
}
.chat-more {
  flex: none; background: none; border: 0; color: var(--muted); width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; opacity: 0;
}
.chat-item:hover .chat-more, .chat-item:focus-within .chat-more, .chat-more[aria-expanded="true"] { opacity: 1; }
.chat-more:hover { color: var(--text); }
.chat-rename {
  flex: 1; min-width: 0; margin: 4px; padding: 5px 8px; background: var(--bg); color: var(--text);
  border: 1px solid var(--accent); border-radius: 8px; font: inherit; font-size: 14px;
}
.side-user { margin: 0; padding: 10px 8px 2px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.side-user strong { color: var(--text); }

/* Menus */
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px;
  background: var(--raised); border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.menu-panel button {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.menu-panel button:hover, .menu-panel button:focus-visible { background: var(--hover); }
.menu-panel .danger { color: var(--danger); }
.chat-item .menu-panel { top: 100%; }

/* Top bar */
.topbar {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.brand { display: inline-flex; border-radius: 8px; }
.brand img { display: block; }
.title { font-size: 16px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; flex-wrap: nowrap; flex-shrink: 0; gap: 8px; }
.icon-btn, .btn-new, .btn-login, .btn-user, .btn-close {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--raised);
  text-decoration: none; color: var(--text); cursor: pointer; font-size: 14px;
  white-space: nowrap; flex-shrink: 0;
}
.icon-btn { padding: 0; width: 38px; }
.icon-btn:hover, .btn-new:hover, .btn-user:hover, .btn-close:hover { background: var(--hover); }
.btn-login { background: var(--accent); color: #1a1408; border-color: var(--accent); font-weight: 600; }
.btn-login:hover { background: var(--accent-deep); color: #1a1408; }
.btn-new.wide { width: 100%; justify-content: flex-start; border-radius: 12px; min-height: 42px; }
.user-menu { position: relative; }
.btn-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 36px; }

/* Messages */
.column-wrap { flex: 1; overflow-y: auto; }
.column { max-width: 760px; margin: 0 auto; padding: 0 24px; position: relative; }
.noscript { text-align: center; color: var(--muted); padding: 40px 24px; }
.welcome { text-align: center; padding: 12vh 0 28px; }
.welcome .eyebrow {
  display: block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.welcome h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; margin: 0 0 12px; }
.welcome p { color: var(--text-soft, #dddddd); max-width: 36em; margin: 0 auto 24px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  background: var(--raised); border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px;
  cursor: pointer; font-size: 14px; min-height: 44px;
}
.chip:hover { background: var(--hover); }
.log { padding: 20px 0 12px; }
.msg { margin: 0 0 22px; }
.msg-user { display: flex; justify-content: flex-end; }
.bubble {
  max-width: 80%; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.who { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.tag { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; }
.answer { overflow-wrap: anywhere; }
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer p, .answer ul, .answer ol { margin: 0 0 12px; }
.answer ul, .answer ol { padding-left: 22px; }
.answer h3, .answer h4, .answer h5, .answer h6 { font-size: 16px; margin: 18px 0 8px; }
.answer code { font-family: var(--mono); font-size: 0.9em; background: var(--raised); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }
.code { position: relative; margin: 0 0 12px; }
.code pre, .answer pre.table {
  margin: 0; background: var(--raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.5;
}
.answer pre.table { margin-bottom: 12px; }
.code pre code { background: none; border: 0; padding: 0; }
.copy-code {
  position: absolute; top: 6px; right: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--muted);
}
.copy-code:hover { color: var(--text); }
.msg-tools { display: flex; gap: 10px; align-items: center; margin-top: 6px; min-height: 28px; }
.msg-tools .copy {
  background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 13px;
  padding: 2px 8px; cursor: pointer; opacity: 0;
}
.msg-assistant:hover .copy, .msg-assistant:focus-within .copy { opacity: 1; }
.msg-tools .copy:hover { color: var(--text); border-color: var(--border); }
.note { color: var(--muted); font-size: 13px; }
.msg-error { color: var(--danger); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.retry { background: var(--raised); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; color: var(--text); }
.dots { display: inline-flex; gap: 4px; padding: 8px 0; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Composer */
.dock { padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.jump {
  position: absolute; left: 50%; top: -52px; transform: translateX(-50%); width: 40px; height: 40px;
  border-radius: 50%; background: var(--raised); border: 1px solid var(--border); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.notice {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  margin-bottom: 8px; font-size: 14px;
}
.notice p { margin: 0; }
.turnstile-box { margin-top: 8px; }
.few-left { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-align: right; }
.composer {
  display: flex; align-items: flex-end; gap: 8px; background: var(--raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 8px 8px 14px;
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit;
  line-height: 24px; max-height: calc(24px * 8 + 12px); padding: 6px 0; overflow-y: auto;
}
.composer textarea::placeholder { color: var(--muted); }
.composer.disabled { opacity: 0.6; }
.send {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: #1a1408;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.send:hover { background: var(--accent-deep); }
.send:disabled { background: var(--hover); color: var(--muted); cursor: default; }
.send .i-stop { display: none; }
.send.stop .i-stop { display: block; }
.send.stop .i-send { display: none; }
.counter { margin: 4px 2px 0; font-size: 12px; color: var(--muted); text-align: right; min-height: 0; }
.counter:empty { display: none; }
.counter.over { color: var(--danger); }
.foot { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* Privacy dialog */
.privacy {
  max-width: 560px; width: calc(100% - 32px); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; font-size: 15px;
}
.privacy::backdrop { background: rgba(0, 0, 0, 0.6); }
.privacy h2 { font-size: 20px; margin: 0 0 12px; }
.privacy p { margin: 0 0 12px; }
.btn-close { margin-top: 4px; }

.backdrop { display: none; }

@media (max-width: 767px) {
  .column { padding: 0 16px; }
  .topbar { padding: 8px 10px; gap: 6px; }
  .top-actions { gap: 6px; }
  .btn-login { padding: 0 12px; }
  .btn-new .label { display: none; }
  .btn-new:not(.wide) { padding: 0; width: 44px; }
  .icon-btn, .btn-new, .btn-login, .btn-user { min-height: 44px; }
  .icon-btn { width: 44px; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(300px, 85vw);
    transform: translateX(-100%); transition: transform 0.2s ease; visibility: hidden;
  }
  .sidebar.open { transform: none; visibility: visible; }
  .backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.55); }
  .backdrop.open { display: block; }
  .chat-open { padding: 12px 10px; }
  .chat-more { width: 44px; height: 44px; opacity: 1; }
  .send { width: 44px; height: 44px; }
  .bubble { max-width: 88%; }
  .welcome { padding-top: 8vh; }
}
@media (min-width: 768px) {
  .drawer-btn { display: none !important; }
}
@media (max-width: 479px) {
  .chip-wide { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .dots span { animation: none; opacity: 0.7; }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--raised);
}
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] { color: var(--accent); background: var(--surface); }
.lang-switch .lang-sep { color: var(--border); padding: 0 1px; user-select: none; }

.btn-new, .btn-login, .btn-user, .btn-close {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-new:hover, .btn-user:hover, .btn-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(230, 192, 123, 0.16);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(230, 192, 123, 0.4);
}
@media (prefers-reduced-motion: reduce) {
  .btn-new, .btn-login, .btn-user, .btn-close { transition: none; }
  .btn-new:hover, .btn-login:hover, .btn-user:hover, .btn-close:hover { transform: none; box-shadow: none; }
}


/* Site menu (shared chrome), kept apart from the user-menu panel */
.topbar .menu { position: relative; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 38px;
  border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--raised); color: var(--text); border: 1px solid var(--border);
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] {
  background: var(--hover); border-color: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 192, 123, 0.16);
}
.menu-btn[aria-expanded="true"] .menu-icon { color: var(--accent); }
.topbar .menu > #site-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
  display: flex; flex-direction: column; gap: 2px; min-width: 220px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--accent);
  border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  transform-origin: calc(100% - 22px) 0;
}
.topbar .menu > #site-menu[hidden] { display: none; }
.topbar .menu > #site-menu.is-open { animation: menu-pop 0.18s ease-out; }
.topbar .menu > #site-menu.is-leaving { animation: menu-pop-out 0.16s ease-in forwards; }
.topbar .menu > #site-menu a {
  display: flex; align-items: center; color: var(--text); text-decoration: none;
  padding: 9px 12px; border-radius: 10px; font-size: 15px;
}
.topbar .menu > #site-menu a:hover, .topbar .menu > #site-menu a:focus-visible { background: var(--hover); }
.topbar .menu > #site-menu a[aria-current="page"] { color: var(--accent); }
.topbar .menu > #site-menu .menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.topbar .menu .menu-group { display: flex; flex-direction: column; gap: 2px; }
.topbar .menu .menu-label {
  padding: 6px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); opacity: 0.7;
}
@keyframes menu-pop {
  from { opacity: 0; transform: scale(0.92) translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes menu-pop-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scale(0.92) translateY(-8px); }
}
@media (max-width: 600px) {
  .topbar .menu { position: static; }
  .topbar .menu > #site-menu { left: 12px; right: 12px; top: calc(100% + 8px); min-width: 0; max-height: calc(100vh - 90px); overflow-y: auto; }
  .menu-btn { gap: 0; padding-left: 8px; padding-right: 8px; }
  .menu-btn > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-btn { transition: none; }
  .menu-btn:hover { transform: none; box-shadow: none; }
  .topbar .menu > #site-menu.is-open,
  .topbar .menu > #site-menu.is-leaving { animation: none; }
}

.badge-nov {
  display: inline-block; margin: 0 0 0 6px; padding: 1px 8px; border-radius: 999px;
  background: #3a2a12; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.nav-badge { margin-left: 4px; padding: 0 6px; font-size: 10px; }
