:root {
  --bg: rgb(0, 0, 0);
  --panel: #000000;
  --line: #353535;
  --text: #eef3f7;
  --muted: #a9b3be;
  --pink: #ff3fb2;
  --cyan: #21d4fd;
  --r: 14px;
}

* { box-sizing: border-box }

html, body { height: 100% }

body {
  margin: 0;
  background: radial-gradient(1000px 500px at -10% -10%, rgba(0, 0, 0, 0.12), transparent 50%),
              radial-gradient(1000px 500px at 110% -10%, rgba(0, 0, 0, 0.12), transparent 50%),
              var(--bg);
  color: var(--text);
  font: 400 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

/* acentos cromáticos */
.pink { color: var(--pink) }
.cyan { color: var(--cyan) }

/* layout base */
.row { display: flex; gap: 8px; align-items: center }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line)
}

.icon {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  width: 36px; height: 36px; /* levemente menor */
  display: grid; place-items: center
}

.logo { font-weight: 800; letter-spacing: .2px }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 300px;
  background: rgba(0, 0, 0, 0.95);
  transform: translateX(-100%); transition: .25s; z-index: 50;
  border-right: 1px solid var(--line)
}
.sidebar.open { transform: none }

.sidebar__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px; border-bottom: 1px solid var(--line)
}

.sidebar__nav {
  padding: 8px;
  height: calc(90% - 140px);
  overflow: auto;
  text-align: center;
  font-size: 13px; /* menor */
  opacity: .9; transition: .25s;
}

.sidebar__footer {
  padding: 10px;
  border-top: 1px solid var(--line);
  margin-bottom: 12px;
  text-align: center;
  font-size: 13px; /* menor */
  opacity: .9; transition: .25s;
}

.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 40
}
.overlay.show { opacity: 1; pointer-events: auto }

.group {
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 10px; overflow: hidden
}
.group h5 { margin: 0; padding: 8px 10px; background: rgba(255, 255, 255, .04); font-size: 13px }
.item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px; border-top: 1px dashed var(--line); cursor: pointer; font-size: 13px
}
.item:hover { background: rgba(255, 255, 255, .05) }

.context {
  margin: 10px 12px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(255, 255, 255, .05); font-size: 13px
}
.context.hidden { display: none }

/* Pills bar - mais compacta */
.pills {
  position: sticky; top: 58px; z-index: 10;
  padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 16, 24, .9);
  backdrop-filter: blur(8px)
}
.pills.hidden { display: none }

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 9px;            /* menor */
  font-weight: 400;
  font-size: 12px;             /* menor */
  cursor: pointer
}
.pill.active {
  background: linear-gradient(90deg, rgba(255, 63, 178, .25), rgba(33, 212, 253, .25))
}
.pill-input {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 10px;
}

/* chat */
.chat {
  padding: 10px 12px;
  height: calc(100vh - 58px - 62px);
  overflow: auto
}
.hero { display: grid; place-items: center; min-height: 48vh; text-align: center }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center }

.bubble {
  max-width: 900px;
  margin: 10px auto;
  padding: 10px 12px;           /* menor */
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  font-size: .92rem;            /* menor */
  line-height: 1.35;            /* mais juntinho */
}
.bubble.user { background: rgba(255, 255, 255, .02) }

/* composer */
.composer {
  position: sticky; bottom: 0;
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(1, 1, 2, 0.9);
  backdrop-filter: blur(8px)
}
.composer__input {
  flex: 1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;           /* menor */
  color: var(--text);
  outline: none;
  font-size: .95rem;            /* menor */
}
.send {
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  color: #000; border: none; border-radius: 12px;
  padding: 0 12px;              /* menor */
  font-weight: 800
}

/* botões genéricos */
.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  border-radius: 12px;
  padding: 7px 10px;            /* menor */
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;              /* menor */
}
.btn.outline { background: transparent }
.wfull { width: 100% }

/* modal/cartão */
.modal { border: none; padding: 0; background: transparent }
.card {
  width: min(auto, 600px);
  max-height: auto;
  overflow: auto;
  background: rgba(0, 0, 0, 0.98);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #ffffff;
}
.card__header,
.card__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px; border-bottom: 1px solid var(--line); font-size: 13px
}
.card__footer { border-top: 1px solid var(--line); border-bottom: none }

/* grids e inputs */
.grid { display: grid; grid-template-columns: auto; column-gap: 12px; padding: 12px }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 10px }
.box h4 { margin: 0 0 8px 0; font-size: 14px }
.box label { display: grid; gap: 6px; margin: 6px 0; font-size: 13px }
.box input, .box select {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px; border-radius: 10px; font-size: 13px
}

.hint { opacity: .7; font-size: 12.5px }

/* editor/preview */
.editor {
  border: 1px solid var(--line);
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0f15
}
.preview {
  width: 100%;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff
}


#histList { list-style: none; padding: 0; margin: 10px 0 }
#histList li {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px dashed var(--line);
  padding: 8px 10px; border-radius: 12px; margin-bottom: 8px;
  background: rgba(255, 255, 255, .03); font-size: 13px
}