/* ===== parcerus — fale e rabisque ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Lato:wght@400;700&family=Montserrat:wght@400;500;600;700;800&family=Nunito:wght@400;600;700;800&family=Open+Sans:wght@400;600;700&family=Poppins:wght@400;500;600;700;800&family=Roboto:wght@400;500;700&display=swap");

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafaf8;
  --ink: #1e1e2e;
  --muted: #8a8a96;
  --card: #ffffff;
  --accent: #6c5ce7;
  --accent-soft: #efecff;
  --danger: #e64553;
  --ok: #40a02b;
  --shadow: 0 4px 24px rgba(30, 30, 46, 0.12);
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #1a1a22;
  --ink: #f0f0f5;
  --muted: #9a9aac;
  --card: #26262f;
  --accent: #8a7bff;
  --accent-soft: #322f55;
  --danger: #ff6b7a;
  --ok: #5fd44a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

/* ===== Modos de visão de cores (daltonismo) ===== */
html[data-vision="protanopia"] #board,
html[data-vision="protanopia"] #overlay,
html[data-vision="protanopia"] #topbar,
html[data-vision="protanopia"] #toolbar,
html[data-vision="protanopia"] .modal-card,
html[data-vision="protanopia"] .a11y-panel {
  filter: url(#filter-protanopia);
}
html[data-vision="deuteranopia"] #board,
html[data-vision="deuteranopia"] #overlay,
html[data-vision="deuteranopia"] #topbar,
html[data-vision="deuteranopia"] #toolbar,
html[data-vision="deuteranopia"] .modal-card,
html[data-vision="deuteranopia"] .a11y-panel {
  filter: url(#filter-deuteranopia);
}
html[data-vision="tritanopia"] #board,
html[data-vision="tritanopia"] #overlay,
html[data-vision="tritanopia"] #topbar,
html[data-vision="tritanopia"] #toolbar,
html[data-vision="tritanopia"] .modal-card,
html[data-vision="tritanopia"] .a11y-panel {
  filter: url(#filter-tritanopia);
}
.a11y-filters { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ===== Modo baixa visão ===== */
html.low-vision {
  font-size: 110%;
}
html.low-vision #topbar,
html.low-vision #toolbar,
html.low-vision .modal-card,
html.low-vision .a11y-panel {
  font-size: 1.15em;
}
html.low-vision #topbar button,
html.low-vision #toolbar button,
html.low-vision .a11y-panel button {
  outline: 1.5px solid var(--ink);
  outline-offset: -1px;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

/* ===== Quadro ===== */
#board {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100dvh;
  background:
    radial-gradient(circle, #e4e4e0 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#board.erasing { cursor: cell; }
#board.pan-ready { cursor: grab; }
#board.picking-element { cursor: grab; }
#board.panning { cursor: grabbing; }

/* ===== Overlay de sugestões ===== */
#overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

/* ===== Topbar ===== */
#topbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
  z-index: 100;
  max-width: calc(100vw - 24px);
}
#topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.5px; }
#topbar .spacer { width: 8px; }

.brand-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #5b6ee1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex: none;
  overflow: hidden;
  cursor: pointer;
}
.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Acessibilidade (tema/visão) ===== */
.a11y-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: none;
}
.a11y-btn:hover { background: var(--accent-soft); color: var(--accent); }
.a11y-btn svg { width: 18px; height: 18px; }
.a11y-btn.active { background: var(--accent-soft); color: var(--accent); }

.a11y-panel {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 200;
  min-width: 280px;
}
.a11y-panel.hidden { display: none; }
.a11y-section { display: flex; flex-direction: column; gap: 6px; }
.a11y-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.a11y-options { display: flex; gap: 6px; flex-wrap: wrap; }
.a11y-options button {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.a11y-options button:hover { background: var(--accent-soft); color: var(--accent); }
.a11y-options button.active { background: var(--accent); color: #fff; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
}

.play {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s, transform 0.1s;
}
.play:hover { transform: scale(1.03); }
.play.running {
  background: var(--danger);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 69, 83, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(230, 69, 83, 0); }
}

.ai-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ai-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #c5c5cc; transition: background 0.3s; }
.ai-status.ready .dot { background: var(--ok); }
.ai-status.thinking .dot { background: var(--accent); animation: blink 0.8s infinite; }
.ai-status.error .dot { background: var(--danger); }
@keyframes blink { 50% { opacity: 0.25; } }

.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); cursor: pointer; }

/* Oculta MODO IA, status "IA pronta" e o toggle "Sugestões IA" da barra
   superior. O restante (espaçador, ações do topo) permanece como esta. */
#topbar #playBtn,
#topbar #aiStatus,
#topbar .toggle:has(#aiToggle) {
  display: none;
}

.ghost { font-size: 18px; opacity: 0.75; transition: opacity 0.2s; padding: 4px; }
.ghost:hover { opacity: 1; }

/* ===== Toolbar lateral ===== */
#toolbar {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 8px;
  box-shadow: var(--shadow);
  z-index: 100;
}
#toolbar .sep { width: 26px; height: 1px; background: #ececec; margin: 3px 0; }

