/* TinkyMind dock — floating movable widgets inside the builder.
   Brand-dark panels over the light builder canvas; high z-index but
   below modals (builder modals use 9000+; dock sits at 8000). */
.tmd-widget {
  position: fixed;
  z-index: 8000;
  min-width: 240px;
  max-width: 92vw;
  background: linear-gradient(165deg, #13111a, #1a2030);
  color: #f4f2ec;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  resize: horizontal;
  overflow: hidden;
}
.tmd-hidden { display: none; }
.tmd-dragging { opacity: 0.88; cursor: grabbing; }
.tmd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; cursor: grab; user-select: none; touch-action: none;
  font-size: 0.85rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.tmd-close {
  background: none; border: none; color:var(--ink-muted); cursor: pointer;
  font-size: 0.9rem; padding: 2px 6px; border-radius: 6px;
}
.tmd-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.tmd-body { padding: 10px; }

/* tiles */
.tmd-source { font-size: 0.7rem; color:var(--ink-muted); min-height: 1em; text-align: right; }
.tmd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.tmd-tile {
  min-height: 76px; padding: 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06);
  color: #f4f2ec; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px;
}
.tmd-tile:hover { border-color: #f5b942; }
.tmd-tile-emoji { font-size: 1.5rem; line-height: 1; }
.tmd-tile-label { font-size: 0.78rem; text-align: center; line-height: 1.25; }

/* chat */
.tmd-thread {
  min-height: 120px; max-height: 280px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.tmd-bubble { padding: 6px 10px; border-radius: 9px; max-width: 85%; font-size: 0.85rem; }
.tmd-care { background: #2b3a55; align-self: flex-start; }
.tmd-kid { background: #2e7d5b; align-self: flex-end; }

/* ask */
.tmd-status { font-size: 0.75rem; color:var(--ink-muted); min-height: 1em; margin-bottom: 6px; }
.tmd-status[data-kind="error"] { color: #ff8a80; }
.tmd-status[data-kind="ok"] { color: #9be7c4; }
.tmd-askrow { display: flex; gap: 6px; }
#tmd-mic {
  padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06);
  color: #f4f2ec;
}
#tmd-mic.tmd-listening {
  background: #7a2330; border-color: #ff8a80;
  animation: tmd-pulse 1.2s ease-in-out infinite;
}
@keyframes tmd-pulse { 50% { box-shadow: 0 0 0 5px rgba(255, 138, 128, 0.25); } }
#tmd-input {
  flex: 1; padding: 8px; border-radius: 9px; font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.3); color: #f4f2ec;
}
#tmd-send {
  padding: 8px 14px; border-radius: 9px; border: none; cursor: pointer;
  font-weight: 700; background: #f5b942; color: #1a1408; font-size: 0.85rem;
}
.tmd-micstate { font-size: 0.7rem; color: #ff8a80; min-height: 1em; margin-top: 4px; }
