.tip { position: relative; }
.tip .tip-tip {
  position: absolute;
  display: none;
}
.tip:hover .tip-tip { display: block; }
.fit { display: inline-block; }
.grid { display: grid; }
.flex { display: flex; }
.pool { display: grid; }
.insert { outline: 0; }
.dropdown {
  cursor: pointer;
  outline: 0;
}
.handle {
  cursor: pointer;
  outline: 0;
}
.full-height { height: 100%; }
.absolute { position: absolute; }
.grafou-gallery-footer {
  display: none;
}
#grafou-gallery {
  position: absolute;
}
.grafou-img-button {
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
}
.grafou-label-container {
  display: grid;
  grid-template-columns: auto min-content;
  width: calc(100% - 12px);
  margin: 0 0 0 5px;
}
.grafou-img-label {
  border: 0;
  text-align: center;
  display: block;
  padding: 4px 0;
}
.grafou-img-label:hover {
  background: #ffffff87;
}
.grafou-gallery-container {
  background: #00000045;
  border: 1px solid gray;
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  display: grid;
  grid-template-rows: auto min-content;
  font-family: sans-serif;
}
.grafou-gallery-inner {
  max-height: 80svh;
  overflow: auto;
}
.grafou-gallery-images-api, .grafou-gallery-images-www {
  display: grid;
  grid-gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  padding: 20px;
}
.grafou-img {
  max-width: 200px;
  padding: 5px;
  cursor: pointer;
  display: block;
}
.grafou-gallery-image-edit:hover, .grafou-gallery-container .selected-grafou-img {
  border: 1px solid red;
}
.grafou-gallery-header {
  position: sticky;
  top: 0;
  background: lightgray;
  box-shadow: -1px 0px 3px black;
  padding: 4px 0;
}
.grafou-gallery-footer {
  background: black;
  padding: 4px 0;
  border-top: 1px solid gray;
  text-align: end;
}
.select-grafou-images {
  font-size: 20px;
  margin-right: 20px;
  background: transparent;
  color: green;
  border: 0;
  padding: 0;
  padding-top: 3px;
}
.select-grafou-images:hover {
  color: #116611;
}
#alert {
  color: black;
  font-size: 16px;
  bottom: 20px;
  position: absolute;
  left: 20px;
  padding: 10px;
  z-index: 10001 !important;
  display: none;
  background: white;
  border: 1px solid gray;
  height: min-content !important;
}
#alert.alert-error {
  color: white;
  background: #b10c0c;
  border: 1px solid darkred;
}
#alert.alert-success {
  color: white;
  background: green;
  border: 1px solid darkgreen;
}
#alert.alert-active { display: block; }
.hide-handle .togglerarrow-icons { padding: 0; }
.preview-wrapper-handles {
  display: grid;
  grid-template-columns: min-content 1fr min-content;
  white-space: nowrap;
}
.selected-element-title {
  background: lightgray;
  display: flex;
  white-space: break-spaces;
  font-size: 10px;
  margin-right: 5px;
  height: 27px;
  overflow-y: auto;
  overflow-x: hidden;
}
.preview-selected-element {
  display: grid;
  grid-template-columns: 1fr min-content;
}
.grafou-redo-view .bi {
  transform: rotate(180deg);
  display: block;
}
.data-handle {
  display: none !important;
}
.full-width { width: 100% !important; }
.ai-handle button { color: orange; }
.dashboard-wrappers {
  height: 100%;
  display: grid;
  grid-template-rows: auto min-content min-content;
}
.dashboard-wrappers .dashboard-handle {
  background: transparent;
  color: white;
  border: 1px solid gray;
  margin: 0;
}
.dashboard-wrappers .dashboard-handle:hover,
.dashboard-wrappers .active-dashboard-handle { background: #5d5d5d; }
.dashboard-wrappers .dashboard-wrapper { width: 100%; }
.preview-frame {
  background: white;
  width: 100%;
  height: 100%;
  transform-origin: top left;
}
.dashboard-wrapper {
  display: grid;
  height: 100%;
}
.dashboard-container {
  overflow: auto;
}
.preview-container {
  max-width: 100vw;
  display: grid;
  grid-template-rows: 1fr min-content min-content;
}
.preview-container-inner {
  overflow: auto;
  padding: 15px 5px;
}
.preview-wrapper {
  margin: 0 auto;
  height: 100%;
  background: white;
  color: black;
  overflow: hidden;
}
.rules-grid-normal {
  grid-template-rows: 1fr !important;
}
.rules-grid-devtools .preview-container {
  grid-area: a;
}
.rules-grid-devtools .rules-grid-item {
  grid-area: b;
}
.rules-grid-devtools .code-container {
  grid-area: c;
}
.rules-grid-devtools .dashboard-container {
  grid-area: d;
}
.rules-grid-devtools {
  grid-template-areas: "d a" "d b" "d c";
  grid-template-columns: 25% 1fr !important;
}
.dashboard-container-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.preview-wrapper-yr {
  display: grid;
  justify-content: center;
  padding: 20px;
}
.preview-handles-collapsed {
  padding: 0 !important;
  display: block;
  width: 100%;
}
.dashboard-handles-collapsed {
  padding: 0 !important;
  display: flex;
}
.modal {
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 81;
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.modal-content {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
}
.rules-grid {
  height: 100%;
  display: grid;
}
.rules-overlay {
  position: fixed;
  width: 100vw;
  height: 100svh;
  z-index: 999999;
}
.rules-grid-item {
  border: 2px solid gray;
  cursor: row-resize;
  position: relative;
  z-index: 1;
  top: 0 !important;
  left: 0 !important;
}
.rules-grid-item:hover {
  border: 6px solid gray;
}
/* ===== BASE ===== */
.words-code-container {
  display: grid;
  grid-template-rows: 1fr min-content;
  height: 100%;
  overflow: hidden;
}
.words-code {
  display: grid;
  grid-template-columns: min-content auto;
  background-color: #1f1f1f;
  height: 100%;
}
.line-numbers {
  text-align: end;
  overflow: hidden;
  padding: 10px;
  padding-top: 0;
  color: #617668;
  user-select: none;
  height: 150%;
}
.line-numbers, .words-code-insert, .highlight {
  font-size: 12px;
  line-height: 1.4;
  font-family: monospace;
}
.words-code-insert {
  white-space: pre;
  resize: none;
  height: 100%;
  margin: 0;
  outline: 0;
  border: 0;
  width: 100%;
  background-color: inherit;
  color: transparent;
  caret-color: gray;
  padding: 10px 0 10px 2px;
  border-left: 1px solid #3e3e3e;
}
.highlight-container {
  position: relative;
  overflow: hidden;
}
.highlight {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  white-space: pre;
  padding-left: 2px;
  border-left: 1px solid #3e3e3e;
  color: #9CDCFE;
  background-image: linear-gradient(to right, transparent calc(79ch + 3px), #ffb10038 calc(79ch + 3px), #ffb10038 calc(80ch + 2px), transparent calc(80ch + 2px));
  min-width: 85ch;
}
/* yr tokens */
.yr-comment { color: gray !important; }
.yr-trigger, .yr-section, .yr-macro { color: #e90; }
.yr-html-selector { color: #569CD6; }
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  background: transparent !important;
}
.words-code-insert {
  overflow: auto; /* 🔥 ESSENCIAL */
}
.words-code {
  height: 100%;
  max-height: 100%;
  overflow: hidden; /* 🔥 impede crescer infinito */
}
.highlight-container {
  position: relative;
  overflow: hidden; /* ok manter */
}
.words-code-handles {
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  font-size: 11px;
  background: #181818;
  color: #aaa;
  border-top: 1px solid #333;
  align-items: center;
  white-space: nowrap;
}
.words-code-info {
  display: flex;
  gap: 10px;
}
.words-code-search {
  margin-left: auto;
}
.search-words-code {
  background: #222;
  border: 1px solid #333;
  color: #ccc;
  padding: 2px 6px;
  width: 11ch;
  font-family: inherit;
}
.toggle-macros, .search-prev, .search-next, .search-clear {
  background: #222;
  border: 1px solid #333;
  color: #ccc;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 3px;
}
.toggle-macros {
  color: #aaa !important;
}
.toggle-macros.active {
  color: green !important;
}
.search-prev:disabled, .search-next:disabled, .search-clear:disabled {
  opacity: 0;
  cursor: default;
  display: none;
}
.search-count {
  font-size: 11px;
  color: #888;
  min-width: 50px;
  text-align: center;
}
.font-inc, .font-dec, .search-clear {
  background: #222;
  border: 1px solid #333;
  color: #ccc;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 3px;
}
.font-inc:hover, .font-dec:hover, .search-clear:hover {
  background: #2a2a2a;
}
/* cursor char highlight */
.cursor-char {
  background: #ffffff22;
  outline: 1px solid #ffffff33;
}
.highlight {
  /* existing styles... */
  overflow: scroll;        /* was: nothing / hidden */
  scrollbar-width: none;   /* hide the scrollbar */
}
.highlight::-webkit-scrollbar {
  display: none;
}
.iframe-console {
  font-family: monospace;
  font-size: 12px;
  background: #1e1e1e;
  color: #ddd;
  padding: 8px;
  overflow-y: auto;
}
.entry {
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid gray;
}
.time { color: #777; }
.level-log { color: #ccc; }
.level-warn { color: #e5c07b; }
.string { color: #98c379; }
.number { color: #d19a66; }
.boolean { color: #56b6c2; }
.null, .undefined { color: #c678dd; }
.function {
  color: #61afef;
  cursor: pointer;
}
.dom-node { color: #e5c07b; }
.object-key { color: #abb2bf; }
.level-error, .level-error .object-key { color: #e06c75; }
.collapsible { cursor: pointer; }
.children { margin-left: 15px; }
.stack-line {
  font-family: monospace;
  padding-left: 1em;
  white-space: pre;
}
.stack-line.clickable {
  cursor: pointer;
  color: #4ea1ff;
  text-decoration: underline;
}
.stack-line.clickable:hover {
  color: #1e90ff;
}
.entry > span { margin-right: 7px; }
.entry > span:first-child { margin-right: 0; }
.code-snippet {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 0.5em;
  margin: 0.25em 0;
  border-radius: 4px;
  overflow-x: auto;
  text-decoration: none !important;
}
.elements-tab {
  font-family: monospace;
  font-size: 12px;
  white-space: pre;
  line-height: 1.6;
  background: #111;
  color: #eee;
  overflow: auto;
  height: 100%;
  padding: 10px 0;
}
.node {
  cursor: pointer;
}
.collapsed > .el-children {
  display: none;
}
.entry-label {
  color: #8cf;
}
.entry-label:hover {
  background: gray;
}
.highlight-locked {
  background: blue;
  color: gray;
}
/* ===== Variáveis globais ===== */
:root {
  --chat-bg: #ffffff;
  --chat-bg-container: #f8fafc;
  --chat-border: #e2e8f0;
  --chat-border-light: #edf2f7;
  --chat-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  --chat-radius: 16px;
  --msg-user-bg: #dbeafe;
  --msg-assistant-bg: #f1f5f9;
  --msg-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  --msg-radius: 20px;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
}
/* Tema escuro (detecção automática) */
@media (prefers-color-scheme: dark) {
  :root {
    --chat-bg: #1e293b;
    --chat-bg-container: #0f172a;
    --chat-border: #334155;
    --chat-border-light: #1e293b;
    --chat-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --msg-user-bg: #1e3a5f;
    --msg-assistant-bg: #1e293b;
    --msg-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-light: rgba(129, 140, 248, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
  }
}
/* Container principal */
.chat-container {
  font-family: var(--font-sans);
  background: linear-gradient(145deg, var(--chat-bg-container), var(--chat-bg));
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--chat-border);
  transition: all 0.3s ease;
  color: var(--text-primary);
  position: relative;
}
/* Input container */
.input-container {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}
/* Botões de ação */
.button-container {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
}
/* Histórico */
.chat-history {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 24px;
  background-color: var(--chat-bg);
  border-bottom: 1px solid var(--chat-border-light);
  height: 100%;
  transition: background-color 0.3s ease;
  scroll-behavior: smooth;
}
/* Crédito */
.chat-credit {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* Mensagens */
.chat-user,
.chat-assistant {
  max-width: 80%;
  padding: 12px 18px;
  margin-bottom: 14px;
  border-radius: var(--msg-radius);
  line-height: 1.6;
  word-wrap: break-word;
  position: relative;
  box-shadow: var(--msg-shadow);
  font-size: 15px;
  animation: messageSlideIn 0.35s ease forwards;
  opacity: 0;
  transform: translateY(12px);
}
@keyframes messageSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-user {
  background-color: var(--msg-user-bg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}
.chat-assistant {
  background-color: var(--msg-assistant-bg);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}
/* Rótulo do papel da mensagem */
.message-role {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
/* Botão copiar */
.copy-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--chat-border-light);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s;
  backdrop-filter: blur(4px);
}
.chat-msg:hover .copy-btn {
  opacity: 0.8;
}
.copy-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.95);
}
/* Indicador de digitação */
.typing-indicator {
  font-style: italic;
  color: var(--text-muted);
  margin: 10px 24px;
  font-size: 14px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Pulsação (não usado diretamente, mas mantido para consistência) */
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.03); opacity: 0.8; }
  100% { transform: scale(1); opacity: 0.6; }
}
/* Bolinhas do "thinking" */
.dots::after {
  content: '...';
  animation: blink 1.2s steps(3, end) infinite;
}
@keyframes blink {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}
/* Formulário */
.chat-form {
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  background-color: var(--chat-bg);
  border-top: 1px solid var(--chat-border-light);
}
/* Campo de input */
.chat-user-input {
  flex: 1;
  padding: 12px 18px;
  font-size: 15px;
  border-radius: 24px;
  border: 1px solid var(--chat-border);
  outline: none;
  background-color: var(--chat-bg-container);
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
  resize: none;
  height: 44px;
  line-height: 1.5;
  color: var(--text-primary);
}
.chat-user-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}
.chat-user-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  background-color: var(--chat-bg);
}
/* Botões de ação (enviar, áudio, parar) */
.chat-user-submit,
.chat-audio-input,
.chat-audio-stop {
  padding: 10px 16px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  min-width: 44px;
  height: 44px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
.chat-user-submit:hover,
.chat-audio-input:hover,
.chat-audio-stop:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.chat-user-submit:focus,
.chat-audio-input:focus,
.chat-audio-stop:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-light);
}
.chat-user-submit:active,
.chat-audio-input:active,
.chat-audio-stop:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}
/* Toggle de tema (manter compatibilidade) */
#theme-toggle {
  position: absolute;
  top: 12px;
  right: 20px;
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 99;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
  transition: background 0.2s, box-shadow 0.2s;
}
#theme-toggle:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
/* Blocos de código */
.chat-container pre,
.chat-container code {
  background: #1e293b;
  color: #e2e8f0;
  font-family: var(--font-mono);
  padding: 12px 16px;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 13px;
  margin: 8px 0;
  border: 1px solid #334155;
}
.chat-container pre {
  counter-reset: line;
}
/* Aviso */
.chat-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 12px 0;
  padding: 8px 14px;
  background-color: var(--chat-bg-container);
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--chat-border);
}
/* Container de mensagem */
.chat-msg {
  display: flex;
  flex-direction: row;
  overflow: clip;
  position: relative;
}
.chat-msg p {
  margin: 0;
}
/* Ações de confirmação */
.confirm-actions {
  display: flex;
  gap: 8px;
  align-self: flex-start;
  margin-top: 6px;
}
.confirm-save,
.confirm-cancel {
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.confirm-save {
  background-color: var(--success);
}
.confirm-cancel {
  background-color: var(--danger);
}
.confirm-save:hover {
  background-color: #059669;
  transform: scale(1.03);
}
.confirm-cancel:hover {
  background-color: #dc2626;
  transform: scale(1.03);
}
/* Controles superiores */
.chat-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 24px;
  background-color: var(--chat-bg);
  border-bottom: 1px solid var(--chat-border-light);
}
.chat-clear-button,
.chat-settings-button {
  padding: 6px 12px;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
}
.chat-clear-button:hover,
.chat-settings-button:hover {
  background-color: var(--chat-bg-container);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.chat-clear-button:disabled,
.chat-settings-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
/* Placeholder central */
.chat-placeholder {
  font-size: 20px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  user-select: none;
  font-weight: 300;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  padding: 0;
  animation: fadeIn 0.4s ease;
  letter-spacing: 0.3px;
  pointer-events: none;
}
/* ===== Avatar das mensagens ===== */
.chat-msg {
  gap: 10px;
}
.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-top: 4px;
}
.chat-user .msg-avatar {
  order: 1;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}
.chat-assistant .msg-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
}
.msg-bubble {
  flex: 1;
}
/* ===== Timestamp ===== */
.message-timestamp {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.7;
  padding-right: 8px;
  text-align: right;
}
/* ===== Efeito ripple no botão ===== */
.chat-user-submit {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}
/* ===== Auto-resize textarea ===== */
.chat-user-input {
  overflow-y: hidden;
  min-height: 44px;
  max-height: 160px;
}
/* ===== Botão anexar ===== */
.chat-attach-input {
  padding: 10px 16px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  min-width: 44px;
  height: 44px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
.chat-attach-input:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.chat-attach-input:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-light);
}
.chat-attach-input:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}
/* ===== Preview de imagem ===== */
.image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--chat-bg-container);
  border-radius: 12px;
  border: 1px solid var(--chat-border);
  margin: 0 16px 8px;
}
.image-preview.hidden {
  display: none;
}
.preview-img {
  max-height: 60px;
  max-width: 120px;
  border-radius: 8px;
  object-fit: cover;
}
.remove-attachment {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.remove-attachment:hover {
  background: var(--chat-border-light);
  color: var(--danger);
}
.togglerarrow-icons { padding-right: 5px; }
.togglerexpand-icons { padding-right: 5px; }
/* ============ TOKENS ============ */
:root {
  --bg: #0a0c10;
  --panel: #12151b;
  --border: #232833;
  --text: #e4e6eb;
  --text-dim: #8b92a0;
  --accent: #f5a623;
  --accent-dim: #8a651f;
  --accent-2: #59d8c8;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tabbar-h: 52px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--tabbar-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
}
a {
  color: inherit;
}
::selection {
  background: var(--accent);
  color: #16130b;
}
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}
code {
  font-family: var(--font-mono);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  color: var(--accent-2);
}
/* ============ TABBAR ============ */
.tabbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--tabbar-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: rgba(10, 12, 16, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.tabbar__brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.tabbar__tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 100%;
  padding-top: 5px;
}
.tabbar__tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab:hover {
  color: var(--text);
}
.tab.is-active {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
  border-bottom-color: var(--panel);
}
.tab__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  flex: none;
}
/* ============ LAYOUT / SECTIONS ============ */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--tabbar-h) 24px 0;
}
.section {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--border);
}
.section:last-child {
  border-bottom: none;
}
.line-comment {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.line-comment::before {
  content: "// ";
  color: var(--accent-dim);
}
.section__title {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 28px;
  color: var(--text);
}
/* ============ HERO ============ */
.hero {
  padding-top: 72px;
}
.hero__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  margin: 0 0 24px;
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.15);
}
.hero__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero__title {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.hero__subtitle {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-2);
  min-height: 1.6em;
  margin: 0 0 24px;
}
.hero__desc {
  max-width: 520px;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0 0 36px;
}
.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: inline-block;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn--primary {
  background: var(--accent);
  color: #16130b;
  border-color: var(--accent);
  font-weight: 600;
}
.btn--primary:hover {
  background: #ffb949;
}
.btn--ghost {
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}
/* ============ SOBRE ============ */
.about p {
  color: var(--text-dim);
  font-size: 1.02rem;
  margin: 0 0 18px;
}
.about strong {
  color: var(--text);
}
.about a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.skill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
}
/* ============ PROJETOS ============ */
.projects {
  display: grid;
  gap: 20px;
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px 1fr;
  transition: border-color 0.15s ease;
}
.project-card:hover {
  border-color: var(--accent-dim);
}
.project-card__media {
  background: #0d1016;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-card__media--placeholder {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  padding: 12px;
}
.project-card__body {
  padding: 22px 24px;
}
.project-card__title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  margin: 0 0 8px;
  color: var(--text);
}
.project-card__desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.project-card__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-2);
  background: rgba(89, 216, 200, 0.08);
  border: 1px solid rgba(89, 216, 200, 0.25);
  padding: 3px 9px;
  border-radius: 999px;
}
.project-card__link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.project-card__link:hover {
  border-bottom-color: var(--accent);
}
@media (max-width: 640px) {
  .project-card {
    grid-template-columns: 1fr;
  }
  .project-card__media {
    min-height: 140px;
  }
}
/* ============ CONTATO ============ */
.contact__desc {
  color: var(--text-dim);
  font-size: 1.02rem;
  margin: 0 0 32px;
}
.contact__links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.contact__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--panel);
  text-decoration: none;
  transition: background 0.15s ease;
}
.contact__link:hover {
  background: #171b23;
}
.contact__label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.contact__value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-2);
}
/* ============ FOOTER ============ */
.footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
/* ============ YRKIT PREVIEW ============ */
.yrkit-preview {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.yrkit-preview .dashboard-wrappers {
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.yrkit-preview .dashboard-wrapper {
  flex: 1 1 auto;
  min-height: 0;
}
.yrkit-preview .preview-container,
.yrkit-preview .code-container {
  height: 100%;
}
/* Botões grafou-* escondidos, exceto grafou-download-view */
.yrkit-preview button[class*="grafou-"]:not([class~="grafou-download-view"]):not([class~="select-grafou-images"]) {
  display: none !important;
}
/* Esconde a barra de ações do dashboard */
.yrkit-preview .dashboard-handles {
  display: none !important;
}
/* ============ DOWNLOAD VIEW (botão flutuante) ============ */
.yrkit-preview .grafou-download-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 4px;
  z-index: 30;
  width: auto;
  height: auto;
  padding: 8px 14px;
  background: rgba(18, 21, 27, 0.85);
  border: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.yrkit-preview .grafou-download-view:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.yrkit-preview .grafou-download-view .bi {
  font-size: 1rem;
  line-height: 1;
}
.preview-container-inner {
  background: gray;
}
.tip-tip {
  display: none !important;
}
/* ============ SCROLLBAR DO EDITOR ============ */
.words-code-insert::-webkit-scrollbar {
  width: 10px;
}
.words-code-insert::-webkit-scrollbar-track {
  background: transparent;
}
.words-code-insert::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--panel);
}
.words-code-insert::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}
.undefined {
  /* ============ EDITOR DE CÓDIGO ============ */:  !important;
}
.words-code-insert {
  overflow-y: auto !important;
  overflow-x: auto !important;
  resize: none !important;
  scrollbar-width: thin !important;
  scrollbar-color: var(--border) transparent !important;
  /* ============ LINK DE DOCUMENTAÇÃO ============ */:  !important;
}
.yrkit-docs-link {
  display: inline-block !important;
  font-family: var(--font-mono) !important;
  font-size: 0.85rem !important;
  color: var(--accent-2) !important;
  text-decoration: none !important;
  border-bottom: 1px dashed rgba(89, 216, 200, 0.4) !important;
  padding-bottom: 2px !important;
  margin-bottom: 20px !important;
  transition: color 0.15s ease, border-color 0.15s ease !important;
}
.yrkit-docs-link:hover {
  color: var(--text) !important;
  border-bottom-color: var(--accent-2) !important;
}
.hidden {
  display: none !important;
  /*position: absolute !important;
  z-index: -9999 !important;
  top: -20404px !important;
  opacity: 0 !important;*/
}