.tool {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.tool:hover { background: #f1f1f4; }
.tool.active { background: var(--accent); }
#recordBtn.recording { background: var(--danger); color: #fff; animation: blink 0.8s infinite; }

.colors { display: flex; flex-direction: column; gap: 6px; }
.color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  transition: transform 0.15s;
}
.color:hover { transform: scale(1.15); }
.color.active { border-color: #fff; outline: 2px solid var(--c); }

.widths { display: flex; flex-direction: column; gap: 4px; }
.width {
  width: 38px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.width span { display: block; width: 20px; height: var(--s); border-radius: 99px; background: var(--ink); }
.width:hover { background: #f1f1f4; }
.width.active { background: #e9e6fb; }

/* ===== Legenda ao vivo ===== */
#caption {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(30, 30, 46, 0.85);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  max-width: min(720px, 90vw);
  white-space: nowrap;
  overflow: hidden;
  z-index: 90;
  backdrop-filter: blur(6px);
}
#caption .rec-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  animation: blink 1.1s infinite;
}
#captionText { overflow: hidden; text-overflow: ellipsis; }
#captionText .interim { opacity: 0.55; font-style: italic; }

#hint {
  position: fixed;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px;
  color: var(--muted);
  z-index: 89;
}

.hidden { display: none !important; }

/* ===== Chips de sugestão ===== */
.chip {
  position: fixed;
  left: 16px;
  top: 96px;
  pointer-events: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: chipIn 0.25s ease-out;
  width: min(320px, calc(100vw - 40px));
  max-width: 320px;
  z-index: 160;
}
@keyframes chipIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.chip.fading { opacity: 0; transition: opacity 0.9s; }
.chip .chip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 4px;
}
.chip .chip-close { font-size: 13px; color: var(--muted); padding: 0 3px; }
.chip .chip-close:hover { color: var(--ink); }
.chip-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 9px;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.35;
}
.chip-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}
.chip-actions .primary { padding: 8px 12px; }
.chip-actions .ghost { font-size: 13px; color: var(--accent); font-weight: 700; }
.loader {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid #d8d5ef;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.chip-error .chip-head { color: var(--danger); }
.chip-empty .chip-head { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.sug {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: 10px;
  font-size: 13.5px;
  text-align: left;
  transition: background 0.15s;
  width: 100%;
}
.sug:hover { background: var(--accent); color: #fff; }
.sug .glyph { font-size: 22px; line-height: 1; flex: none; width: 26px; text-align: center; }
.sug .key {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid #e2e2e8;
  border-radius: 4px;
  padding: 1px 5px;
}
.sug:hover .key { color: #fff; border-color: rgba(255,255,255,0.5); }

/* ===== Toasts ===== */
#toasts {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  align-items: center;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: chipIn 0.25s ease-out;
  max-width: min(560px, 90vw);
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ===== Modais ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 46, 0.45);
  display: grid;
  place-items: center;
  z-index: 300;
  backdrop-filter: blur(3px);
}
/* Modo "selecionar elemento no quadro": o backdrop deixa de bloquear
   cliques e o cartão do modal fica escondido ate o usuario escolher
   um elemento do canvas. */
.modal.picking {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
.modal.picking .modal-card {
  display: none;
}

.modal-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
  width: min(480px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drag-handle {
  cursor: grab;
  user-select: none;
}
.dragging,
.dragging .modal-card {
  cursor: grabbing;
}
.dragging .modal-card,
.anim-timeline.dragging {
  box-shadow: 0 22px 64px rgba(31, 34, 48, 0.24);
}
.modal-card h2 { font-size: 21px; letter-spacing: -0.5px; }
.modal-card p, .modal-card ol { font-size: 14px; line-height: 1.55; }
.modal-card ol { padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.muted { color: var(--muted); }
.modal-card a { color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field input {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 13px;
  border: 1.5px solid #e2e2e8;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-color: var(--accent); }

.modal-actions { display: flex; align-items: center; gap: 10px; }
.modal-actions .spacer { flex: 1; }
.primary {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.1s;
}
.primary:hover { transform: scale(1.04); }
.modal-actions .ghost { font-size: 13.5px; color: var(--accent); font-weight: 600; }
.ask-card { width: min(560px, calc(100vw - 28px)); }
.ask-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ask-row input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 1.5px solid #e2e2e8;
  border-radius: 10px;
  outline: none;
}
.ask-row input:focus { border-color: var(--accent); }
.ask-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.ask-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 10px;
  background: #f7f7fb;
  text-align: left;
}
.ask-option:hover { background: var(--accent); color: #fff; }
.ask-option .glyph { width: 28px; text-align: center; font-size: 24px; flex: none; }
.ask-result { min-height: 20px; font-size: 13px; }

/* Painel flutuante de insercao/edicao */
#askModal {
  inset: auto;
  left: calc(50vw - 190px);
  top: 110px;
  display: block;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  z-index: 260;
}
#askModal.hidden { display: none !important; }
#askModal .ask-card {
  pointer-events: auto;
  width: min(380px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 14px;
  gap: 10px;
}
#askModal .ask-card.expanded { width: min(560px, calc(100vw - 24px)); }
#askDragHandle {
  cursor: grab;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
}
#askModal.dragging #askDragHandle { cursor: grabbing; }
#askModal .modal-actions { margin-top: 2px; }
#askModal:not(.expanded) .modal-actions,
#askModal:not(.expanded) #askResult:empty { display: none; }
#askModal .ask-row input { padding: 9px 10px; font-size: 14px; }
#askModal .primary { padding: 9px 16px; }
#askModal .ghost { border-radius: 9px; padding: 7px 8px; }
#askOptions {
  overflow: hidden;
  border: 1px solid #ececf2;
  border-radius: 12px;
  gap: 0;
  background: #fff;
}
#askOptions:empty { display: none; }
.ask-option {
  position: relative;
  min-height: 74px;
  border-radius: 0;
  border-right: 1px solid #ececf2;
  border-bottom: 1px solid #ececf2;
  background: #fff;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: 1fr auto;
}
.ask-option:hover { background: #fbfbff; color: var(--ink); }
.ask-option .label { align-self: center; font-weight: 600; font-size: 13px; }
.ask-option .actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.ask-option .actions button {
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2f1fb;
  color: var(--accent);
  font-weight: 800;
}
.ask-option .actions button.ok { background: var(--accent); color: #fff; }
.ask-option .actions button svg {
  width: 15px;
  height: 15px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ask-option .actions button.loading svg {
  animation: ask-spin 0.8s linear infinite;
}
@keyframes ask-spin {
  to { transform: rotate(360deg); }
}

.object-actions {
  position: fixed;
  display: flex;
  gap: 6px;
  z-index: 240;
  pointer-events: auto;
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 5px;
  transform: translate(-50%, -100%);
  box-shadow: var(--shadow);
}
.object-actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.object-actions button:hover { background: var(--accent-soft); color: var(--accent); }
.object-actions button.active { background: #ecebff; color: #5f4ee8; }

.shape-popover {
  position: fixed;
  left: 64px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: repeat(2, 42px);
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 180;
}
body.toolbar-bottom .shape-popover {
  left: 50%;
  top: auto;
  bottom: 78px;
  transform: translateX(-50%);
  grid-template-columns: repeat(6, 42px);
}
.shape-popover button {
  height: 38px;
  border-radius: 10px;
  background: #f7f7fb;
  font-size: 18px;
}
.shape-popover button:hover { background: var(--accent-soft); color: var(--accent); }

.context-menu {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 300;
  min-width: 200px;
}
.context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
  width: 100%;
}
.context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.context-menu-glyph {
  display: grid;
  place-items: center;
  width: 22px;
  font-size: 16px;
  flex: none;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  #topbar { gap: 8px; padding: 6px 10px; }
  #topbar .name, .toggle span, .ai-status .txt { display: none; }
  #toolbar { left: 8px; }
}

/* ===== Bloqueio de telas pequenas (sem versao mobile ainda) ===== */
.mobile-block {
  display: none;
}
@media (max-width: 1024px) {
  .mobile-block {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg, #f7f7f5);
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
  }
  .mobile-block-card {
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    border-radius: 16px;
    background: var(--card, #fff);
    box-shadow: var(--shadow, 0 20px 58px rgba(31,34,48,0.18));
  }
  .mobile-block-card strong {
    font-size: 17px;
    color: var(--ink, #202230);
  }
  .mobile-block-card p {
    margin: 0;
    font-size: 14px;
    color: var(--muted, #858795);
  }
}

/* ===== Acabamento Miro-like ===== */
:root {
  --bg: #f7f7f5;
  --ink: #202230;
  --muted: #858795;
  --card: #ffffff;
  --line: #e8e9ee;
  --accent: #6f5be8;
  --accent-strong: #5c49d8;
  --accent-soft: #f0edff;
  --shadow: 0 10px 30px rgba(23, 24, 38, 0.13), 0 1px 3px rgba(23, 24, 38, 0.1);
  --shadow-soft: 0 4px 16px rgba(23, 24, 38, 0.12);
}

#board {
  background:
    linear-gradient(#eeeeeb 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, #eeeeeb 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(#f6f6f4 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(90deg, #f6f6f4 1px, transparent 1px) 0 0 / 8px 8px,
    var(--bg);
}

#topbar {
  top: 16px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(232,233,238,0.9);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

#topbar .name { font-weight: 800; letter-spacing: -0.2px; }

.play .icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.play .icon {
  display: grid;
  place-items: center;
}

.play,
.primary {
  background: var(--accent);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset;
}

.play:hover,
.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

#toolbar {
  left: 12px;
  top: 50%;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(221,224,232,0.95);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

#toolbar .sep {
  width: 30px;
  margin: 5px 0;
  background: var(--line);
}

.tool,
.width {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  color: #242633;
}

.tool svg,
.object-actions svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool:hover,
.width:hover,
.shape-popover button:hover {
  background: #f3f4f8;
}

.tool.active {
  background: #eef0ff;
  color: #4861e8;
  box-shadow: inset 0 0 0 1px #dce0ff;
}

.colors,
.widths { gap: 5px; }

.color {
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d9dbe4;
}

.color.active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.modal {
  background: rgba(22, 24, 35, 0.36);
}

.modal-card {
  border-radius: 16px;
  border: 1px solid rgba(232,233,238,0.95);
  box-shadow: var(--shadow);
}

#askModal .ask-card {
  width: min(410px, calc(100vw - 24px));
  padding: 14px 14px 12px;
  border-radius: 13px;
  gap: 10px;
  max-height: calc(100dvh - 88px);
  overflow: hidden;
}

#askModal.expanded .ask-card,
#askModal .ask-card.expanded {
  width: min(560px, calc(100vw - 24px));
  overflow-y: auto;
  scrollbar-width: thin;
}

#askDragHandle {
  font-size: 14px;
  letter-spacing: 0.6px;
  color: #8b8d9c;
}

.ask-row {
  gap: 10px;
}

.ask-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 2px;
}

.ask-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.ask-toggle input {
  accent-color: var(--accent);
  cursor: pointer;
}

#askModal .ask-row input,
.field input {
  border: 1px solid #dfe2ea;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(23,24,38,0.04) inset;
}

#askModal .ask-row input:focus,
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111,91,232,0.12);
}

#askModal .primary {
  height: 38px;
  padding: 0 20px;
  border-radius: 10px;
}

.icon-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #8d90a0;
  font-size: 22px;
  line-height: 1;
  position: sticky;
  top: 0;
  right: 0;
  z-index: 5;
  background: var(--card);
  flex-shrink: 0;
  margin-left: auto;
}

