/* Tokens e componentes do chat aicd. Fonte da verdade: visual-chat.md. Só neutros, sem sombra, um único movimento (pulse). */
@font-face { font-family: 'Martian Mono'; font-weight: 300; src: url(/fonts/martian-mono-latin-300-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Martian Mono'; font-weight: 400; src: url(/fonts/martian-mono-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Martian Mono'; font-weight: 500; src: url(/fonts/martian-mono-latin-500-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; src: url(/fonts/fraunces-latin-full-italic.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'IM Fell English'; font-style: italic; font-weight: 400; src: url(/fonts/im-fell-english-latin-400-italic.woff2) format('woff2'); font-display: swap; }

:root {
  --bg: #0a0a0a; --line: #242424; --line-strong: #303030; --line-chip: #3a3a3a; --row-active: #1c1c1c;
  --text: #ededed; --text-hero: #f2f2f2; --text-body: #e0e0e0; --text-nav: #d4d4d4; --text-soft: #b4b4b4;
  --text-muted: #9a9a9a; --text-label: #808080; --text-off: #555555;
  --st-ok: #f2f2f2; --st-mid: #8c8c8c; --st-low: #4a4a4a;
  --mono: 'Martian Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 12px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
button, input, textarea, code, pre { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
[hidden] { display: none !important; }
::selection { background: #303030; }
:focus-visible { outline: 1px solid var(--text-muted); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-label); }
.ibtn { width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.ibtn:hover { background: var(--row-active); color: var(--text); }
.chip { height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-chip); display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.chip.quiet { border-color: transparent; color: var(--text-muted); }
.chip:hover { background: var(--row-active); }
.tag { font-size: 12px; color: #bdbdbd; border: 1px solid var(--line-chip); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.tag.off { color: var(--text-label); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-ok); display: inline-block; flex: none; }

/* layout */
#app { height: 100%; }
.shell { display: flex; height: 100%; }
.side { width: 280px; max-width: 280px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; overflow: hidden; }
.rrow { position: relative; display: flex; align-items: center; }
.rrow .recent { flex: 1; min-width: 0; padding-right: 40px; }
.dotbtn { position: absolute; right: 2px; width: 32px; height: 32px; opacity: 0; }
.rrow:hover .dotbtn, .rrow:focus-within .dotbtn, .dotbtn[aria-expanded=true] { opacity: 1; }
.hide-desk { display: none; }
@media (min-width: 821px) { .side.hide { display: none; } }
.side .top { display: flex; align-items: center; gap: 4px; padding: 4px 6px 16px; }
.brandname { font: italic 300 28px/1 'Fraunces', Georgia, serif; font-variation-settings: 'SOFT' 100, 'WONK' 1; letter-spacing: -.8px; color: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 12px; color: var(--text-nav); width: 100%; text-align: left; }
.row:hover, .row.active { background: var(--row-active); }
.row.off { color: var(--text-off); cursor: default; } .row.off:hover { background: none; }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sect { display: flex; align-items: center; justify-content: space-between; padding: 22px 10px 6px; }
.recent { display: block; padding: 10px; border-radius: 12px; color: #c4c4c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: left; }
.recent:hover, .recent.active { background: var(--row-active); }
.scroll { overflow-y: auto; min-height: 0; flex: 1; }
.foot { border-top: 1px solid var(--line); margin: 8px -12px 0; padding: 12px 22px 0; display: flex; flex-direction: column; gap: 10px; color: var(--text-muted); }
.who { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--line-strong); display: flex; align-items: center; justify-content: center; font-weight: 500; color: var(--text); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; isolation: isolate; overflow: hidden; }
.topbar { display: flex; justify-content: flex-end; align-items: center; padding: 14px 24px; gap: 4px; min-height: 72px; }
.mobilebar { display: none; }

/* início */
.orbit { position: absolute; inset: 0; z-index: -1; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.home { flex: 1; width: 100%; max-width: 728px; margin: 0 auto; padding: 0 24px 120px; display: flex; flex-direction: column; justify-content: center; }
.hero { margin: 0 0 44px; text-align: center; font: italic 300 88px/1.15 'Fraunces', Georgia, serif; font-variation-settings: 'SOFT' 100, 'WONK' 1; letter-spacing: -2px; color: var(--text-hero); }
.eyebrow { text-align: center; margin: 20px 0; }
.flow { text-align: center; color: var(--text-label); margin-top: 56px; }

/* compositor */
.composer { background: var(--bg); border: 1px solid var(--line-strong); border-radius: 24px; padding: 14px 18px 12px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.composer textarea { width: 100%; resize: none; background: transparent; border: 0; outline: 0; font-size: 15px; line-height: 1.5; max-height: 200px; min-height: 28px; color: var(--text); }
.composer textarea::placeholder { color: var(--text-label); }
.comprow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.comprow .sp { flex: 1; }
.send { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--text-hero); display: inline-flex; align-items: center; justify-content: center; color: var(--text-hero); }
.send:disabled { border-color: var(--line-chip); color: var(--text-off); cursor: default; }
.files { display: flex; gap: 6px; flex-wrap: wrap; }
.ctx { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; color: var(--text-muted); border-radius: 999px; }
.ctx:hover { background: var(--row-active); }
.ctxbar { width: 36px; height: 3px; background: var(--line-strong); border-radius: 999px; overflow: hidden; }
.ctxbar i { display: block; height: 100%; background: var(--st-ok); }

/* menus */
.menu { position: absolute; z-index: 20; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 16px; padding: 6px; min-width: 300px; max-height: 60vh; overflow-y: auto; }
.menu .row { min-height: 44px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 8px; }
.legend { display: flex; gap: 16px; padding: 10px 14px 6px; color: var(--st-mid); font-size: 11px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }

/* conversa */
.convhead { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 16px; min-height: 57px; }
.hl, .hr { display: flex; gap: 2px; flex: 1; } .hr { justify-content: flex-end; } .flip svg { transform: scaleX(-1); }
.ptabs { display: flex; gap: 18px; }
.ptab { letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); font-size: 11px; padding-bottom: 6px; border-bottom: 1px solid transparent; } .ptab span { color: var(--text-off); } .ptab.on { color: var(--text); border-bottom-color: var(--text); }
.convbody { flex: 1; overflow-y: auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 700px) minmax(0, 1fr); gap: 24px; padding: 32px 24px 24px; }
.col { width: 700px; max-width: 100%; min-width: 0; }
.srcpanel { position: fixed; top: 57px; right: 0; bottom: 0; width: 320px; z-index: 5; background: var(--bg); border-left: 1px solid var(--line-strong); overflow-y: auto; padding: 0 16px 16px; }
.com-painel .convbody, .com-painel .dock { padding-right: 320px; }
.srcpanel .h { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 8px; color: var(--text-muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.src { padding: 12px 0; border-bottom: 1px solid var(--line); display: block; }
.src:last-child { border: 0; }
.src .o { color: var(--text-label); } .src .t { color: var(--text); font-weight: 500; display: block; margin: 2px 0; } .src .s { color: var(--text-muted); font-size: 12px; }
.q { font-size: 12px; font-weight: 400; letter-spacing: 2px; line-height: 1.9; margin: 0 0 20px; display: block; width: fit-content; max-width: 85%; margin-left: auto; padding: 10px 16px; background: var(--row-active); border-radius: 16px; color: var(--text-label); overflow-wrap: anywhere; white-space: pre-wrap; }
.ctitle { flex: 0 1 auto; min-width: 0; max-width: 60%; text-align: center; margin: 0 16px; font: italic 400 22px/1.2 'IM Fell English', Georgia, serif; color: var(--text-hero); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn { margin-bottom: 36px; }
.think { margin: 0 0 20px; }
.think > summary, .think > .sum { list-style: none; display: flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; min-height: 32px; }
.think > summary::-webkit-details-marker { display: none; }
.steps { margin: 6px 0 0 8px; padding-left: 16px; border-left: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; align-items: center; gap: 12px; min-height: 36px; color: var(--text-soft); }
.step svg { color: var(--text-muted); }
.answer { font-size: 14px; line-height: 1.9; color: var(--text-body); overflow-wrap: anywhere; }
.answer p { margin: 0 0 14px; } .answer h1, .answer h2, .answer h3 { font-weight: 500; font-size: 14px; margin: 22px 0 8px; color: var(--text); }
.answer ul, .answer ol { margin: 0 0 14px; padding-left: 22px; } .answer li { margin: 2px 0; }
.answer code { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.answer pre { border: 1px solid var(--line-strong); border-radius: 2px; padding: 12px 14px; overflow-x: auto; line-height: 1.6; margin: 0 0 14px; }
.answer pre code { border: 0; padding: 0; border-radius: 0; }
.codebox { border: 1px solid var(--line-strong); border-radius: 2px; margin: 0 0 14px; }
.codebar { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 14px; border-bottom: 1px solid var(--line-strong); }
.codebar .grow { flex: 1; } .codebar .lang { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.answer .codebox pre { border: 0; margin: 0; }
.answer a { text-decoration: underline; text-underline-offset: 3px; }
.answer blockquote { margin: 0 0 14px; padding-left: 14px; border-left: 1px solid var(--line-strong); color: var(--text-soft); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 2px; margin: 0 0 14px; }
.answer table { border-collapse: collapse; width: 100%; min-width: 420px; }
.answer th { text-align: left; font-weight: 500; border-bottom: 1px solid var(--line-strong); }
.answer th, .answer td { overflow-wrap: break-word; vertical-align: top; } .answer th { white-space: nowrap; } .answer td { min-width: 12ch; }
.answer th, .answer td { padding: 10px 14px; line-height: 1.5; } .answer tr + tr td { border-top: 1px solid var(--line); }
.cite { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 1px solid var(--line-chip); border-radius: 999px; font-size: 11px; color: var(--text-muted); vertical-align: 1px; margin: 0 2px; }
.cite:hover { color: var(--text); }
.actions { display: flex; gap: 2px; margin: 4px -10px 12px; flex-wrap: wrap; }
.follow { display: flex; flex-direction: column; margin-top: 8px; }
.follow button { text-align: left; min-height: 44px; color: var(--text-nav); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.dock { padding: 0 24px 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 700px) minmax(0, 1fr); gap: 24px; }
.err { border: 1px solid var(--line-chip); border-radius: 12px; padding: 12px 14px; color: var(--text-soft); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.empty { color: var(--text-label); padding: 24px 10px; }

/* painel de memória e modais */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 30; display: flex; justify-content: flex-end; }
.drawer { width: 460px; max-width: 100%; height: 100%; background: var(--bg); border-left: 1px solid var(--line-strong); display: flex; flex-direction: column; }
.drawer .hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer .bd { overflow-y: auto; flex: 1; padding: 8px 20px 20px; }
.drawer.wide { width: 640px; }
button.mem { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.mem { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mem .m { display: flex; gap: 8px; align-items: center; color: var(--text-label); font-size: 11px; }
.mem .t { color: var(--text); font-weight: 500; margin: 4px 0 2px; overflow-wrap: anywhere; } .mem .s { color: var(--text-muted); overflow-wrap: anywhere; }
.search { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 16px; height: 44px; margin: 12px 0 4px; }
.search input { flex: 1; background: none; border: 0; outline: 0; }
.modal { margin: auto; width: 420px; max-width: calc(100% - 32px); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.veil.center { justify-content: center; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input { height: 44px; background: none; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px; outline: 0; }
.field input:focus { border-color: var(--text-muted); }
.btn { height: 44px; border-radius: 999px; border: 1px solid var(--text-hero); color: var(--text-hero); padding: 0 20px; }
.btn.ghost { border-color: var(--line-chip); color: var(--text-muted); }
.login { margin: auto; width: 360px; max-width: calc(100% - 32px); display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.login .brandname { font-size: 56px; text-align: center; }
.status { font-size: 12px; color: var(--text-muted); }

/* celular */
.scrim { display: none; }
@media (max-width: 820px) {
  .chip, .ctx, .row, .recent, .ibtn, .ptab { min-height: 44px; } .ibtn { min-width: 44px; }
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 300px; max-width: 300px; background: var(--bg); transform: translateX(-100%); transition: none; }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.65); }
  .mobilebar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 6px; }
  .topbar.desk { display: none; }
  .hero { font-size: 52px; letter-spacing: -1px; margin-bottom: 28px; }
  .home { padding: 0 16px 24px; justify-content: flex-end; }
  .home .flow { display: none; }
  .mark svg { width: 56px; height: 56px; }
  .cols, .dock { grid-template-columns: minmax(0, 1fr); gap: 24px; } .cols > div:empty, .dock > div:empty { display: none; } .cols { padding: 20px 16px; } .srcpanel { width: 100%; border-left: 0; z-index: 20; } .com-painel .convbody, .com-painel .dock { padding-right: 0; } .hide-desk { display: inline-flex; } .hide-mobile { display: none; } .dotbtn { opacity: 1; width: 44px; height: 44px; right: 0; }
  .ctitle { font-size: 18px; max-width: 56%; margin: 0 4px; } .convhead { padding: 6px 4px; } .dock { padding: 0 12px 12px; }
  .drawer { width: 100%; }
}

.gen { display: block; width: fit-content; max-width: 100%; margin: 6px 0 14px; border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; } .gen img { display: block; max-width: 100%; height: auto; max-height: 520px; }
.srcpanel .gen { margin: 12px 0; }

.quote { display: flex; align-items: flex-start; gap: 4px; border-left: 1px solid var(--line-strong); padding-left: 12px; color: var(--text-soft); font-size: 12px; line-height: 1.7; }
.quote .qtxt { flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 0; }
.resp-flut { position: fixed; z-index: 60; background: var(--bg); border: 1px solid var(--line-strong); }
.answer a.arq { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; margin: 2px 6px 2px 0; }

.arqwrap { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 2px 6px 2px 0; } .arqwrap .arq { margin: 0; }
.gen + .arqsv { display: flex; margin: 4px 0 14px; } .arqsv:disabled { color: var(--text-off); }
.gal { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.gitem { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gitem img, .gitem .gfile { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 2px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.gmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .gmeta a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .gmeta span { font-size: 11px; color: var(--text-muted); }
.answer a.arq { max-width: 100%; min-width: 0; } .arqn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 820px) { .gmeta a { min-height: 44px; display: flex; align-items: center; } }
.gmeta .lnk { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 820px) { .gmeta .lnk { min-height: 44px; } }