.icon-close:hover {
  background: #f3f4f8;
  color: #202230;
}

#askModal .ghost {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

#askOptions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #e4e6ee;
  border-radius: 10px;
  max-height: 354px;
  overflow: auto;
}

.ask-option {
  min-height: 88px;
  padding: 12px;
  border-color: #e4e6ee;
  transition: background 0.15s, box-shadow 0.15s;
}

.ask-option:hover {
  background: #fbfbff;
  box-shadow: inset 0 0 0 1px #dfe1ff;
}

.ask-option .glyph {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ask-option .glyph img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ask-option.image .glyph {
  grid-column: 1 / -1;
  width: 100%;
  height: 76px;
  border-radius: 9px;
  background: #f4f5f8;
}

.ask-option.image {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
}

.ask-option.image .glyph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#askOptions.images-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: none;
  background: transparent;
  max-height: 420px;
  padding: 2px;
}

#askOptions.images-grid .ask-option {
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 9px;
  overflow: hidden;
  background: #f4f5f8;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  aspect-ratio: 1 / 1;
}

#askOptions.images-grid .ask-option .glyph {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #f4f5f8;
}

#askOptions.images-grid .ask-option .glyph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#askOptions.images-grid .ask-option .label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#askOptions.images-grid .ask-option .actions {
  position: absolute;
  top: 4px;
  right: 4px;
  grid-column: auto;
  justify-content: flex-end;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

#askOptions.images-grid .ask-option:hover .actions {
  opacity: 1;
}

#askOptions.images-grid .ask-option .actions {
  display: flex;
  align-items: center;
}

#askOptions.images-grid .ask-option .actions button {
  width: 26px;
  height: 24px;
  min-width: 26px;
  min-height: 24px;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#askOptions.images-grid .ask-option .actions button.ok {
  background: var(--accent);
  color: #fff;
}

#askOptions.images-grid .ask-option .actions button svg {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#askOptions.images-grid .ask-option:hover {
  box-shadow: 0 0 0 2px var(--accent);
}

.ask-option .label {
  font-size: 13px;
  line-height: 1.25;
}

.ask-option .actions button {
  width: 30px;
  height: 28px;
  border-radius: 8px;
  background: #f1efff;
}

.ask-option .actions button.loading {
  opacity: 0.55;
  cursor: wait;
}

.object-actions {
  gap: 4px;
  border: 1px solid #e4e6ee;
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-soft);
}

.object-actions button {
  border-radius: 7px;
}

.shape-popover {
  border: 1px solid #e4e6ee;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.connector-actions {
  border-radius: 10px;
}

.connector-actions button {
  font-weight: 800;
}

.text-card {
  width: min(520px, calc(100vw - 28px));
  padding: 18px;
  gap: 12px;
}

.prompt-card {
  width: min(380px, calc(100vw - 28px));
  padding: 20px;
  gap: 12px;
}

.prompt-card input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 13px;
  border: 1.5px solid #e2e2e8;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

.prompt-card input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111,91,232,0.12);
}

.tour-media-card {
  width: min(460px, calc(100vw - 28px));
  max-height: min(640px, calc(100dvh - 60px));
  overflow: auto;
  padding: 20px;
  gap: 10px;
}
.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 4px;
}
.tour-media-card input[type="text"],
.tour-media-card textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 13px;
  border: 1.5px solid #e2e2e8;
  border-radius: 10px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.tour-media-card input[type="text"]:focus,
.tour-media-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111,91,232,0.12);
}
.tour-media-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tour-media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e4e6ee;
  border-radius: 10px;
  background: #fafafe;
}
.tour-media-item .tour-media-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #efedff;
  color: var(--accent);
  flex-shrink: 0;
}
.tour-media-item .tour-media-name {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tour-media-item .tour-media-mode {
  display: flex;
  border: 1px solid #e2e2e8;
  border-radius: 8px;
  overflow: hidden;
  font-size: 11px;
}
.tour-media-item .tour-media-mode button {
  padding: 5px 8px;
  background: #fff;
  color: var(--muted);
}
.tour-media-item .tour-media-mode button.active {
  background: var(--accent);
  color: #fff;
}
.tour-media-item .tour-media-remove {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #d23b3b;
  flex-shrink: 0;
}
.tour-media-item .tour-media-remove:hover { background: #ffe9e9; }
.tour-media-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tour-media-add-row button { font-size: 12px; padding: 8px 10px; }
.danger-text { color: #d23b3b; }

/* ----- Tour: reprodução ----- */
.tour-here-label {
  position: fixed;
  z-index: 320;
  transform: translate(-50%, -100%);
  background: #5b6cff;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(91,108,255,0.35);
  white-space: nowrap;
  pointer-events: none;
}
.tour-here-label::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
.tour-card-media {
  position: fixed;
  z-index: 310;
  width: min(320px, calc(100vw - 32px));
  border-radius: 14px;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 20px 50px rgba(31,34,48,0.25);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.tour-card-media img,
.tour-card-media video {
  width: 100%;
  display: block;
}
.tour-card-media .tour-card-body {
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.tour-card-media .tour-card-text {
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  min-height: 24px;
}
.tour-card-media audio { width: 100%; padding: 10px 14px; }
.tour-lightbox-inner {
  position: relative;
  width: min(900px, calc(100vw - 40px));
  max-height: min(85vh, 800px);
  margin: auto;
  background: #111;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tour-lightbox-inner img,
.tour-lightbox-inner video {
  max-width: 100%;
  max-height: 85vh;
  display: block;
}
.tour-lightbox-inner .icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  z-index: 2;
}
.tour-lightbox-inner .tour-lightbox-text {
  padding: 30px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  max-width: 700px;
}
.tour-progress {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 320;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}
.tour-progress-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
}
.tour-progress-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tour-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d8d8e6;
  transition: background 0.2s, transform 0.2s;
}
.tour-progress-dot.active {
  background: var(--accent);
  transform: scale(1.25);
}
.tour-progress button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
}
.tour-stop-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: #e0303f;
  color: #fff;
  border: none;
}
.tour-stop-btn:hover {
  background: #c5232f;
}
.tour-restart-btn {
  background: var(--accent);
}
.tour-restart-btn:hover {
  background: var(--accent);
  opacity: 0.85;
}

.separate-images-btn {
  position: fixed;
  transform: translateX(-50%);
  z-index: 240;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.separate-images-btn:hover { transform: translateX(-50%) scale(1.04); }
.separate-images-btn.hidden { display: none; }

.tour-action-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 320;
}
.tour-action-bar .tour-stop-btn {
  font-size: 13px;
  padding: 9px 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
body.toolbar-bottom .tour-action-bar {
  bottom: 84px;
}

.tour-point-actions {
  position: fixed;
  transform: translate(-50%, -100%);
  z-index: 330;
  display: flex;
  gap: 6px;
}
.tour-point-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #5b6cff;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(91, 108, 255, 0.45);
  cursor: pointer;
}
.tour-point-action-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tour-point-action-btn:hover {
  background: #4856e0;
}
.tour-point-action-btn.tour-point-action-danger {
  background: #e0303f;
}
.tour-point-action-btn.tour-point-action-danger:hover {
  background: #c5232f;
}

.image-edit-panel {
  position: fixed;
  z-index: 260;
  pointer-events: auto;
}

.image-edit-card {
  width: min(310px, calc(100vw - 28px));
  padding: 18px;
  gap: 10px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.image-edit-card h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ink);
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ececf3;
}

.img-edit-row {
  display: grid;
  grid-template-columns: 84px 1fr 48px;
  align-items: center;
  gap: 10px;
}

.img-edit-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.img-edit-val {
  font-size: 12px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.img-edit-row input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: #e6e7f0;
  outline: none;
  cursor: pointer;
}

.img-edit-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
}

.img-edit-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
}

.img-edit-toggles {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.toggle-btn {
  border: 1px solid #dfe2ea;
  border-radius: 9px;
  padding: 8px;
  font-size: 12.5px !important;
  font-weight: 700;
  text-align: center;
  background: #fafafe;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.toggle-btn:hover {
  border-color: var(--accent);
}

.toggle-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

#connColorBtn .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch-color, #5267f0);
  border: 1px solid rgba(0,0,0,0.12);
  display: block;
}

#stickyColorBtn .swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--swatch-color, #fff58a);
  border: 1px solid rgba(0,0,0,0.12);
  display: block;
}

#strokeColorBtn .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch-color, #1e1e2e);
  border: 1px solid rgba(0,0,0,0.12);
  display: block;
}
/* Botões com glifo (espessura/estilo da linha) precisam sobrescrever o
   font-size:0 aplicado aos botões da barra de objetos. */
#strokeWidthBtn, #strokeStyleBtn {
  font-size: 16px !important;
}

.text-card textarea {
  min-height: 130px;
  resize: vertical;
  border: 1px solid #dfe2ea;
  border-radius: 10px;
  padding: 12px;
  font: 16px "Segoe UI", system-ui, sans-serif;
  outline: none;
}

.text-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111,91,232,0.12);
}

.text-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e4e6ee;
  border-radius: 10px;
  background: #fbfbfd;
}

.text-tools select,
.text-tools input[type="number"] {
  height: 34px;
  border: 1px solid #dfe2ea;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}

.text-tools input[type="number"] {
  width: 72px;
}

.text-tools button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-weight: 800;
}

.text-tools button.active {
  background: var(--accent);
  color: #fff;
}

.text-tools input[type="color"] {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
}

.text-align-group {
  display: flex;
  gap: 4px;
  margin-left: auto;
  border: 1px solid #dfe2ea;
  border-radius: 10px;
  padding: 3px;
  background: #fff;
}

.text-align-group button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #202331;
  font-size: 0;
}

.text-align-group button:hover {
  background: #f4f5fb;
}

.text-align-group button.active {
  color: #5f4ee8;
  background: #ecebff;
}

.text-align-group button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 1px solid #eceef4;
  padding-left: 8px;
}

.top-actions button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #242633;
}

.top-actions button.text-action {
  width: auto;
  height: 34px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
}

.top-actions button:hover {
  background: #f2f3f7;
}

.top-actions button.recording {
  background: var(--danger);
  color: #fff;
  animation: blink 0.8s infinite;
}

.top-actions button.recording:hover {
  background: var(--danger);
}

.top-actions button.has-badge {
  position: relative;
}
.top-actions .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
.top-actions .badge.hidden {
  display: none;
}

.top-actions svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#askModal .ask-card {
  padding: 14px;
}

#askOptions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 242px;
}

.ask-option {
  min-height: 70px;
  padding: 9px 10px;
  grid-template-columns: 30px 1fr;
}

.ask-option .actions button {
  width: 27px;
  height: 25px;
}

.workspace-card {
  width: min(920px, calc(100vw - 36px));
  max-height: min(720px, calc(100dvh - 36px));
  overflow: auto;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.workspace-tile {
  border: 1px solid #e4e6ee;
  border-radius: 12px;
  background: #fff;
  min-height: 168px;
  padding: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.workspace-tile:hover {
  box-shadow: var(--shadow-soft);
}

.workspace-thumb {
  height: 92px;
  border-radius: 9px;
  background:
    linear-gradient(#eeeeeb 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(90deg, #eeeeeb 1px, transparent 1px) 0 0 / 18px 18px,
    #fafaf8;
  overflow: hidden;
}

.workspace-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspace-new {
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--accent);
  border-style: dashed;
}

.workspace-new span {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  font-size: 34px;
}

.empty-thumb {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
}

.workspace-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.workspace-actions button {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

/* Hotfix: toolbar icons must stay crisp, not become filled blobs. */
#toolbar .tool svg,
.object-actions button svg,
.top-actions button svg,
#askMicBtn svg {
  width: 21px !important;
  height: 21px !important;
  display: block;
  overflow: visible;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#toolbar .tool svg.fill-icon,
.top-actions button svg.fill-icon,
.play .icon svg.fill-icon {
  fill: currentColor !important;
  stroke: none !important;
}

#toolbar .colors,
#toolbar .widths,
#toolbar .colors + .sep,
#toolbar .widths + .sep,
#recordBtn,
#clearBtn {
  display: none !important;
}

/* ===== Refinamento Miro real: barra limpa + modal respirando ===== */
#toolbar {
  top: 108px;
  left: 4px;
  transform: none;
  width: 48px;
  gap: 2px;
  padding: 6px 5px;
  border-radius: 8px;
  background: #fff;
}

#toolbar .colors,
#toolbar .widths,
#toolbar [data-tool="eraser"] + .sep,
#toolbar .colors + .sep,
#toolbar .widths + .sep,
#recordBtn,
#clearBtn {
  display: none;
}

#toolbar .sep {
  width: 30px;
  margin: 6px 0;
  background: #edf0f4;
}

.tool {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.tool.active {
  background: #eef0ff;
  color: #5267f0;
}

.tool svg {
  width: 22px;
  height: 22px;
}

#topbar {
  top: 16px;
  min-height: 54px;
}

#askModal .ask-card {
  position: relative;
  width: min(430px, calc(100vw - 24px));
  padding: 16px 18px 18px;
  border-radius: 13px;
}

#askModal.expanded .ask-card,
#askModal .ask-card.expanded {
  width: min(560px, calc(100vw - 24px));
}

#askModal .ask-row {
  padding-right: 0;
}

#askModal .ask-row input {
  height: 38px;
  min-width: 0;
}

#askModal .primary {
  flex: none;
}

#askXBtn.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  font-size: 20px;
}

#askDragHandle {
  padding-right: 28px;
}

@media (max-width: 640px) {
  #toolbar {
    top: 96px;
    left: 4px;
  }

  #askModal .ask-card {
    width: min(430px, calc(100vw - 16px));
  }

  #askOptions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== Polimento final: SVGs consistentes, painel inicial e acoes ===== */
#toolbar .tool {
  color: #202331;
  font-size: 0 !important;
  line-height: 0;
}

#toolbar .tool.active {
  color: #5f4ee8;
}

#toolbar .tool > svg,
#objectActions button > svg,
#connectorActions button > svg,
#topbar button > svg,
#askMicBtn > svg {
  width: 21px !important;
  height: 21px !important;
  min-width: 21px;
  min-height: 21px;
  display: block;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#toolbar .tool > svg.fill-icon,
#topbar button > svg.fill-icon,
.play .icon svg.fill-icon {
  fill: currentColor !important;
  stroke: none !important;
}

#toolbar > .colors,
#toolbar > .widths,
#toolbar > .colors + .sep,
#toolbar > .widths + .sep,
#toolbar > #recordBtn,
#toolbar > #clearBtn {
  display: none !important;
}

.object-actions {
  gap: 6px;
  padding: 7px;
  border-radius: 10px;
}

.object-actions button {
  min-width: 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #202331;
  font-size: 0 !important;
}

.connector-actions {
  min-width: 190px;
}

/* Botão "Animar" (✨) e botão de girar/duplicar grupo: usam emoji/símbolo, então
   precisam sobrescrever o font-size:0 aplicado aos botões da barra de objetos. */
#spinObjBtn {
  font-size: 17px !important;
}
#spinObjBtn.active {
  background: var(--accent-soft, #ece9ff);
  color: var(--accent, #5f4ee8);
}

/* Menu flutuante de efeitos de animação do elemento. */
.spin-menu {
  position: fixed;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e3e0f5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(40, 30, 90, 0.18);
}
.spin-menu.hidden { display: none; }
.spin-menu button {
  text-align: left;
  padding: 7px 12px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  color: #202331;
  cursor: pointer;
  white-space: nowrap;
}
.spin-menu button:hover { background: var(--accent-soft, #ece9ff); color: var(--accent, #5f4ee8); }
.spin-menu button.active { background: var(--accent-soft, #ece9ff); color: var(--accent, #5f4ee8); font-weight: 600; }
.spin-menu .spin-menu-save {
  margin-top: 4px;
  border-top: 1px solid #eceaf6;
  padding-top: 9px;
  color: var(--accent, #5f4ee8);
  font-weight: 700;
}

#tableAddRowBtn, #tableAddColBtn, #tableRemoveRowBtn, #tableRemoveColBtn {
  width: auto;
  min-width: 50px;
  padding: 0 8px;
  font-size: 12px !important;
  white-space: nowrap;
}

.table-cell-editor {
  position: fixed;
  z-index: 260;
  border: 2px solid #6c5ce7;
  border-radius: 2px;
  padding: 0 4px;
  font-family: "Segoe UI", system-ui, sans-serif;
  box-sizing: border-box;
}

#chatFab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  z-index: 250;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}
#chatFab:hover { transform: scale(1.06); }
#chatFab svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#chatModal {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 22px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
#chatModal .chat-card {
  pointer-events: auto;
  width: min(360px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 110px));
  padding: 16px;
  gap: 10px;
  display: flex;
  flex-direction: column;
}
#chatModal h2 {
  margin: 0;
  font-size: 16px;
}
.chat-messages {
  flex: 1;
  min-height: 160px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px;
}
.chat-msg {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: #f1f1f6;
  color: #202331;
  border-bottom-left-radius: 4px;
}
.chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chat-quick button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e4e6ee;
  color: var(--accent);
}
.chat-quick button:hover {
  background: var(--accent-soft);
}
.chat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-row input {
  flex: 1;
  border: 1px solid #dfe2ea;
  border-radius: 999px;
  padding: 9px 14px;
  font: 14px "Segoe UI", system-ui, sans-serif;
}
.chat-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111,91,232,0.12);
}

.workspace-card {
  width: min(940px, calc(100vw - 34px));
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 72px rgba(31, 34, 48, 0.22);
}

.workspace-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,0.28), transparent 28%),
    linear-gradient(135deg, #1f2230, #5f4ee8 58%, #8f7cff);
}

.workspace-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workspace-hero h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.workspace-hero p {
  margin: 7px 0 0;
  color: rgba(255,255,255,0.78);
}

.workspace-count {
  min-width: 92px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.14);
  text-align: center;
}

.workspace-count strong {
  display: block;
  font-size: 28px;
}

.workspace-count span {
  color: rgba(255,255,255,0.78);
  font-size: 12px;
}

.workspace-grid {
  padding: 22px;
  max-height: min(520px, calc(100dvh - 250px));
  overflow: auto;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.workspace-tile {
  border-radius: 18px;
  border-color: #e5e7ef;
  min-height: 218px;
  padding: 12px;
  box-shadow: 0 1px 0 rgba(31, 34, 48, 0.04);
}

.workspace-thumb {
  height: 126px;
  border-radius: 14px;
  border: 1px solid #eceef5;
  cursor: pointer;
}

.workspace-new {
  min-height: 218px;
  border: 1px dashed #bab5f8;
  background: linear-gradient(180deg, #fbfbff, #f7f5ff);
}

.workspace-new span {
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(95,78,232,0.12);
}

.workspace-actions button {
  padding: 7px 9px;
  border-radius: 11px;
  background: #f4f2ff;
}

.workspace-actions button.danger,
.workspace-switch-actions button.danger {
  color: #d24b59;
  background: #fff0f2;
}

/* Paleta do canvas no estilo Miro: compacta, branca, iconografia leve. */
#toolbar {
  top: 109px !important;
  left: 4px !important;
  width: 48px !important;
  padding: 6px 5px !important;
  gap: 2px !important;
  border-radius: 14px !important;
  border: 1px solid #e7e9f0 !important;
  background: #fff !important;
  box-shadow: 0 3px 12px rgba(31, 34, 48, 0.12) !important;
}

#toolbar .tool {
  width: 38px !important;
  height: 38px !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #202331 !important;
}

#toolbar .tool > svg {
  width: 21px !important;
  height: 21px !important;
  min-width: 21px;
  min-height: 21px;
}

#toolbar .tool:hover {
  background: #f5f6fb !important;
}

#toolbar .tool.active {
  background: #ecebff !important;
  color: #5f4ee8 !important;
}

#toolbar .tool.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

#toolbar .sep {
  width: 30px !important;
  height: 1px !important;
  margin: 6px auto !important;
  background: #edf0f4 !important;
}

#toolbar > .colors,
#toolbar > .widths,
#toolbar > .colors + .sep,
#toolbar > .widths + .sep,
#toolbar > #recordBtn,
#toolbar > #clearBtn {
  display: none !important;
}

/* ===== Posição da barra de ferramentas: rodapé centralizado ===== */
body.toolbar-bottom #toolbar {
  top: auto !important;
  bottom: 14px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  flex-direction: row !important;
  width: auto !important;
}

body.toolbar-bottom #toolbar .sep {
  width: 1px !important;
  height: 34px !important;
  margin: 0 4px !important;
}

body.toolbar-bottom #toolbar .tool,
body.toolbar-bottom #toolbar .width {
  width: 46px !important;
  height: 46px !important;
}

body.toolbar-bottom #toolbar .tool > svg {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px;
  min-height: 26px;
}

/* ===== Botão de alternância de posição da toolbar ===== */
.toolbar-position-toggle svg {
  transition: transform 0.2s;
}
body:not(.toolbar-bottom) .toolbar-position-toggle svg {
  transform: rotate(90deg);
}
body.toolbar-bottom .toolbar-position-toggle svg {
  transform: rotate(0deg);
}

/* ===== Modal "Criar animação": painel flutuante sem fundo, permite
   interagir com o quadro mesmo aberto. Abre centralizado, colado abaixo
   da barra superior. ===== */
#elemAnimModal {
  position: fixed;
  inset: auto;
  top: 76px;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  background: transparent;
  backdrop-filter: none;
  display: block;
  place-items: unset;
  pointer-events: none;
  width: auto;
  height: auto;
  z-index: 240;
}
#elemAnimModal .modal-card {
  pointer-events: auto;
  margin: 0;
}
#elemAnimModal.picking .modal-card {
  display: none;
}

/* ===== Painel "Animações (N)": flutuante sem fundo, para nao bloquear
   a visualizacao da animacao sendo testada. Abre centralizado, colado
   abaixo da barra superior. ===== */
#animationsPanel {
  position: fixed;
  inset: auto;
  top: 76px;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  background: transparent;
  backdrop-filter: none;
  display: block;
  place-items: unset;
  pointer-events: none;
  width: auto;
  height: auto;
  z-index: 240;
}
#animationsPanel .modal-card {
  pointer-events: auto;
  margin: 0;
}

/* ===== Animação de conector ===== */
.conn-anim-card {
  width: min(430px, calc(100vw - 32px));
  gap: 12px;
  border-radius: 18px;
}
.anim-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.anim-modal-head h3 {
  margin: 0;
  font-size: 21px;
}
.anim-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2efff;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.conn-anim-hint {
  color: #747786;
  line-height: 1.45;
}
.anim-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.anim-flow span {
  padding: 8px 9px;
  border-radius: 12px;
  background: #f5f5f8;
  color: #858795;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.anim-flow span.active {
  background: #ecebff;
  color: var(--accent);
}
.anim-flow span.done {
  background: #eaf8ea;
  color: var(--ok);
}
.conn-anim-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 8px;
  padding: 0 0 0 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.conn-anim-steps li.active {
  color: var(--accent);
  font-weight: 700;
}
.conn-anim-steps li.done {
  color: var(--ok);
}
.conn-anim-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.conn-anim-line-effect {
  padding-top: 8px;
  border-top: 1px solid var(--accent-soft);
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.radio-row input { accent-color: var(--accent); }
.conn-anim-status {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
}
.conn-anim-status.has-anim { color: var(--ok); font-weight: 600; }
.conn-anim-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.anim-main-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.anim-main-actions button {
  min-height: 42px;
  border-radius: 12px;
  font-weight: 800;
}
.anim-secondary-actions {
  justify-content: space-between;
  border-top: 1px solid #edf0f4;
  padding-top: 10px;
}
.path-picks {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
}
.path-picks span {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f6f6f8;
  color: #747786;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.path-picks span.filled {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.path-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.path-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #747786;
  font-size: 13px;
  font-weight: 700;
}
.path-options select {
  border: 1.5px solid #e2e2e8;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
}
.animated-icon-preview {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
  background: transparent;
}
.animated-icon-preview.fallback {
  border: 4px solid #ecebff;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.85s linear infinite;
}

#pathAnimModal {
  position: fixed;
  inset: auto 16px 16px auto;
  top: auto;
  left: auto;
  right: 16px;
  bottom: 16px;
  background: transparent;
  backdrop-filter: none;
  display: block;
  place-items: unset;
  pointer-events: none;
  width: auto;
  height: auto;
  z-index: 240;
}
#pathAnimModal .modal-card {
  pointer-events: auto;
  margin: 0;
}
#pathAnimModal.picking .modal-card {
  display: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.conn-anim-actions .ghost.danger {
  color: #d24b59;
  background: #fff0f2;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
}
.conn-anim-actions .spacer { flex: 1; }
.conn-anim-actions .ghost.active {
  opacity: 1;
  color: var(--accent);
  font-weight: 700;
}
.conn-anim-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rec-indicator {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  z-index: 250;
}
.rec-indicator.hidden { display: none; }
.rec-indicator .rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: rec-blink 1s infinite;
}
.rec-indicator.paused .rec-dot {
  background: var(--accent);
  animation: none;
}
.rec-indicator button {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
}
.rec-indicator button.pause {
  background: #f1efff;
  color: var(--accent);
}
.rec-indicator.paused button.pause {
  background: var(--accent);
  color: #fff;
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ===== Linha do tempo de animação ===== */
.anim-timeline {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  background: var(--card);
  /* defina abaixo; em player-mode alargamos para caber os controles numa linha */
  color: var(--ink);
  border: 1px solid #e7e9f0;
  border-radius: 16px;
  box-shadow: 0 18px 52px rgba(31, 34, 48, 0.18);
  padding: 12px;
  z-index: 230;
}
body.toolbar-bottom .anim-timeline {
  bottom: 88px;
}
.anim-timeline.hidden { display: none; }
.anim-timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.anim-timeline-head span {
  font-weight: 800;
  font-size: 14px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* O nome nao deve crescer e empurrar o lapis para o fim da barra: o lapis
   precisa ficar colado a ele. Um spacer (depois do botao de renomear) eh
   quem ocupa o espaco livre, empurrando PLAY/SALVAR/X para a direita. */
#animTimelineLabel {
  flex: 0 1 auto;
  max-width: 40%;
}
.anim-timeline-spacer {
  flex: 1;
}
.anim-rename-btn {
  min-width: 26px !important;
  width: 26px;
  height: 26px !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  border-radius: 8px !important;
  flex: none;
}
.anim-rename-btn:hover {
  background: #f4f2ff !important;
  color: var(--accent) !important;
}
.anim-rename-btn svg {
  width: 14px !important;
  height: 14px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.anim-timeline-head button {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f4f2ff;
  color: var(--accent);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}
.anim-timeline-head button svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.anim-timeline-head button .btn-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.anim-timeline-head button.active {
  background: var(--accent);
  color: #fff;
}
.anim-timeline-head button.primary {
  background: var(--accent);
  color: #fff;
}
.anim-timeline-head button.danger {
  background: var(--danger);
  color: #fff;
}
#animTimelineSaveBtn {
  display: none;
  background: #e6f9ee;
  font-size: 16px;
}
.anim-timeline.player-mode #animTimelineSaveBtn {
  display: inline-flex !important;
}
.anim-rename-btn {
  display: none;
}
.anim-timeline.player-mode .anim-rename-btn {
  display: inline-flex !important;
}
#animTimelineSaveBtn:hover {
  background: #2ecc71;
}
.anim-timeline.paused {
  border-color: rgba(108, 92, 231, 0.34);
  box-shadow: 0 18px 52px rgba(108, 92, 231, 0.2);
}
.anim-timeline.paused #animTimelinePauseBtn {
  background: var(--accent);
  color: #fff;
}
.anim-timeline.paused .anim-timeline-track {
  opacity: 0.72;
}
#animTimelineCloseBtn {
  background: transparent;
  color: var(--ink);
  padding: 5px 8px;
}
.anim-timeline-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  color: #747786;
  font-size: 11px;
}
.anim-timeline-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f6f6f8;
}
.anim-timeline-stats strong {
  color: #202331;
  font-size: 12px;
}
.anim-edit-tools {
  display: none;
  gap: 6px;
  margin-bottom: 8px;
}
.anim-timeline.player-mode .anim-edit-tools {
  display: flex !important;
  flex-wrap: wrap;
}
.anim-edit-tools button {
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  background: #f4f5f8;
  color: #4b4e5c;
  font-size: 12px;
  font-weight: 800;
}
.anim-edit-tools button:hover,
.anim-edit-tools button.active {
  background: #ecebff;
  color: var(--accent);
}
.anim-player-tools {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px 14px;
}
/* Em modo player a linha do tempo alarga para caber velocidades + "fixar
   rotação" + "cinematográfica" + "ver trajeto" + "ver seleção" + "duração
   total" numa só linha. */
.anim-timeline.player-mode {
  width: min(1180px, calc(100vw - 32px));
}
.anim-speed-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.anim-player-tools .anim-cinematic-row,
.anim-player-tools .anim-duration-row {
  flex-shrink: 0;
  white-space: nowrap;
}
.anim-player-tools .anim-duration-row {
  margin-left: auto;
}
.anim-cinematic-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #4b4e5c;
  cursor: pointer;
}
.anim-cinematic-row input { accent-color: var(--accent); }
.anim-cinematic-row.hidden { display: none !important; }
.anim-duration-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #4b4e5c;
}
.anim-duration-row input {
  width: 64px;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid #e5e7ef;
  background: #fff;
  color: #2a2d3a;
  font-size: 12px;
  font-weight: 800;
}
.anim-duration-row span { color: var(--muted); font-weight: 700; }
.anim-timeline-track {
  position: relative;
  height: 42px;
  border-radius: 12px;
  background: #f4f4f7;
  opacity: 1;
  border: 1px solid #e5e7ef;
  /* Sem overflow:hidden aqui: o playhead (handle redondo) precisa ficar
     totalmente visivel mesmo em 0% e 100%, sem ser cortado pela borda. */
}
.anim-timeline-track::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background:
    linear-gradient(90deg, rgba(32,35,49,0.12) 1px, transparent 1px) 0 0 / 48px 100%,
    linear-gradient(90deg, rgba(32,35,49,0.06) 1px, transparent 1px) 0 0 / 12px 100%;
  pointer-events: none;
}
.anim-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(111,91,232,0.18), rgba(111,91,232,0.08));
  opacity: 1;
}
.anim-timeline-markers {
  position: absolute;
  inset: 0;
}
.anim-timeline-marker {
  position: absolute;
  top: 11px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(31,34,48,0.18);
}
.anim-timeline-marker.show { background: #2ecc71; }
.anim-timeline-marker.hide { background: #e74c3c; }
.anim-timeline-marker.keyframe {
  background: var(--accent);
  width: 14px;
  height: 14px;
  top: 11px;
  border: 2px solid #fff;
  border-radius: 3px;
  transform: translateX(-50%) rotate(45deg);
}
.anim-timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  /* Centra a linha sobre o ponto "left:%", em vez de encostar a borda
     esquerda nele — assim ela fica visivel mesmo em 0% e 100%. */
  transform: translateX(-50%);
  background: #ef476f;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(239,71,111,0.18);
}
.anim-timeline-playhead::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef476f;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(239,71,111,0.4);
  transform: translateX(-50%);
}
.anim-timeline-playhead.hidden {
  display: none;
}
.anim-timeline.player-mode .anim-timeline-track {
  cursor: pointer;
  opacity: 1;
}
.anim-timeline.player-mode #animTimelineFrameBtn,
.anim-timeline.player-mode #animTimelinePauseBtn,
.anim-timeline.player-mode #animTimelineStopBtn {
  display: none !important;
}
.anim-timeline-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* ===== Painel de elementos ocultos ===== */
.hidden-elements-card { width: min(380px, calc(100vw - 32px)); }
.animations-card {
  width: min(640px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 20px;
  gap: 10px;
}
.animations-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.animations-head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.35px;
}
.animations-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8c7cff);
  box-shadow: 0 12px 24px rgba(108, 92, 231, 0.28);
}
.animations-icon::before {
  content: "";
  width: 23px;
  height: 23px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm2 0v16M18 4v16M2 9h4M18 9h4M2 15h4M18 15h4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm2 0v16M18 4v16M2 9h4M18 9h4M2 15h4M18 15h4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.animations-subtitle {
  margin: -2px 0 4px 58px;
  color: #7b7e8e;
  font-size: 13px;
}
.hidden-elements-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  margin: 10px 0;
}
.hidden-elements-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}
.hidden-elements-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hidden-elements-thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8d5ef;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hidden-elements-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hidden-elements-thumb-emoji {
  font-size: 20px;
}
.hidden-elements-thumb-color {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.hidden-elements-row button {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
}
.hidden-elements-row button:hover { background: var(--accent); color: #fff; }
.animations-row {
  min-height: 70px;
  padding: 10px;
  gap: 12px;
  background: linear-gradient(180deg, #fbfbfe, #f7f7fb);
  border: 1px solid #ececf4;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(31, 34, 48, 0.06);
}
.animations-row .hidden-elements-thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border-color: #dcd8ff;
  background: #fff;
}
.animations-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.animations-info span {
  font-weight: 800;
  color: #242633;
}
.animations-info small {
  color: #888b9a;
  font-size: 11.5px;
}
.animations-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: nowrap;
  flex: none;
}
.animations-row .animations-actions button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: #f1efff;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.08);
}
.animations-row .animations-actions button.primary-action {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(108, 92, 231, 0.24);
}
.animations-row .animations-actions button.danger-action {
  background: #fff0f2;
  color: #d24b59;
}
.animations-row .animations-actions button:hover {
  transform: translateY(-1px);
}
@media (max-width: 560px) {
  .animations-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .animations-actions {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    padding-left: 60px;
  }
}
.hidden-elements-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

/* ===== Modal de confirmação ===== */
.confirm-card { width: min(420px, calc(100vw - 32px)); }
.primary.danger {
  background: #e64553;
}
.primary.danger:hover { transform: scale(1.04); }

/* ===== Selecao agrupada ===== */
#multiSelectActions {
  position: fixed;
  display: flex;
  gap: 6px;
  z-index: 220;
}
#multiSelectActions.hidden { display: none; }
#multiSelectActions button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 18px;
  display: grid;
  place-items: center;
}
#multiSelectActions button:hover { background: var(--accent-soft); color: var(--accent); }
#multiSelectActions svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Réguas de medida ===== */
.ruler {
  position: fixed;
  background: #ffffffee;
  box-shadow: var(--shadow);
  z-index: 150;
  overflow: hidden;
  pointer-events: none;
}
.ruler.hidden { display: none; }
.ruler-h { left: 0; right: 28px; bottom: 0; height: 28px; }
.ruler-v { top: 0; right: 0; bottom: 28px; width: 28px; }
.ruler-tick { position: absolute; background: #9aa0c8; }
.ruler-h .ruler-tick { top: 0; width: 1px; }
.ruler-v .ruler-tick { left: 0; height: 1px; }
.ruler-tick.major { background: #5f4ee8; }
.ruler-label { position: absolute; font-size: 10px; color: #5f4ee8; font-weight: 600; white-space: nowrap; }
.ruler-h .ruler-label { bottom: 2px; }
.ruler-v .ruler-label { right: 2px; transform: rotate(90deg) translateY(-100%); transform-origin: right top; }
.ruler-corner {
  position: fixed;
  right: 0; bottom: 0;
  width: 28px; height: 28px;
  background: #ffffffee;
  box-shadow: var(--shadow);
  z-index: 151;
}
.ruler-corner.hidden { display: none; }

/* ===== Menu de contexto: personalizar ===== */
.context-menu-footer {
  border-top: 1px solid #edf0f4;
  margin-top: 4px;
  padding-top: 4px;
}
.context-menu button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.custom-menu-card { width: min(460px, calc(100vw - 32px)); }
.custom-menu-card h3 { font-size: 14px; margin-top: 4px; }
.custom-menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
  border: 1.5px dashed #e2e2e8;
  border-radius: 10px;
  padding: 6px;
}
.custom-menu-available { border-style: solid; }
.custom-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7f7fb;
  cursor: grab;
  font-size: 14px;
}
.custom-menu-item.dragging { opacity: 0.4; }
.custom-menu-item .context-menu-glyph svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.custom-menu-item button.remove-item {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.custom-menu-item button.remove-item:hover { color: #e64553; }

/* ===== Alternar area de trabalho ===== */
.workspace-switch-trigger {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 240;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe2ea;
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-soft);
  color: #202331;
  font-size: 0;
  backdrop-filter: blur(10px);
}
.workspace-switch-trigger:hover {
  background: #f4f2ff;
  color: var(--accent);
}
.workspace-switch-trigger svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floating-panel.hidden { display: none; }
.workspace-switch {
  position: fixed;
  top: 70px;
  right: 18px;
  width: min(390px, calc(100vw - 28px));
  max-height: min(560px, calc(100dvh - 96px));
  z-index: 260;
  padding: 12px;
  border: 1px solid #e4e6ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 58px rgba(31, 34, 48, 0.22);
  backdrop-filter: blur(14px);
}
.workspace-switch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 10px;
}
.workspace-switch-head strong {
  display: block;
  font-size: 15px;
}
.workspace-switch-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.workspace-switch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 390px;
  overflow: auto;
  padding-right: 2px;
}
.workspace-switch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: #fff;
}
.workspace-switch-item.active {
  border-color: #c9c4ff;
  background: #f7f5ff;
}
.workspace-switch-item.loading {
  grid-template-columns: 58px minmax(0, 1fr);
  color: var(--muted);
}
.workspace-switch-item.loading .workspace-switch-thumb {
  display: block;
  position: relative;
}
.workspace-switch-item.loading .workspace-switch-thumb::after {
  content: "";
  position: absolute;
  inset: 11px 20px;
  border: 2px solid #d9d6ff;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.workspace-switch-open {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  text-align: left;
  align-items: center;
  min-width: 0;
}
.workspace-switch-open strong,
.workspace-switch-open small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-switch-open small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.workspace-switch-thumb {
  width: 58px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e7e9f0;
  background:
    linear-gradient(#eeeeeb 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, #eeeeeb 1px, transparent 1px) 0 0 / 12px 12px,
    #fbfbfa;
}
.workspace-switch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.workspace-switch-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.workspace-switch-actions button {
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  background: #f4f2ff;
}
.workspace-switch-new {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #fff;
  font-weight: 800;
  background: var(--accent);
}
.workspace-switch-empty {
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #dfe2ea;
  border-radius: 12px;
}

.tour-panel {
  position: fixed;
  top: 70px;
  right: 70px;
  width: min(340px, calc(100vw - 28px));
  max-height: min(560px, calc(100dvh - 96px));
  z-index: 260;
  padding: 12px;
  border: 1px solid #e4e6ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 58px rgba(31, 34, 48, 0.22);
  backdrop-filter: blur(14px);
  overflow: auto;
}
.tour-panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tour-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e4e6ee;
  border-radius: 11px;
  background: #fff;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.tour-action:hover {
  background: #f4f2ff;
  border-color: var(--accent);
}
.tour-action.active {
  background: var(--accent);
  border-color: var(--accent);
}
.tour-action.active .tour-action-title,
.tour-action.active .tour-action-desc {
  color: #fff;
}
.tour-action-title {
  font-weight: 800;
  font-size: 13px;
  color: #202331;
}
.tour-action-desc {
  font-size: 11.5px;
  color: var(--muted);
}
.tour-action-danger .tour-action-title {
  color: #d23b3b;
}
.tour-action-switch {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tour-action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tour-switch {
  flex: none;
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: #d8d8e6;
  transition: background 0.2s;
}
.tour-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31,34,48,0.25);
  transition: transform 0.2s;
}
.tour-action-switch.is-on .tour-switch {
  background: var(--accent);
}
.tour-action-switch.is-on .tour-switch-knob {
  transform: translateX(16px);
}
#tourGuiadoBtn.active {
  background: var(--accent);
  color: #fff;
}

.parcerus-watermark {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 350;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 22, 34, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-soft);
  opacity: 0.5;
  transition: background 0.2s, opacity 0.2s, transform 0.2s;
}
.parcerus-watermark:hover {
  background: rgba(20, 22, 34, 0.78);
  opacity: 1;
  transform: translateX(-50%) translateY(-1px);
}

.workspace-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(8px);
}
.workspace-loading-overlay.hidden { display: none; }
.workspace-loading-card {
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid #e4e6ee;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 22px 70px rgba(31,34,48,0.2);
}
.workspace-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #d9d6ff;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Modal de formatação de tabela ===== */
.table-format-card { width: min(560px, calc(100vw - 32px)); }
.table-format-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.table-format-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.table-name-field { flex: 1 1 220px; }
.table-name-field input[type="text"] { width: 100%; padding: 7px 9px; border: 1.5px solid #e2e2e8; border-radius: 8px; }
.table-format-row input[type="number"] { width: 70px; padding: 7px 9px; border: 1.5px solid #e2e2e8; border-radius: 8px; }
.table-format-row select { padding: 7px 9px; border: 1.5px solid #e2e2e8; border-radius: 8px; }
.table-align-group {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1.5px solid #e2e2e8;
  border-radius: 10px;
  background: #fff;
}
.table-align-group button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #202331;
  font-size: 0;
}
.table-align-group button:hover {
  background: #f4f5fb;
}
.table-align-group button.active {
  color: #5f4ee8;
  background: #ecebff;
}
.table-align-group button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.table-format-row input[type="color"] { width: 40px; height: 32px; border-radius: 8px; border: 1.5px solid #e2e2e8; padding: 2px; }
.table-format-grid {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
  background: #f7f7fb;
  border-radius: 10px;
}
.table-format-grid input[type="text"] {
  width: 100%;
  font-size: 12px;
  padding: 6px 7px;
  border: 1.5px solid #e2e2e8;
  border-radius: 6px;
  font-family: inherit;
}
.table-format-grid input[type="text"].header-cell {
  font-weight: 700;
  background: #eef0ff;
}

/* ===== Edicao inline (notas/texto) ===== */
.inline-editor {
  position: fixed;
  z-index: 250;
  resize: none;
  border: 2px solid #6c5ce7;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  background: transparent;
}
